74th / vscode-vim

vim emulator for Visual Studio Code
MIT License
215 stars 25 forks source link

`u` will undo multiple editting if not pressing `Enter` #33

Closed SLAPaper closed 8 years ago

SLAPaper commented 8 years ago

It seems that pressing u will undo multiple editting, if each one is splitted by Esc rather than Enter.

For example, if I i something at one line, then Esc and go to another line, then i something, then pressing u, both the two editting will be undo, rather than the last one.

This behavior is different from GVim 7.4.977 on my computer and often destorys my work if I edit lots of lines without adding a new one.

This problem seems to be talked in #25 and I've checked Microsoft/vscode#4313. However, when I use Python: Sort Imports extension to test the issue, the Ctrl-Z works just as expected.

Since amVim has the same problem, I don't know whether the problem with Microsoft has been fixed.

Thanks!

74th commented 8 years ago

After typing and Python: Sort Imports, I tried to push crtl-z, but both typing and sorted imports were reverted.

SLAPaper commented 8 years ago

It seems that I cannot reproduce what occur to you. Whether I've installed VimStyle or not, Ctrl-Z only reverse sorting first and another one reverse editing (with VimStyle - a batch of editing, without it - one edit)

I'm using Python Extension version 0.3.7 to test with. The VSCode version and OS Version I've mention above.

74th commented 8 years ago

As you said, it seems well. I checked its code, it does nothing specially. Why? https://github.com/DonJayamanne/pythonVSCode/blob/3c7e95527b85028de1d79d8705eb2a409ab3c723/src/client/sortImports.ts

SLAPaper commented 8 years ago

I haven't done any VSCode extension or Typescript developments so I cannot figure out what the point is. But if you can find a version of Python: Sort Imports that can reproduce the problem (as you said above), maybe checking the difference between that version and the newest one will help.

74th commented 8 years ago

I am not interested in this problem well. I will wait for VSCode API support, or support vim undo on vscode.