-
Notifications
You must be signed in to change notification settings - Fork 200
Open
Description
When exiting insert mode, without yet accepting the suggested text (with Tab) using different methods - sometimes an undesired outcome occurs, leaving the suggested text displayed (and not selectable[!], albiet not save-able).
Vim version: VIM - Vi IMproved 9.0
Reproduction/test instructions
Let me describe how to reproduce, and then branch into three cases that are part of my workflow...
Start (all cases) by:
- Set mapping (for case 1):
:inoremap jj <Esc>(bindjjin insert mode to return to normal mode). - Enter insert mode
i. - Start typing
def fizzbuzz(number): - Await appearance of text suggestion.
- Proceed to one of the following case scenarios...
Case 1 - Vanilla:
- Exit insert mode by pressing
Esc. - Result: suggested text disappears after a second (this expected behavior). ✅
Case 2 - Mapping:
- Exit insert mode by pressing
jj. - Result: suggested text disappears after a second (this expected behavior). ✅
Case 3 - Ctrl+c:
- Exit insert mode by pressing
Ctrl+c. - Result:
- suggested text remains displayed (unexpected behavior!). ❌
- cannot navigate suggested text with cursor (arrow keys or
hjkl). ❌ - saving the file will not store the suggested text (this is a good thing). ✅
- next time insert mode is entered (anywhere in the file), the suggested text will finally disappear - but until then there is an offset to line navigation, proportional to the amount of suggested lines. ✅
Conclusion
- This issue has a minor impact, however if a simple fix could be found for it - then it'd be nice.
- I am not certain of how many users "like" using
Ctrl+cin Vim to exit insert mode sometimes. - This StackOverflow thread may be a good place to start, regarding understanding differences between
EscandCtrl+cwhen exiting insert mode.
Metadata
Metadata
Assignees
Labels
No labels