Skip to content

Commit

Permalink
fix: correctly handle updating/removing non-zero start lines
Browse files Browse the repository at this point in the history
Unfortuantely the default treesitter start() gives us the slightly wrong
lines for purposes of virtual indent. We need to grab one line less if
the start line gathered is non zero
  • Loading branch information
PriceHiller committed Nov 15, 2023
1 parent 55b750e commit 02e71af
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lua/orgmode/ui/virtual_indent.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ function VirtualIndent:set_indent(bufnr, start_line, end_line, ignore_ts)
end
end
end
self:_delete_old_extmarks(bufnr, start_line - 1, end_line)
if start_line > 0 then
start_line = start_line - 1
end
self:_delete_old_extmarks(bufnr, start_line, end_line)
for line = start_line, end_line do
local indent = self:_get_indent_size(line)

Expand Down

0 comments on commit 02e71af

Please sign in to comment.