From b76d7c184554c48c94d372b1d771ef6323be32c8 Mon Sep 17 00:00:00 2001 From: Ozay Date: Mon, 16 Mar 2026 15:45:35 +0100 Subject: [PATCH 1/2] fix(actions): persist per-buffer render config across re-renders When a custom config is passed to actions.render(), store it as a buffer variable so that subsequent automatic re-renders (triggered by autocmds like ModeChanged, CursorMoved) reuse it instead of falling back to the global config. Co-Authored-By: Claude Opus 4.6 --- lua/markview/actions.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lua/markview/actions.lua b/lua/markview/actions.lua index 422b3b35..807b0c59 100644 --- a/lua/markview/actions.lua +++ b/lua/markview/actions.lua @@ -140,10 +140,17 @@ actions.render = function (_buffer, _state, _config) local renderer = require("markview.renderer"); local spec = require("markview.spec"); - spec.tmp_setup(_config); - local buffer = _buffer or vim.api.nvim_get_current_buf(); + -- Persist per-buffer config: store when provided, retrieve when absent + if _config then + vim.b[buffer].__markview_config = _config; + elseif not _config then + _config = vim.b[buffer].__markview_config; + end + + spec.tmp_setup(_config); + local state = require("markview.state"); local buf_state = _state or state.get_buffer_state(buffer, true); From 3fdab849f7f65ba404bec17e5f4569be08ae77c4 Mon Sep 17 00:00:00 2001 From: NeOzay <69015205+NeOzay@users.noreply.github.com> Date: Mon, 16 Mar 2026 16:05:16 +0100 Subject: [PATCH 2/2] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- lua/markview/actions.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lua/markview/actions.lua b/lua/markview/actions.lua index 807b0c59..8cc04070 100644 --- a/lua/markview/actions.lua +++ b/lua/markview/actions.lua @@ -1,4 +1,5 @@ local actions = {}; +local buffer_configs = {}; ---|fS "chunk: Hybrid mode related stuff" @@ -142,11 +143,11 @@ actions.render = function (_buffer, _state, _config) local buffer = _buffer or vim.api.nvim_get_current_buf(); - -- Persist per-buffer config: store when provided, retrieve when absent - if _config then - vim.b[buffer].__markview_config = _config; - elseif not _config then - _config = vim.b[buffer].__markview_config; + -- Persist per-buffer config in Lua-only state: store when provided, retrieve when absent + if _config ~= nil then + buffer_configs[buffer] = _config; + else + _config = buffer_configs[buffer]; end spec.tmp_setup(_config);