@@ -47,12 +47,13 @@ function! s:insert_docstring(docstrings, end_lineno) abort
47
47
silent ! execute ' normal! ' . a: end_lineno . ' G$'
48
48
endfunction
49
49
50
- function ! s: callback (ch , msg, indent , start_lineno) abort
50
+ function ! s: callback (msg, indent , start_lineno) abort
51
51
let docstrings = reverse (json_decode (a: msg ))
52
52
silent ! execute ' normal! 0'
53
+ let length = len (docstrings)
53
54
for docstring in docstrings
54
55
let lineno = 0
55
- if len (docstrings) > 1
56
+ if length > 1
56
57
call cursor (a: start_lineno + docstring[' start_lineno' ] - 1 , 1 )
57
58
let lineno = search (' \:\(\s*#.*\)*$' , ' n' ) + 1
58
59
else
@@ -63,11 +64,11 @@ function! s:callback(ch, msg, indent, start_lineno) abort
63
64
endfor
64
65
endfunction
65
66
66
- function ! s: format_callback (ch , msg, indent , start_lineno) abort
67
+ function ! s: format_callback (msg, indent , start_lineno) abort
67
68
call add (s: results , a: msg )
68
69
endfunction
69
70
70
- function ! s: exit_callback (ch , msg) abort
71
+ function ! s: exit_callback (msg) abort
71
72
if len (s: results )
72
73
let view = winsaveview ()
73
74
silent execute ' % delete'
@@ -90,8 +91,8 @@ function! s:execute(cmd, lines, indent, start_lineno, cb, ex_cb) abort
90
91
endif
91
92
92
93
let s: job = job_start (a: cmd , {
93
- \ ' callback' : {c , m - > a: cb (c , m , a: indent , a: start_lineno )},
94
- \ ' exit_cb' : {c , m - > a: ex_cb (c , m )},
94
+ \ ' callback' : {_ , m - > a: cb (m , a: indent , a: start_lineno )},
95
+ \ ' exit_cb' : {_ , m - > a: ex_cb (m )},
95
96
\ ' in_mode' : ' nl' ,
96
97
\ })
97
98
0 commit comments