Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
guicursor! #337
guicursor! #337
Changes from 21 commits
646a89d
2be0f5c
b50281f
6c4bd9c
e859b1c
9c71b44
55dedb4
dfbec1f
287ba70
e93a619
9f46e19
43620c2
9cf0a1a
8a55199
ccd792b
d19c776
ad19dc0
b4d40fa
a6087dd
2f73dac
f051231
64be751
1caf380
fe7dc49
0288a0f
0d840b2
d6a99d4
91585e1
d63e3da
70a45f3
6ab5380
ae21727
74b0e3b
c268407
3fae2fd
ee74367
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we add this new mode to catch the moment when the
r
is pressed, but replaced character is not yet typed by user?I just don't understand why
REPLACE
mode is not enough.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's it.
I introduced
REPLACE_CHARACTER
because I don't think this is a good fit for the existingREPLACE
mode. It's tracking the state of an incomplete command, rather than actually switching intoREPLACE
mode. It doesn't feel right to do a full mode switch in the middle of command entry - we're not actually in replace mode, we're waiting for an argument to a command that will do a replace. We want to look like we're in replace mode, but not actually be in it.And pragmatically, if we used
REPLACE
, we'd still need another piece of state to know when to pop theREPLACE
mode if hitting<Esc>
or entering an incorrect digraph. E.g.handleDigraph
doesn't currently pop modes, so if we're entering a digraph, we don't know if we're entering it in actual replace mode, or as the argument for an incomplete action. The sub mode gives us everything we need, and tells us we're still inCOMMAND
orVISUAL
mode (which we are, waiting for a command to complete), and gives us something we can update the caret with.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, thank you for explanation. I have some thoughts about removing
subMode
at all because it doesn't exist in vim, but it might be a future refactoring. Let's use our current structure.