Problem: ":startinsert" enters Insert mode in a buffer where
'modifiable' is off, the error only appears when a character
is typed. Typing "i" gives the error right away.
Solution: Give the error when the buffer is not modifiable, like "i"
does. Keep ignoring the command in a terminal window, where
":startinsert" is documented to be ineffective, and keep
accepting it when 'insertmode' is set, like "i" does.
fixes: #20804
Handling of the "!" is now done after the terminal check and the 'modifiable'
check, so it is skipped when the command does nothing. Before this change
":startinsert!" moved the cursor to the end of the line first, and only then
was the command ignored or rejected:
:set nomodifiable
:startinsert! " E21, but the cursor had moved to the end of the line
Typing "A" in the same buffer gives E21 without moving the cursor, so the old
behaviour is considered a bug. This also affects a terminal window, where the
cursor was moved even though ":startinsert" is documented to be ineffective
there.
https://github.com/vim/vim/pull/20806
(2 files)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
thanks
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()