Small bug fix to use exclusive Visual caret shape from 'guicursor' #1012
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.
This PR will use the caret shape specified by
ve
in the'guicursor'
option when Visual mode is active and the'selection'
option equalsexclusive
. If theve
element isn't specified in'guicursor'
, thev
element is used instead.This PR will also now use the
ve
element for Select mode. Previously, we were using thei
Insert mode cursor (Vim doesn't have a separate Select cursor). This felt like a reasonable change at the time for several reasons. Firstly, Select mode is more similar to a traditional editor selection where typing inserts the text, replacing the selection, so using the Insert mode caret was an intuitive indicator of this. Secondly, when used in refactorings, the caret would be positioned after the selection, so a bar caret looks better.However, the caret being positioned after the selection is because IdeaVim incorrectly treats Select mode as exclusive at all times, rather than based on the
'selection'
option, like Visual. It is therefore more appropriate to use theve
cursor than thei
cursor. Fortunately, the default for this is a bar caret, so there is little visual difference with this change. It is, however, more correct.At some point, we need to fix Select's implementation and make it inclusive by default (VIM-3687). At this point, we will need to review the Select mode caret shape, as the bar will no longer be appropriate, but it will also be less intuitive for those coming from traditional editors.