diff --git a/lua/orgmode/colors/markup_highlighter.lua b/lua/orgmode/colors/markup_highlighter.lua index 795dc32fa..e8f000975 100644 --- a/lua/orgmode/colors/markup_highlighter.lua +++ b/lua/orgmode/colors/markup_highlighter.lua @@ -10,30 +10,35 @@ local markers = { ['*'] = { hl_name = 'org_bold', hl_cmd = 'hi def %s term=bold cterm=bold gui=bold', + delimiter_hl = true, nestable = true, type = 'text', }, ['/'] = { hl_name = 'org_italic', hl_cmd = 'hi def %s term=italic cterm=italic gui=italic', + delimiter_hl = true, nestable = true, type = 'text', }, ['_'] = { hl_name = 'org_underline', hl_cmd = 'hi def %s term=underline cterm=underline gui=underline', + delimiter_hl = true, nestable = true, type = 'text', }, ['+'] = { hl_name = 'org_strikethrough', hl_cmd = 'hi def %s term=strikethrough cterm=strikethrough gui=strikethrough', + delimiter_hl = true, nestable = true, type = 'text', }, ['~'] = { hl_name = 'org_code', hl_cmd = 'hi def link %s String', + delimiter_hl = true, nestable = false, spell = false, type = 'text', @@ -41,6 +46,7 @@ local markers = { ['='] = { hl_name = 'org_verbatim', hl_cmd = 'hi def link %s String', + delimiter_hl = true, nestable = false, spell = false, type = 'text', @@ -50,18 +56,21 @@ local markers = { hl_cmd = 'hi def link %s OrgTSLatex', nestable = false, spell = false, + delimiter_hl = false, type = 'latex', }, ['\\{'] = { hl_name = 'org_latex', hl_cmd = 'hi def link %s OrgTSLatex', nestable = false, + delimiter_hl = false, type = 'latex', }, ['\\s'] = { hl_name = 'org_latex', hl_cmd = 'hi def link %s OrgTSLatex', nestable = false, + delimiter_hl = false, type = 'latex', }, } @@ -444,7 +453,9 @@ end local function setup() for _, marker in pairs(markers) do vim.cmd(string.format(marker.hl_cmd, marker.hl_name)) - vim.cmd(string.format(marker.hl_cmd, marker.hl_name .. '_delimiter')) + if marker.delimiter_hl then + vim.cmd(string.format(marker.hl_cmd, marker.hl_name .. '_delimiter')) + end end vim.cmd('hi def link org_hyperlink Underlined') load_deps()