File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2187,7 +2187,7 @@ var EditSession = function(text, mode) {
21872187
21882188 while ( row <= screenRow ) {
21892189 rowLength = this . getRowLength ( docRow ) ;
2190- if ( row + rowLength - 1 >= screenRow || docRow >= maxRow ) {
2190+ if ( row + rowLength > screenRow || docRow >= maxRow ) {
21912191 break ;
21922192 } else {
21932193 row += rowLength ;
@@ -2222,9 +2222,10 @@ var EditSession = function(text, mode) {
22222222 if ( this . $useWrapMode ) {
22232223 var splits = this . $wrapData [ docRow ] ;
22242224 if ( splits ) {
2225- column = splits [ screenRow - row ] ;
2226- if ( screenRow > row && splits . length ) {
2227- docColumn = splits [ screenRow - row - 1 ] || splits [ splits . length - 1 ] ;
2225+ var splitIndex = Math . floor ( screenRow - row ) ;
2226+ column = splits [ splitIndex ] ;
2227+ if ( splitIndex > 0 && splits . length ) {
2228+ docColumn = splits [ splitIndex - 1 ] || splits [ splits . length - 1 ] ;
22282229 line = line . substring ( docColumn ) ;
22292230 }
22302231 }
Original file line number Diff line number Diff line change @@ -627,6 +627,8 @@ function Folding() {
627627 if ( depth == undefined )
628628 depth = 100000 ; // JSON.stringify doesn't hanle Infinity
629629 var foldWidgets = this . foldWidgets ;
630+ if ( ! foldWidgets )
631+ return ; // mode doesn't support folding
630632 endRow = endRow || this . getLength ( ) ;
631633 startRow = startRow || 0 ;
632634 for ( var row = startRow ; row < endRow ; row ++ ) {
You can’t perform that action at this time.
0 commit comments