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 2222 if ( dir < 0 && start . ch == 0 ) return doc . clipPos ( Pos ( start . line - 1 ) ) ;
2323 var line = doc . getLine ( start . line ) ;
2424 if ( dir > 0 && start . ch >= line . length ) return doc . clipPos ( Pos ( start . line + 1 , 0 ) ) ;
25- var state = "start" , type ;
26- for ( var pos = start . ch , e = dir < 0 ? 0 : line . length , i = 0 ; pos != e ; pos += dir , i ++ ) {
25+ var state = "start" , type , startPos = start . ch ;
26+ for ( var pos = startPos , e = dir < 0 ? 0 : line . length , i = 0 ; pos != e ; pos += dir , i ++ ) {
2727 var next = line . charAt ( dir < 0 ? pos - 1 : pos ) ;
2828 var cat = next != "_" && CodeMirror . isWordChar ( next ) ? "w" : "o" ;
2929 if ( cat == "w" && next . toUpperCase ( ) == next ) cat = "W" ;
3030 if ( state == "start" ) {
3131 if ( cat != "o" ) { state = "in" ; type = cat ; }
32+ else startPos = pos + dir
3233 } else if ( state == "in" ) {
3334 if ( type != cat ) {
3435 if ( type == "w" && cat == "W" && dir < 0 ) pos -- ;
3536 if ( type == "W" && cat == "w" && dir > 0 ) { // From uppercase to lowercase
36- if ( pos == start . ch + 1 ) { type = "w" ; continue ; }
37+ if ( pos == startPos + 1 ) { type = "w" ; continue ; }
3738 else pos -- ;
3839 }
3940 break ;
You can’t perform that action at this time.
0 commit comments