File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
autoload/vital/__vital__/Deprecated/Text Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -28,9 +28,20 @@ function! s:_vital_depends() abort
28
28
\ }
29
29
endfunction
30
30
31
+ " lua array index as 0 based.
32
+ let s: _base = 0
33
+ if has (' patch-8.2.1066' )
34
+ " fix lua array index as 1 based.
35
+ let s: _base = 1
36
+ endif
37
+ function ! s: _index (idx) abort
38
+ return printf (' %d' , s: _base + a: idx )
39
+ endfunction
40
+
31
41
function ! s: parse (sexp) abort
32
42
if exists (' *luaeval' )
33
- return luaeval (' _G[_A[0]].vim.parse(_A[1])' , [s: sfile , a: sexp ])
43
+ return luaeval (' _G[_A[' . s: _index (0 ) . ' ]].vim.parse(_A[' . s: _index (1 ) . ' ])' , [s: sfile , a: sexp ])
44
+ " return luaeval('_G[_A[0]].vim.parse(_A[1])', [s:sfile, a:sexp])
34
45
" return luaeval('vital_text_sexp.parse(_A)', a:sexp)
35
46
" return luaeval('vital_text_sexp.parse(vital_text_sexp.parse(_A))', a:sexp)
36
47
else
You can’t perform that action at this time.
0 commit comments