Skip to content

Commit 85ddee0

Browse files
authored
Fix tiny (#87)
1 parent 15b02a9 commit 85ddee0

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

autoload/pydocstring.vim

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,13 @@ function! s:insert_docstring(docstrings, end_lineno) abort
4747
silent! execute 'normal! ' . a:end_lineno . 'G$'
4848
endfunction
4949

50-
function! s:callback(ch, msg, indent, start_lineno) abort
50+
function! s:callback(msg, indent, start_lineno) abort
5151
let docstrings = reverse(json_decode(a:msg))
5252
silent! execute 'normal! 0'
53+
let length = len(docstrings)
5354
for docstring in docstrings
5455
let lineno = 0
55-
if len(docstrings) > 1
56+
if length > 1
5657
call cursor(a:start_lineno + docstring['start_lineno'] - 1, 1)
5758
let lineno = search('\:\(\s*#.*\)*$', 'n') + 1
5859
else
@@ -63,11 +64,11 @@ function! s:callback(ch, msg, indent, start_lineno) abort
6364
endfor
6465
endfunction
6566

66-
function! s:format_callback(ch, msg, indent, start_lineno) abort
67+
function! s:format_callback(msg, indent, start_lineno) abort
6768
call add(s:results, a:msg)
6869
endfunction
6970

70-
function! s:exit_callback(ch, msg) abort
71+
function! s:exit_callback(msg) abort
7172
if len(s:results)
7273
let view = winsaveview()
7374
silent execute '% delete'
@@ -90,8 +91,8 @@ function! s:execute(cmd, lines, indent, start_lineno, cb, ex_cb) abort
9091
endif
9192

9293
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)},
9596
\ 'in_mode': 'nl',
9697
\ })
9798

0 commit comments

Comments
 (0)