aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2025-05-01 19:11:30 +0200
committerChristian Clason <c.clason@uni-graz.at>2025-05-12 18:43:40 +0200
commit11736494df8a43d99332fdd60eb24a107b01f989 (patch)
treed99f23f83e0593ff63c5d05b7c0dc9ab2686db6a
parentchore: remove lockfile and update script (diff)
downloadnvim-treesitter-11736494df8a43d99332fdd60eb24a107b01f989.tar
nvim-treesitter-11736494df8a43d99332fdd60eb24a107b01f989.tar.gz
nvim-treesitter-11736494df8a43d99332fdd60eb24a107b01f989.tar.bz2
nvim-treesitter-11736494df8a43d99332fdd60eb24a107b01f989.tar.lz
nvim-treesitter-11736494df8a43d99332fdd60eb24a107b01f989.tar.xz
nvim-treesitter-11736494df8a43d99332fdd60eb24a107b01f989.tar.zst
nvim-treesitter-11736494df8a43d99332fdd60eb24a107b01f989.zip
fix(indent): don't skip parsing for yaml
-rw-r--r--lua/nvim-treesitter/indent.lua14
1 files changed, 2 insertions, 12 deletions
diff --git a/lua/nvim-treesitter/indent.lua b/lua/nvim-treesitter/indent.lua
index 00f85dea2..5d9e86f66 100644
--- a/lua/nvim-treesitter/indent.lua
+++ b/lua/nvim-treesitter/indent.lua
@@ -2,10 +2,6 @@ local ts = vim.treesitter
local M = {}
-M.avoid_force_reparsing = {
- yaml = true,
-}
-
M.comment_parsers = {
comment = true,
jsdoc = true,
@@ -125,14 +121,8 @@ function M.get_indent(lnum)
return -1
end
- local ft = vim.bo[bufnr].filetype
- local root_lang = vim.treesitter.language.get_lang(ft) or ft
-
- -- some languages like Python will actually have worse results when re-parsing at opened new line
- if not M.avoid_force_reparsing[root_lang] then
- -- Reparse in case we got triggered by ":h indentkeys"
- parser:parse({ vim.fn.line('w0') - 1, vim.fn.line('w$') })
- end
+ -- Reparse in case we got triggered by ":h indentkeys"
+ parser:parse({ vim.fn.line('w0') - 1, vim.fn.line('w$') })
-- Get language tree with smallest range around node that's not a comment parser
local root, lang_tree ---@type TSNode, vim.treesitter.LanguageTree