Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export function #561

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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