فهرست منبع

fix(autocmds): disable commentstring_calc on cursor-hold (#2581)

kylo252 3 سال پیش
والد
کامیت
a2714c3c38
2فایلهای تغییر یافته به همراه4 افزوده شده و 5 حذف شده
  1. 3 4
      lua/lvim/core/treesitter.lua
  2. 1 1
      lua/lvim/lsp/utils.lua

+ 3 - 4
lua/lvim/core/treesitter.lua

@@ -12,11 +12,12 @@ M.config = function()
     },
     highlight = {
       enable = true, -- false will disable the whole extension
-      additional_vim_regex_highlighting = true,
+      additional_vim_regex_highlighting = false,
       disable = { "latex" },
     },
     context_commentstring = {
       enable = true,
+      enable_autocmd = false,
       config = {
         -- Languages that have a single comment style
         typescript = "// %s",
@@ -28,9 +29,7 @@ M.config = function()
         json = "",
       },
     },
-    -- indent = {enable = true, disable = {"python", "html", "javascript"}},
-    -- TODO seems to be broken
-    indent = { enable = true, disable = { "yaml" } },
+    indent = { enable = true, disable = { "yaml", "python" } },
     autotag = { enable = false },
     textobjects = {
       swap = {

+ 1 - 1
lua/lvim/lsp/utils.lua

@@ -153,7 +153,7 @@ function M.format(opts)
   opts = opts or { filter = M.format_filter }
 
   if vim.lsp.buf.format then
-    vim.lsp.buf.format(opts)
+    return vim.lsp.buf.format(opts)
   end
 
   local bufnr = opts.bufnr or vim.api.nvim_get_current_buf()