From: Andreas Louv Date: Mon, 3 Apr 2023 00:04:03 +0000 (+0200) Subject: Add ":LspDiagLast" which shows the last diagnostic X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=4321a9830d470f1dfaf5efbe5fd6d469d1d81d0b;p=vim-lsp.git Add ":LspDiagLast" which shows the last diagnostic --- diff --git a/autoload/lsp/diag.vim b/autoload/lsp/diag.vim index 8e27723..c7dd31a 100644 --- a/autoload/lsp/diag.vim +++ b/autoload/lsp/diag.vim @@ -487,6 +487,11 @@ export def LspDiagsJump(lspserver: dict, which: string, a_count: number = 0 return endif + if which == 'last' + JumpDiag(diags[-1]) + return + endif + # Find the entry just before the current line (binary search) var count = a_count > 1 ? a_count : 1 var curlnum: number = line('.') diff --git a/plugin/lsp.vim b/plugin/lsp.vim index 12271dd..7731f6d 100644 --- a/plugin/lsp.vim +++ b/plugin/lsp.vim @@ -82,6 +82,7 @@ command! -nargs=0 -bar -bang LspDiagCurrent lsp.LspShowCurrentDiag(false) command! -nargs=0 -bar LspDiagFirst lsp.JumpToDiag('first') command! -nargs=0 -bar LspDiagHighlightDisable lsp.DiagHighlightDisable() command! -nargs=0 -bar LspDiagHighlightEnable lsp.DiagHighlightEnable() +command! -nargs=0 -bar LspDiagLast lsp.JumpToDiag('last') command! -nargs=0 -bar -count=1 LspDiagNext lsp.JumpToDiag('next', ) command! -nargs=0 -bar -count=1 LspDiagPrev lsp.JumpToDiag('prev', ) command! -nargs=0 -bar LspDiagShow lsp.ShowDiagnostics() @@ -149,6 +150,7 @@ if has('gui_running') anoremenu L&sp.Diagnostics.Current :LspDiagCurrent anoremenu L&sp.Diagnostics.Show\ All :LspDiagShow anoremenu L&sp.Diagnostics.First :LspDiagFirst + anoremenu L&sp.Diagnostics.Last :LspDiagLast anoremenu L&sp.Diagnostics.Next :LspDiagNext anoremenu L&sp.Diagnostics.Prev :LspDiagPrev anoremenu L&sp.Diagnostics.This :LspDiagHere