test/clangd_tests.vim | 25 +++++++++++++++++++++++++ diff --git a/test/clangd_tests.vim b/test/clangd_tests.vim index 31a41178a97faefb814d728575f73fceb4e719b2..424ec7afc3ca3f6875f7566498880e8b11063d96 100644 --- a/test/clangd_tests.vim +++ b/test/clangd_tests.vim @@ -292,6 +292,13 @@ assert_equal([7, 2], [line('.'), col('.')]) output = execute(':2LspDiagNext')->split("\n") assert_equal('Error: No more diagnostics found', output[0]) + # :[count]LspDiagPrev + cursor(7, 2) + :4LspDiagPrev + assert_equal([3, 14], [line('.'), col('.')]) + output = execute(':4LspDiagPrev')->split("\n") + assert_equal('Error: No more diagnostics found', output[0]) + :%d setline(1, ['void blueFunc()', '{', '}']) g:WaitForDiags(0) @@ -458,6 +465,24 @@ cursor(1, 1) :99LspDiagNext assert_equal([2, 9], [line('.'), col('.')]) + g:LspOptionsSet({showDiagInPopup: true}) + + # :[count]LspDiagPrev + g:LspOptionsSet({showDiagInPopup: false}) + cursor(1, 1) + :2LspDiagPrev + assert_equal('Error: No more diagnostics found', output[0]) + cursor(3, 3) + :2LspDiagPrev + assert_equal([1, 9], [line('.'), col('.')]) + :2LspDiagPrev + assert_equal([1, 5], [line('.'), col('.')]) + output = execute(':2LspDiagPrev')->split("\n") + assert_equal('Error: No more diagnostics found', output[0]) + + cursor(3, 3) + :99LspDiagPrev + assert_equal([1, 5], [line('.'), col('.')]) g:LspOptionsSet({showDiagInPopup: true}) bw!