autoload/lsp/options.vim | 2 +- doc/lsp.txt | 2 +- test/clangd_tests.vim | 12 ++++++------ diff --git a/autoload/lsp/options.vim b/autoload/lsp/options.vim index 2253dfdc668d59edfe57f052bfd7d7ef71ed115f..e8438c55953e765857b9345d431e570d5781f394 100644 --- a/autoload/lsp/options.vim +++ b/autoload/lsp/options.vim @@ -32,7 +32,7 @@ hoverInPreview: false, # Don't print message when a configured language server is missing. ignoreMissingServer: false, # Focus on the location list window after LspDiagShow - keepFocusInDiags: true, + keepFocusInDiags: false, # Focus on the location list window after LspShowReferences keepFocusInReferences: false, # If true, apply the LSP server supplied text edits after a completion. diff --git a/doc/lsp.txt b/doc/lsp.txt index 8e819bdadd216ee3d7b6c0b55a7d4072dd64db18..7c7332cbf5a681435a9be000e23164c6180a9a3e 100644 --- a/doc/lsp.txt +++ b/doc/lsp.txt @@ -441,7 +441,7 @@ server executable. By default this is set to false. *lsp-opt-keepFocusInDiags* keepFocusInDiags |Boolean| option. Focus on the location list window after LspDiagShow. - By default this is set to true. + By default this is set to false. *lsp-opt-keepFocusInReferences* keepFocusInReferences |Boolean| option. Focus on the location list window after LspShowReferences. diff --git a/test/clangd_tests.vim b/test/clangd_tests.vim index 5b7398788f0ce3bba66bd78eabc04dd1d51d90fc..1ab0c7ebdbcf11e72fb38060bd9cd83d1859b03b 100644 --- a/test/clangd_tests.vim +++ b/test/clangd_tests.vim @@ -270,7 +270,7 @@ assert_equal(3, qfl->len()) assert_equal([3, 14, 'E'], [qfl[0].lnum, qfl[0].col, qfl[0].type]) assert_equal([5, 2, 'W'], [qfl[1].lnum, qfl[1].col, qfl[1].type]) assert_equal([7, 2, 'W'], [qfl[2].lnum, qfl[2].col, qfl[2].type]) - close + :lclose g:LspOptionsSet({showDiagInPopup: false}) normal gg var output = execute('LspDiagCurrent')->split("\n") @@ -294,12 +294,12 @@ :LspDiagPrev output = execute('LspDiagPrev')->split("\n") assert_equal('Warn: No more diagnostics found', output[0]) - # Test for maintaining buffer focus - g:LspOptionsSet({ keepFocusInDiags: false }) + # Test for moving buffer focus to loclist + g:LspOptionsSet({ keepFocusInDiags: true }) :LspDiagShow - assert_equal('', getwinvar(0, '&buftype')) + assert_equal('quickfix', getwinvar(0, '&buftype')) :lclose - g:LspOptionsSet({ keepFocusInDiags: true }) + g:LspOptionsSet({ keepFocusInDiags: false }) # :[count]LspDiagNext cursor(3, 1) @@ -394,7 +394,7 @@ assert_equal([1, 5, 'W'], [qfl[0].lnum, qfl[0].col, qfl[0].type]) endif assert_equal([1, 9, 'E'], [qfl[1].lnum, qfl[1].col, qfl[1].type]) assert_equal([2, 9, 'E'], [qfl[2].lnum, qfl[2].col, qfl[2].type]) - close + :lclose :sleep 100m cursor(2, 1)