:LspDiag highlight disable|Disable diagnostic message highlights.
:LspDiag highlight enable|Enable diagnostic message highlights.
:LspDiag next|Jump to the next diagnostic message after the current position.
+:LspDiag nextWrap|Jump to the next diagnostic message after the current position, wrapping to the first message when the last message is reached.
:LspDiag prev|Jump to the previous diagnostic message before the current position.
+:LspDiag prevWrap|Jump to the previous diagnostic message before the current position, wrapping to the last message when the first message is reached.
:LspDiag show|Display the diagnostics messages from the language server for the current buffer in a new location list.
:LspDocumentSymbol|Display the symbols in the current file in a popup menu and jump to the selected symbol.
:LspFold|Fold the current file.
var count = a_count > 1 ? a_count : 1
var curlnum: number = line('.')
var curcol: number = charcol('.')
- for diag in (which == 'next' || which == 'here') ?
+ for diag in (which == 'next' || which == 'nextWrap' || which == 'here') ?
diags : diags->copy()->reverse()
var d_start = diag.range.start
var lnum = d_start.line + 1
var col = util.GetCharIdxWithoutCompChar(bnr, d_start) + 1
- if (which == 'next' && (lnum > curlnum || lnum == curlnum && col > curcol))
- || (which == 'prev' && (lnum < curlnum || lnum == curlnum
+ if ((which == 'next' || which == 'nextWrap') && (lnum > curlnum || lnum == curlnum && col > curcol))
+ || ((which == 'prev' || which == 'prevWrap') && (lnum < curlnum || lnum == curlnum
&& col < curcol))
|| (which == 'here' && (lnum == curlnum && col >= curcol))
endfor
# If [count] exceeded the remaining diags
- if which == 'next' && a_count > 1 && a_count != count
+ if ((which == 'next' || which == 'nextWrap') && a_count > 1 && a_count != count)
JumpDiag(diags[-1])
return
endif
# If [count] exceeded the previous diags
- if which == 'prev' && a_count > 1 && a_count != count
+ if ((which == 'prev' || which == 'prevWrap') && a_count > 1 && a_count != count)
JumpDiag(diags[0])
return
endif
+ if which == 'nextWrap' || which == 'prevWrap'
+ JumpDiag(diags[which == 'nextWrap' ? 0 : -1])
+ return
+ endif
+
if which == 'here'
util.WarnMsg('No more diagnostics found on this line')
else
export def LspDiagComplete(arglead: string, cmdline: string, cursorPos: number): list<string>
var wordBegin = -1
var wordEnd = -1
- var l = ['first', 'current', 'here', 'highlight', 'last', 'next', 'prev',
- 'show']
+ var l = ['first', 'current', 'here', 'highlight', 'last', 'next', 'nextWrap',
+ 'prev', 'prevWrap', 'show']
# Skip the command name
var i = cmdline->stridx(' ', 0)
diag.LspDiagsJump('last', 0)
elseif args == 'next'
diag.LspDiagsJump('next', cmdCount)
+ elseif args == 'nextWrap'
+ diag.LspDiagsJump('nextWrap', cmdCount)
elseif args == 'prev'
diag.LspDiagsJump('prev', cmdCount)
+ elseif args == 'prevWrap'
+ diag.LspDiagsJump('prevWrap', cmdCount)
elseif args == 'show'
ShowDiagnostics()
else
buffer.
:LspDiag next Jump to the next diagnostic message for the current
buffer after the current cursor position.
+:LspDiag nextWrap Jump to the next diagnostic message for the current
+ buffer after the current cursor position.
+ Wrap back to the first message when no more messages
+ are found.
:LspDiag prev Jump to the previous diagnostic message for the
current buffer before the current current position.
+:LspDiag prevWrap Jump to the previous diagnostic message for the
+ current buffer before the current current position.
+ Wrap back to the last message when no previous
+ messages are found.
:LspDiag show Display the diagnostics messages from the language
server for the current buffer in a location list.
:LspDocumentSymbol Display the symbols in the current file in a popup
command! -nargs=0 -bar LspDiagFirst lsp.JumpToDiag('first')
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 LspDiagNextWrap lsp.JumpToDiag('nextWrap', <count>)
command! -nargs=0 -bar -count=1 LspDiagPrev lsp.JumpToDiag('prev', <count>)
+command! -nargs=0 -bar -count=1 LspDiagPrevWrap lsp.JumpToDiag('prevWrap', <count>)
command! -nargs=0 -bar LspDiagShow lsp.ShowDiagnostics()
command! -nargs=0 -bar LspDiagHere lsp.JumpToDiag('here')
command! -nargs=0 -bar LspDocumentSymbol lsp.ShowDocSymbols()