File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 76467646 } ,
76477647
76487648 posFromIndex : function ( off ) {
7649- var ch , lineNo = this . first ;
7649+ var ch , lineNo = this . first , sepSize = this . lineSeparator ( ) . length ;
76507650 this . iter ( function ( line ) {
7651- var sz = line . text . length + 1 ;
7651+ var sz = line . text . length + sepSize ;
76527652 if ( sz > off ) { ch = off ; return true ; }
76537653 off -= sz ;
76547654 ++ lineNo ;
76597659 coords = clipPos ( this , coords ) ;
76607660 var index = coords . ch ;
76617661 if ( coords . line < this . first || coords . ch < 0 ) return 0 ;
7662+ var sepSize = this . lineSeparator ( ) . length ;
76627663 this . iter ( this . first , coords . line , function ( line ) {
7663- index += line . text . length + 1 ;
7664+ index += line . text . length + sepSize ;
76647665 } ) ;
76657666 return index ;
76667667 } ,
You can’t perform that action at this time.
0 commit comments