Skip to content

Commit

Permalink
Fix markup conflict highlight. Closes #279
Browse files Browse the repository at this point in the history
  • Loading branch information
kristijanhusak committed May 4, 2022
1 parent 3615a42 commit b9de38e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lua/orgmode/colors/markup_highlighter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,14 @@ local function apply_markup_to_line(namespace, bufnr, line_index, line)
if seek[char] then
local next_char = chars[i + 1]
if next_char == nil or vim.tbl_contains(valid_post_marker_chars, next_char) then
table.insert(ranges, { type = char, from = seek[char], to = i + offset })
local to = i + offset
table.insert(ranges, { type = char, from = seek[char], to = to })
-- Cleanup all unclosed markers in between
for c, pos in pairs(seek) do
if c ~= char and pos < to and pos > seek[char] then
seek[c] = nil
end
end
seek[char] = nil
end
else
Expand Down

0 comments on commit b9de38e

Please sign in to comment.