Skip to content

Commit

Permalink
refactor(directive): Fixed issues with empty lines when modifying nod…
Browse files Browse the repository at this point in the history
…e range

This no longer causes errors on empty lines
  • Loading branch information
OXY2DEV committed Mar 2, 2025
1 parent 386a98e commit b990eaa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugin/markview.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ if vim.list_contains(available_directives, "conceal-patch!") == false then
end

line = line:sub(c_s + 1, #line);

if not line:match("^(%s*)%S") then
--- Line is probably empty.
return;
end

local spaces = line:match("^(%s*)%S"):len();

metadata[id].range[1] = r_s;
Expand Down

0 comments on commit b990eaa

Please sign in to comment.