Skip to content

Commit

Permalink
feat(latex): Added \vec{} support
Browse files Browse the repository at this point in the history
  • Loading branch information
OXY2DEV committed Mar 9, 2025
1 parent b8ad5fc commit 6c92a64
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions lua/markview/spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1932,6 +1932,51 @@ spec.default = {
}
},

["vec"] = {
condition = function (item)
return #item.args == 1;
end,
on_command = {
conceal = ""
},

on_args = {
{
on_before = function (item)
return {
end_col = item.range[2] + 1,
conceal = "",

virt_text_pos = "inline",
virt_text = {
{ "󱈥 ", "MarkviewPalette2Fg" },
{ "(", "@punctuation.bracket.latex" }
},

hl_mode = "combine"
}
end,

after_offset = function (range)
return { range[1], range[2], range[3], range[4] - 1 };
end,
on_after = function (item)
return {
end_col = item.range[4],
conceal = "",

virt_text_pos = "inline",
virt_text = {
{ ")", "@punctuation.bracket" }
},

hl_mode = "combine"
}
end
}
}
},

["sin"] = operator("sin"),
["cos"] = operator("cos"),
["tan"] = operator("tan"),
Expand Down

0 comments on commit 6c92a64

Please sign in to comment.