Skip to content

Commit

Permalink
export function
Browse files Browse the repository at this point in the history
  • Loading branch information
Konfekt authored Sep 24, 2024
1 parent 04b5b04 commit 46df7a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugin/lsp.vim
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ command! -nargs=0 -bar LspDocumentSymbol lsp.ShowDocSymbols()
command! -nargs=0 -bar LspFold lsp.FoldDocument()

command! -nargs=0 -bar -range=% LspFormat lsp.TextDocFormat(<range>, <line1>, <line2>)
def LspFormatFunc(type: string, visual_mode = v:false)
export def LspFormatFunc(type: string, visual_mode = v:false)
if visual_mode
exe "normal! gv:LspFormat\<cr>"
elseif type ==# 'line'
Expand All @@ -86,6 +86,7 @@ def LspFormatFunc(type: string, visual_mode = v:false)
endif
enddef
nnoremap <silent> <plug>(LspFormat) <Cmd>set operatorfunc=LspFormatFunc<cr>g@
xnoremap <silent> <plug>(LspFormat) <Cmd>LspFormat<cr>
command! -nargs=0 -bar -count LspGotoDeclaration lsp.GotoDeclaration(v:false, <q-mods>, <count>)
command! -nargs=0 -bar -count LspGotoDefinition lsp.GotoDefinition(v:false, <q-mods>, <count>)
Expand Down

0 comments on commit 46df7a6

Please sign in to comment.