From e449c9d4dc7ac68b098a4afb9c33f552cad6a6e1 Mon Sep 17 00:00:00 2001 From: newtonne <14221622+newtonne@users.noreply.github.com> Date: Sun, 14 May 2023 17:02:41 +0100 Subject: [PATCH] Default keepFocusInDiags to false --- autoload/lsp/options.vim | 2 +- doc/lsp.txt | 2 +- test/clangd_tests.vim | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/autoload/lsp/options.vim b/autoload/lsp/options.vim index 2253dfd..e8438c5 100644 --- a/autoload/lsp/options.vim +++ b/autoload/lsp/options.vim @@ -32,7 +32,7 @@ export var lspOptions: dict = { # 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 8e819bd..7c7332c 100644 --- a/doc/lsp.txt +++ b/doc/lsp.txt @@ -441,7 +441,7 @@ ignoreMissingServer |Boolean| option. Do not print a missing language *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 5b73987..1ab0c7e 100644 --- a/test/clangd_tests.vim +++ b/test/clangd_tests.vim @@ -270,7 +270,7 @@ def g:Test_LspDiag() 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 @@ def g:Test_LspDiag() 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 @@ def g:Test_LspDiag_Multi() 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) -- 2.48.1