vterm: Visual consistency for append #777
Merged
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.
evil-collection-vterm-append
doesn't work, andevil-collection-vterm-append-line
doesn't correctly display where the cursor is located. This fixes both issues.The problem with both commands lies in the fact that
evil-append
doesn't accurately place the insert-mode cursor in front of the cursor displayed in normal-mode; instead acting in a functionally identical way asevil-insert
, but moving only the displayed cursor forward one character until a character is placed.Moving the cursor forward one character before entering insert mode solves
evil-collection-vterm-append
's issues. I haven't encountered any unexpected behaviour with the edge-case scenario of moving the cursor forward at the end of a line, which is the only situation I thought might be problematic with this solution.The only fault with
evil-collection-vterm-append-line
is where the cursor is displayed, not where it actually is at the time of editing, contrary to what happened withevil-collection-vterm-append
. Therefore, all that is necessary is to move backwards one character the displayed cursor when entering insert-mode, which can be easily achieved by swappingevil-append
forevil-insert
.Direct link to the package repository
https://github.com/miguebox/evil-collection/tree/pull-request