fix(actions): persist per-buffer render config across re-renders#477
fix(actions): persist per-buffer render config across re-renders#477NeOzay wants to merge 2 commits intoOXY2DEV:mainfrom
Conversation
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 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR updates actions.render() so that when a custom render config is provided, it is remembered per-buffer and reused on subsequent automatic re-renders (e.g., from autocmds), instead of falling back to the global config.
Changes:
- Persist
_configpassed toactions.render()into a per-buffer variable. - When
_configis omitted on later calls, retrieve the stored per-buffer config and apply it viaspec.tmp_setup().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
@NeOzay what's the use case for this? Also, why buffer local variable? Shouldn't it be window local(some of the rendering logic is affected by window options) variable? |
|
@OXY2DEV I'm doing it with this code, maybe I'm doing it wrong. require("markview.actions").render(self.buf, nil, {
markdown = {
list_items = { indent_size = 1, shift_width = 1 },
code_blocks = {
label_direction = "right",
style = "simple",
},
},
}) |
|
Also, my PR is more of a draft, I'm sure it's possible to implement this more cleanly. |
|
@NeOzay isn't the notification buffer a Also, if for whatever reason you have |
|
I'm already using To make it work, I'm using My problem is how I can specify a local configuration for a window. |
Hi,
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.