Ver código fonte

Add setting to enable/disable document highlighting (#428)

tafryn 4 anos atrás
pai
commit
6f8f265e86
2 arquivos alterados com 5 adições e 2 exclusões
  1. 4 2
      lua/lsp/init.lua
  2. 1 0
      lv-settings.lua

+ 4 - 2
lua/lsp/init.lua

@@ -100,8 +100,10 @@ local function documentHighlight(client, bufnr)
 end
 end
 local lsp_config = {}
 local lsp_config = {}
 
 
-function lsp_config.common_on_attach(client, bufnr)
-    documentHighlight(client, bufnr)
+if O.document_highlight then
+    function lsp_config.common_on_attach(client, bufnr)
+        documentHighlight(client, bufnr)
+    end
 end
 end
 
 
 function lsp_config.tsserver_on_attach(client, bufnr)
 function lsp_config.tsserver_on_attach(client, bufnr)

+ 1 - 0
lv-settings.lua

@@ -13,6 +13,7 @@ O.colorscheme = 'lunar'
 O.auto_close_tree = 0
 O.auto_close_tree = 0
 O.wrap_lines = false
 O.wrap_lines = false
 O.timeoutlen = 100
 O.timeoutlen = 100
+O.document_highlight = true
 
 
 -- dashboard
 -- dashboard
 -- O.dashboard.custom_header = {""}
 -- O.dashboard.custom_header = {""}