:MdRenderAuto keeps the buffer in render mode while in Normal mode and swaps back to source on InsertEnter. To make this work despite the render buffer being nomodifiable, the implementation remaps i / I / a / A / o / O on the render buffer to (1) swap the window's buffer back to the source, then (2) enter Insert mode at the corresponding position.
This makes the common keystrokes "just work", but anything that doesn't go through one of those six keys silently fails on the read-only render buffer. Concrete examples:
- Ex commands that mutate the buffer:
:s, :!filter, gq
- Operator-pending sequences such as
c{motion}, s, S, r, R, gi, gI
- Macros that contain editing keys other than i/I/a/A/o/O
- User mappings or plugin commands that enter Insert mode (snippet expansion, LSP code actions, comment toggling that uses Insert under the hood, etc.)
For users whose editing flow leans on these, Auto mode currently feels brittle: the surface promise is "render in Normal mode" but in practice you have to know which keystrokes are intercepted and which aren't.
Possible directions worth exploring (none committed):
- Extend the remap set to cover more standard editing entry points.
- Detect attempted edits via
BufModified / CmdlineEnter heuristics and swap as a fallback.
- At minimum, document the limitation in
:help :MdRenderAuto and surface a :echohl WarningMsg when an edit is rejected on the render buffer.
Filed as a follow-up to #5; :MdRenderAuto ships as experimental with this limitation called out in the README and :help.
:MdRenderAutokeeps the buffer in render mode while in Normal mode and swaps back to source onInsertEnter. To make this work despite the render buffer beingnomodifiable, the implementation remapsi/I/a/A/o/Oon the render buffer to (1) swap the window's buffer back to the source, then (2) enter Insert mode at the corresponding position.This makes the common keystrokes "just work", but anything that doesn't go through one of those six keys silently fails on the read-only render buffer. Concrete examples:
:s,:!filter,gqc{motion},s,S,r,R,gi,gIFor users whose editing flow leans on these, Auto mode currently feels brittle: the surface promise is "render in Normal mode" but in practice you have to know which keystrokes are intercepted and which aren't.
Possible directions worth exploring (none committed):
BufModified/CmdlineEnterheuristics and swap as a fallback.:help :MdRenderAutoand surface a:echohl WarningMsgwhen an edit is rejected on the render buffer.Filed as a follow-up to #5;
:MdRenderAutoships as experimental with this limitation called out in the README and:help.