This commit is contained in:
Zelong Kuang
2025-10-05 21:01:41 +11:00
parent 485683a069
commit 4da3e1927f
8 changed files with 35 additions and 41 deletions

View File

@@ -47,7 +47,7 @@ end
-- For typst
M.in_mathzone_typ = function()
local row, col = unpack(vim.api.nvim_win_get_cursor(0))
local node = vim.treesitter.get_node({ bufnr = 0, pos = { row - 1, col } })
local node = vim.treesitter.get_node({ bufnr = 0, pos = { row - 1, col - 1} })
while node do
if node:type() == "math" then
return true
@@ -59,7 +59,7 @@ end
M.in_mathzone_tex = function()
local row, col = unpack(vim.api.nvim_win_get_cursor(0))
local node = vim.treesitter.get_node({ bufnr = 0, pos = { row - 1, col - 1 } })
local node = vim.treesitter.get_node({ bufnr = 0, pos = { row - 1, col - 1} })
while node do
if MATH_NODES[node:type()] then
return true