Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lua/orgmode/colors/highlighter/stars.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function OrgStars:on_line(bufnr, line)
local node = vim.treesitter.get_node({
bufnr = bufnr,
pos = { line, 0 },
lang = 'org',
})

if not node or node:type() ~= 'stars' then
Expand Down
2 changes: 1 addition & 1 deletion lua/orgmode/ui/virtual_indent.lua
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function VirtualIndent:set_indent(start_line, end_line, ignore_ts)
start_line = start_line - 1
end

local node_at_cursor = vim.treesitter.get_node()
local node_at_cursor = vim.treesitter.get_node({ lang = 'org' })
local tree_has_errors = false
if node_at_cursor then
tree_has_errors = node_at_cursor:tree():root():has_error()
Expand Down
5 changes: 3 additions & 2 deletions lua/orgmode/utils/treesitter/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ local query_cache = {}
function M.restart_highlights(bufnr)
bufnr = bufnr or 0
vim.treesitter.stop(bufnr)
vim.treesitter.start(bufnr)
vim.treesitter.start(bufnr, 'org')
end

function M.parse_current_file()
Expand All @@ -18,12 +18,13 @@ end
function M.get_node_at_cursor(cursor)
M.parse_current_file()
if not cursor then
return vim.treesitter.get_node()
return vim.treesitter.get_node({ lang = 'org' })
end

return vim.treesitter.get_node({
bufnr = 0,
pos = { cursor[1] - 1, cursor[2] },
lang = 'org',
})
end

Expand Down