Skip to content

Commit 00f862b

Browse files
authored
Merge pull request #41 from haya14busa/make-input-non-flexible
Do not make input flexible needlessly
2 parents 5059253 + 1b2d9b2 commit 00f862b

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

autoload/vimlparser.vim

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function! vimlparser#test(input, ...)
1818
else
1919
let l:neovim = 0
2020
endif
21-
let i = type(a:input) == 1 && filereadable(a:input) ? readfile(a:input) : a:input
21+
let i = type(a:input) == 1 && filereadable(a:input) ? readfile(a:input) : [a:input]
2222
let r = s:StringReader.new(i)
2323
let p = s:VimLParser.new(l:neovim)
2424
let c = s:Compiler.new()
@@ -3639,21 +3639,20 @@ function! s:StringReader.new(...)
36393639
endfunction
36403640

36413641
function! s:StringReader.__init__(lines)
3642-
let lines = type(a:lines) == 3 ? a:lines : [a:lines]
36433642
let self.buf = []
36443643
let self.pos = []
36453644
let lnum = 0
3646-
while lnum < len(lines)
3645+
while lnum < len(a:lines)
36473646
let col = 0
3648-
for c in split(lines[lnum], '\zs')
3647+
for c in split(a:lines[lnum], '\zs')
36493648
call add(self.buf, c)
36503649
call add(self.pos, [lnum + 1, col + 1])
36513650
let col += len(c)
36523651
endfor
3653-
while lnum + 1 < len(lines) && lines[lnum + 1] =~# '^\s*\\'
3652+
while lnum + 1 < len(a:lines) && a:lines[lnum + 1] =~# '^\s*\\'
36543653
let skip = s:TRUE
36553654
let col = 0
3656-
for c in split(lines[lnum + 1], '\zs')
3655+
for c in split(a:lines[lnum + 1], '\zs')
36573656
if skip
36583657
if c == '\'
36593658
let skip = s:FALSE

0 commit comments

Comments
 (0)