Skip to content

vi: fix refusal to save buffers with single insert/change modification - #107

Open
frno7 wants to merge 1 commit into
aligrudi:masterfrom
frno7:lbuf_tx
Open

vi: fix refusal to save buffers with single insert/change modification#107
frno7 wants to merge 1 commit into
aligrudi:masterfrom
frno7:lbuf_tx

Conversation

@frno7

@frno7 frno7 commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

Starting new change sets on vi_insert = 1 assignments is a provisional fix, because undo history will not be optimal. However, refusing to save modified buffers is a fatal problem for the editor.

A single edit, with insert (or change) only, did not save the buffer:

$ rm -f a && echo -e 'iabcd\eZZ' | ./vi -v a >/dev/null && cat a
cat: a: No such file or directory

However, editing twice, with insert followed by append, works as expected:

$ rm -f a && echo -e 'iab\eacd\eZZ' | ./vi -v a >/dev/null && cat a
abcd

Fixes: ca69c12 ("vi: handle insert mode commands in vi.c")

Starting new change sets on vi_insert = 1 assignments is a provisional fix,
because undo history will not be optimal. However, refusing to save modified
buffers is a fatal problem for the editor.

A single edit, with insert (or change) only, did not save the buffer:

$ rm -f a && echo -e 'iabcd\eZZ' | ./vi -v a >/dev/null && cat a
cat: a: No such file or directory

However, editing twice, with insert followed by append, works as expected:

$ rm -f a && echo -e 'iab\eacd\eZZ' | ./vi -v a >/dev/null && cat a
abcd

Fixes: ca69c12 ("vi: handle insert mode commands in vi.c")
@aligrudi

aligrudi commented Apr 29, 2026 via email

Copy link
Copy Markdown
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants