File tree Expand file tree Collapse file tree 5 files changed +13
-5
lines changed Expand file tree Collapse file tree 5 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -949,7 +949,7 @@ function! s:VimLParser.find_command() abort
949949 endif
950950 endfor
951951
952- if self .neovim
952+ if self .neovim
953953 for x in self .neovim_additional_commands
954954 if stridx (x .name, name) == # 0 && len (name) >= x .minlen
955955 unlet cmd
@@ -966,7 +966,7 @@ function! s:VimLParser.find_command() abort
966966 endif
967967 endfor
968968 endif
969-
969+
970970 " FIXME: user defined command
971971 if (cmd is # s: NIL || cmd.name == # ' Print' ) && name = ~# ' ^[A-Z]'
972972 let name .= self .reader.read_alnum ()
@@ -4681,8 +4681,10 @@ endfunction
46814681
46824682function ! s: StringReader .read_nonwhite () abort
46834683 let r = ' '
4684- while ! s: iswhite (self .peekn (1 ))
4684+ let ch = self .peekn (1 )
4685+ while ! s: iswhite (ch ) && ch !=# ' '
46854686 let r .= self .getn (1 )
4687+ let ch = self .peekn (1 )
46864688 endwhile
46874689 return r
46884690endfunction
Original file line number Diff line number Diff line change @@ -4102,8 +4102,10 @@ StringReader.prototype.read_white = function() {
41024102
41034103StringReader . prototype . read_nonwhite = function ( ) {
41044104 var r = "" ;
4105- while ( ! iswhite ( this . peekn ( 1 ) ) ) {
4105+ var ch = this . peekn ( 1 ) ;
4106+ while ( ! iswhite ( ch ) && ch != "" ) {
41064107 r += this . getn ( 1 ) ;
4108+ var ch = this . peekn ( 1 ) ;
41074109 }
41084110 return r ;
41094111}
Original file line number Diff line number Diff line change @@ -3319,8 +3319,10 @@ def read_white(self):
33193319
33203320 def read_nonwhite (self ):
33213321 r = ""
3322- while not iswhite (self .peekn (1 )):
3322+ ch = self .peekn (1 )
3323+ while not iswhite (ch ) and ch != "" :
33233324 r += self .getn (1 )
3325+ ch = self .peekn (1 )
33243326 return r
33253327
33263328 def read_name (self ):
Original file line number Diff line number Diff line change 33(excmd "normal gg")
44(excmd "Usercmd x, y z 123")
55(excmd "Usercmd! with bang")
6+ (excmd "write ++enc=utf-8")
Original file line number Diff line number Diff line change @@ -3,3 +3,4 @@ normal! gg
33normal gg
44Usercmd x , y z 123
55Usercmd! with bang
6+ write ++ enc = utf- 8
You can’t perform that action at this time.
0 commit comments