Skip to content

Commit 15aa97b

Browse files
authored
Merge pull request #118 from tsuyoshicho/fix/buffer-local-230201206
fix: buffer local mapping
2 parents 11fd9f4 + 03dce2d commit 15aa97b

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

ftplugin/python/pydocstring.vim

+6-10
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,13 @@ if !has('nvim') && (!has('channel') || !has('job'))
1414
finish
1515
endif
1616

17-
command! -nargs=0 -range=0 -complete=customlist,pydocstring#insert Pydocstring call pydocstring#insert(<q-args>, <count>, <line1>, <line2>)
18-
command! -nargs=0 -complete=customlist,pydocstring#format PydocstringFormat call pydocstring#format()
17+
command! -buffer -nargs=0 -range=0 -complete=customlist,pydocstring#insert Pydocstring call pydocstring#insert(<q-args>, <count>, <line1>, <line2>)
18+
command! -buffer -nargs=0 -complete=customlist,pydocstring#format PydocstringFormat call pydocstring#format()
1919

20-
if !exists('g:pydocstring_enable_mapping')
21-
let g:pydocstring_enable_mapping = 1
22-
endif
23-
24-
if g:pydocstring_enable_mapping == 1 || hasmapto('<Plug>(pydocstring)')
25-
nnoremap <silent> <buffer> <Plug>(pydocstring) :call pydocstring#insert()<CR>
26-
if !hasmapto('<Plug>(pydocstring)')
27-
nmap <silent> <C-l> <Plug>(pydocstring)
20+
nnoremap <silent> <buffer> <Plug>(pydocstring) :call pydocstring#insert()<CR>
21+
if get(g:, 'pydocstring_enable_mapping', 1)
22+
if !hasmapto('<Plug>(pydocstring)', 'n')
23+
nmap <silent> <buffer> <C-l> <Plug>(pydocstring)
2824
endif
2925
endif
3026

0 commit comments

Comments
 (0)