]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Add ":LspDiagLast" which shows the last diagnostic
authorAndreas Louv <andreas@louv.dk>
Mon, 3 Apr 2023 00:04:03 +0000 (02:04 +0200)
committerAndreas Louv <andreas@louv.dk>
Mon, 3 Apr 2023 01:04:08 +0000 (03:04 +0200)
autoload/lsp/diag.vim
plugin/lsp.vim

index 8e277231dec896c2f7650b71567d0950e1ee23c6..c7dd31a23d800a632ea9a30f78fab58cd948b8b5 100644 (file)
@@ -487,6 +487,11 @@ export def LspDiagsJump(lspserver: dict<any>, 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('.')
index 12271dd470fca5374f41956004fa6c20091a8688..7731f6d4ee8441ac894962fb06f8027605e583b6 100644 (file)
@@ -82,6 +82,7 @@ command! -nargs=0 -bar -bang LspDiagCurrent lsp.LspShowCurrentDiag(<bang>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', <count>)
 command! -nargs=0 -bar -count=1 LspDiagPrev lsp.JumpToDiag('prev', <count>)
 command! -nargs=0 -bar LspDiagShow lsp.ShowDiagnostics()
@@ -149,6 +150,7 @@ if has('gui_running')
   anoremenu <silent> L&sp.Diagnostics.Current :LspDiagCurrent<CR>
   anoremenu <silent> L&sp.Diagnostics.Show\ All :LspDiagShow<CR>
   anoremenu <silent> L&sp.Diagnostics.First :LspDiagFirst<CR>
+  anoremenu <silent> L&sp.Diagnostics.Last :LspDiagLast<CR>
   anoremenu <silent> L&sp.Diagnostics.Next :LspDiagNext<CR>
   anoremenu <silent> L&sp.Diagnostics.Prev :LspDiagPrev<CR>
   anoremenu <silent> L&sp.Diagnostics.This :LspDiagHere<CR>