Skip to content

Commit 4a54801

Browse files
committed
Avoid using string subscript
Some language (e.g. Go) doesn't support string subscript.
1 parent 377b6cd commit 4a54801

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

autoload/vimlparser.vim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1226,7 +1226,8 @@ function! s:VimLParser.parse_cmd_function()
12261226

12271227
if left.type == s:NODE_IDENTIFIER
12281228
let s = left.value
1229-
if s[0] !=# '<' && !s:isupper(s[0]) && stridx(s, ':') == -1 && stridx(s, '#') == -1
1229+
let ss = split(s, '\zs')
1230+
if ss[0] !=# '<' && !s:isupper(ss[0]) && stridx(s, ':') == -1 && stridx(s, '#') == -1
12301231
throw s:Err(printf('E128: Function name must start with a capital or contain a colon: %s', s), left.pos)
12311232
endif
12321233
endif

0 commit comments

Comments
 (0)