Skip to content
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

Cursor location incorrect after redo #2156

Open
jordwalke opened this issue Nov 16, 2017 · 2 comments
Open

Cursor location incorrect after redo #2156

jordwalke opened this issue Nov 16, 2017 · 2 comments

Comments

@jordwalke
Copy link

jordwalke commented Nov 16, 2017

  • Click thumbs-up 👍 on this issue if you want it!
  • Click confused 😕 on this issue if not having it makes VSCodeVim unusable.

The VSCodeVim team prioritizes issues based on reaction count.


Is this a BUG REPORT or FEATURE REQUEST? (choose one):

Environment:

  • VSCode Version: Insiders installed just now.
  • VsCodeVim Version: Installed from Gallery just now.
  • OS: Mac

I have no other plugins installed. I just wanted to test if VSCodeVim faithfully recreated the Vim experience, and the first thing I always try is undo/redo to see if the cursor position is restored correctly. It is not.

What happened:

Create a buffer with the following contents:

aaaaaaaaaaaaaaa

bbbbbbbbbbbbbbbb

cccccccccccccccc

Visually select (capital V) from the aaaa line to the bbbbb line. Then while visually selected hit c for "change". Immediately hit escape after changing nothing. Then hit u for undo then r for redo.

You will see your cursor in the wrong place.

Here is where it is placed:

screen shot 2017-11-15 at 8 44 26 pm

I changed nothing on the cccc line, and yet after redoing a change the cursor is placed on it. The cursor should always be placed at the start of the redone change.

Would it be possible to automate some tests to make sure the cursor is always where Vim would leave it (in this case, it's not just that it's different than vim but that it makes no sense where the cursor is placed).

How far away are we from being able to use NeoVim directly as the editing logic?

In a comment nearly one year ago, I discuss how hard it is to get cursor positions correct, and I specifically mentioned undo/redo cursor location. Since then there have been some bugs where the location is incorrect, and they were fixed, but it keeps breaking because I think the algorithm is very difficult to get right with all the edge cases. Just using NeoVim is one way to make sure it always feels solid. I'm curious how the maintainers feel about moving forward with the NeoVim approach.

@octref
Copy link
Contributor

octref commented Nov 17, 2017

Work is happening at https://github.com/chillee/vscodeneovim. I'm also looking forward to it becoming stable.

@spacepluk
Copy link

Not a lot happening in that repo unfortunately.

@J-Fields J-Fields changed the title Redo Broken Again Cursor location incorrect after redo Aug 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants