fixing issues on hlchunk, lspconfig, lualine and ufo plugins
This commit is contained in:
@@ -33,13 +33,7 @@ return {
|
|||||||
delay = 300,
|
delay = 300,
|
||||||
},
|
},
|
||||||
indent = {
|
indent = {
|
||||||
enable = true,
|
enable = false, -- Disabled: indent-blankline already handles indent guides
|
||||||
priority = 10,
|
|
||||||
style = { { fg = vim.fn.synIDattr(vim.fn.synIDtrans(vim.fn.hlID("Whitespace")), "fg", "gui") } },
|
|
||||||
use_treesitter = false,
|
|
||||||
chars = { "│" },
|
|
||||||
ahead_lines = 5,
|
|
||||||
delay = 100,
|
|
||||||
},
|
},
|
||||||
line_num = {
|
line_num = {
|
||||||
enable = true,
|
enable = true,
|
||||||
|
|||||||
@@ -190,31 +190,25 @@ return {
|
|||||||
settings = {
|
settings = {
|
||||||
typescript = {
|
typescript = {
|
||||||
inlayHints = {
|
inlayHints = {
|
||||||
parameterNames = { enabled = "all" },
|
parameterNames = { enabled = "literals" },
|
||||||
parameterTypes = { enabled = true },
|
parameterTypes = { enabled = false },
|
||||||
variableTypes = { enabled = true },
|
variableTypes = { enabled = false },
|
||||||
propertyDeclarationTypes = { enabled = true },
|
propertyDeclarationTypes = { enabled = false },
|
||||||
functionLikeReturnTypes = { enabled = true },
|
functionLikeReturnTypes = { enabled = false },
|
||||||
enumMemberValues = { enabled = true },
|
enumMemberValues = { enabled = true },
|
||||||
},
|
},
|
||||||
suggest = {
|
suggest = {
|
||||||
completeFunctionCalls = true,
|
completeFunctionCalls = true,
|
||||||
},
|
},
|
||||||
updateImportsOnFileMove = { enabled = "always" },
|
updateImportsOnFileMove = { enabled = "always" },
|
||||||
-- Use project's TypeScript for proper bundler resolution support
|
|
||||||
tsserver = {
|
|
||||||
experimental = {
|
|
||||||
enableProjectDiagnostics = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
javascript = {
|
javascript = {
|
||||||
inlayHints = {
|
inlayHints = {
|
||||||
parameterNames = { enabled = "all" },
|
parameterNames = { enabled = "literals" },
|
||||||
parameterTypes = { enabled = true },
|
parameterTypes = { enabled = false },
|
||||||
variableTypes = { enabled = true },
|
variableTypes = { enabled = false },
|
||||||
propertyDeclarationTypes = { enabled = true },
|
propertyDeclarationTypes = { enabled = false },
|
||||||
functionLikeReturnTypes = { enabled = true },
|
functionLikeReturnTypes = { enabled = false },
|
||||||
enumMemberValues = { enabled = true },
|
enumMemberValues = { enabled = true },
|
||||||
},
|
},
|
||||||
suggest = {
|
suggest = {
|
||||||
|
|||||||
@@ -81,16 +81,39 @@ return {
|
|||||||
return " " .. table.concat(names, ", ")
|
return " " .. table.concat(names, ", ")
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Word counter (excluding symbols)
|
-- Word counter (excluding symbols) - cached to avoid recomputing on every statusline refresh
|
||||||
local function word_count()
|
local cached_word_count = 0
|
||||||
local lines = vim.api.nvim_buf_get_lines(0, 0, -1, false)
|
local word_count_timer = nil
|
||||||
|
local function update_word_count()
|
||||||
|
local buf = vim.api.nvim_get_current_buf()
|
||||||
|
local line_count = vim.api.nvim_buf_line_count(buf)
|
||||||
|
if line_count > 5000 then
|
||||||
|
cached_word_count = -1
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local lines = vim.api.nvim_buf_get_lines(buf, 0, -1, false)
|
||||||
local text = table.concat(lines, " ")
|
local text = table.concat(lines, " ")
|
||||||
local clean_text = text:gsub("[^%w%s]", "")
|
local clean_text = text:gsub("[^%w%s]", "")
|
||||||
local count = 0
|
local count = 0
|
||||||
for _ in clean_text:gmatch("%w+") do
|
for _ in clean_text:gmatch("%w+") do
|
||||||
count = count + 1
|
count = count + 1
|
||||||
end
|
end
|
||||||
return "words: " .. count
|
cached_word_count = count
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Debounce: only recount on TextChanged/BufEnter, not every statusline refresh
|
||||||
|
vim.api.nvim_create_autocmd({ "TextChanged", "TextChangedI", "BufEnter" }, {
|
||||||
|
callback = function()
|
||||||
|
if word_count_timer then
|
||||||
|
word_count_timer:stop()
|
||||||
|
end
|
||||||
|
word_count_timer = vim.defer_fn(update_word_count, 500)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
local function word_count()
|
||||||
|
if cached_word_count < 0 then return "" end
|
||||||
|
return "words: " .. cached_word_count
|
||||||
end
|
end
|
||||||
|
|
||||||
lualine.setup({
|
lualine.setup({
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ return {
|
|||||||
open_fold_hl_timeout = 150,
|
open_fold_hl_timeout = 150,
|
||||||
close_fold_kinds_for_ft = {
|
close_fold_kinds_for_ft = {
|
||||||
default = { 'imports', 'comment' },
|
default = { 'imports', 'comment' },
|
||||||
json = { 'array' },
|
|
||||||
c = { 'comment', 'region' },
|
c = { 'comment', 'region' },
|
||||||
},
|
},
|
||||||
preview = {
|
preview = {
|
||||||
|
|||||||
Reference in New Issue
Block a user