diff --git a/ftplugin/markdown.lua b/ftplugin/markdown.lua index 2f243f8..a1de838 100644 --- a/ftplugin/markdown.lua +++ b/ftplugin/markdown.lua @@ -25,8 +25,10 @@ if vim.islist(markview.configuration.buf_ignore) and vim.list_contains(markview. return end -if vim.islist(markview.configuration.highlight_groups) then +-- Don't add hls unless absolutely necessary +if not markview.added_hls and vim.islist(markview.configuration.highlight_groups) then markview.add_hls(markview.configuration.highlight_groups) + markview.added_hls = true; end local markview_augroup = vim.api.nvim_create_augroup("markview_buf_" .. vim.api.nvim_get_current_buf(), { clear = true }); @@ -73,13 +75,6 @@ vim.api.nvim_create_autocmd({ "BufWinEnter" }, { markview.state.buf_states[buffer] = true; - if vim.tbl_isempty(markview.global_options) then - markview.global_options = { - conceallevel = vim.o.conceallevel, - concealcursor = vim.o.concealcursor - } - end - local parsed_content = markview.parser.init(buffer, markview.configuration); markview.renderer.clear(buffer); diff --git a/lua/markview.lua b/lua/markview.lua index 214eeea..12008ce 100644 --- a/lua/markview.lua +++ b/lua/markview.lua @@ -1474,7 +1474,6 @@ end, { end }) - markview.setup = function (user_config) ---@type markview.config -- Merged configuration tables