]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Default keepFocusInDiags to false
authornewtonne <14221622+newtonne@users.noreply.github.com>
Sun, 14 May 2023 16:02:41 +0000 (17:02 +0100)
committernewtonne <14221622+newtonne@users.noreply.github.com>
Sun, 14 May 2023 16:02:41 +0000 (17:02 +0100)
autoload/lsp/options.vim
doc/lsp.txt
test/clangd_tests.vim

index 2253dfdc668d59edfe57f052bfd7d7ef71ed115f..e8438c55953e765857b9345d431e570d5781f394 100644 (file)
@@ -32,7 +32,7 @@ export var lspOptions: dict<any> = {
   # 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.
index 8e819bdadd216ee3d7b6c0b55a7d4072dd64db18..7c7332cbf5a681435a9be000e23164c6180a9a3e 100644 (file)
@@ -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.
index 5b7398788f0ce3bba66bd78eabc04dd1d51d90fc..1ab0c7ebdbcf11e72fb38060bd9cd83d1859b03b 100644 (file)
@@ -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)