Skip to content

Commit

Permalink
fix(virtual indent): offset on_lines start & end by +1
Browse files Browse the repository at this point in the history
This ensures the headlines grab the correct range, prior to this on
nightly (0.10.0) it would appear that the range of lines grabbed caused
the lookup to include the previous headline in the treesitter lookup.

By offsetting forward by 1, treesitter correctly grabs the nearest (new)
headline and sets the virtual indentation accordingly.
  • Loading branch information
PriceHiller committed Apr 10, 2024
1 parent 4e4d93a commit 7e04de0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/orgmode/ui/virtual_indent.lua
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ function VirtualIndent:attach()
end

vim.schedule(function()
self:set_indent(start_line, end_line)
self:set_indent(start_line + 1, end_line + 1)
end)
end,
on_reload = function()
Expand Down

0 comments on commit 7e04de0

Please sign in to comment.