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

Marks are reset/removed after some time #3841

Open
Hultner opened this issue Jun 18, 2019 · 12 comments · May be fixed by #8575
Open

Marks are reset/removed after some time #3841

Hultner opened this issue Jun 18, 2019 · 12 comments · May be fixed by #8575

Comments

@Hultner
Copy link

Hultner commented Jun 18, 2019

Describe the bug
I work on a file, set some marks for key areas I jump around between. After a while I notice that my marks are gone, this is happening repeatedly while working with the file.

To Reproduce
Steps to reproduce the behavior:

  1. Go to a file
  2. Set a couple of marks
  3. Continue to use the application, work for some time (maybe an hour? not quite sure)
  4. Try to go to previously set mark, it is now no longer there. Error message E20: Mark not set

Expected behavior
Got to the previously set mark

Screenshots
If applicable, add screenshots to help explain your problem.
If remapping-related, please attach log output: https://github.com/VSCodeVim/Vim#debugging-remappings.
N/A

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 1.8.1
  • VSCode version: Version 1.34.0 (1.34.0)
  • OS: macOS 10.14.5
@Mattiaslndstrm
Copy link

I also have this problem. I get the feeling that marks changes line as well. I have just experienced it with a upppercase mark if that's relevant.

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 1.12.4
  • VSCode version: Version 1.41.1
  • OS: Windows 10

@Lanearth
Copy link

I have the same problem. When I quit vscode, all marks are unused.

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 1.14.5
  • VSCode version: Version 1.42
  • OS: Windows 10

@2jacobtan
Copy link

2jacobtan commented Mar 29, 2021

Strange behaviour:

  • [edit:] the file begins in a saved state
  • set a mark
  • insert mode: type something
  • press Ctrl + Z (undo)
  • [edit:] the above undo step brings the file back to its saved state
  • press Escape

And poof, the mark is gone.

More complex cases happen but this is the minimal reproduction.

Environment:

  • Extension (VsCodeVim) version: 1.19.3
  • VSCode version: Version 1.54.3 (user setup)
  • OS: Windows 10

Update: the bug happens both when connected to WSL2 Ubuntu 20, and also when working on native Windows files.

@J-Fields
Copy link
Member

@2jacobtan Just to confirm, are you using VSCode's undo, or VSCodeVim's undo?

@2jacobtan
Copy link

2jacobtan commented Mar 30, 2021

VSCode's undo.

VSCodeVim's undo doesn't cause such a bug :D

(Update: the bug happens both when connected to WSL2 Ubuntu 20, and also when working on native Windows files.)

Happens with .txt and .md files too.


I did more testing, and a necessary condition is that the file begins in a saved state.

When Ctrl+Z (VSCode undo) undoes the changes until the file reverts to its saved state, pressing Escape (or many other key, for that matter) would clear all existing lowercase marks (uppercase marks unaffected).

@magicant
Copy link

It seems marks are lost when the file is modified by an external tool like a code formatter and vscode reloads the file content.

@ninjarogue
Copy link

Has anyone found a solution to this issue yet? The marks keep auto resetting after a short period of time

@kjaku
Copy link

kjaku commented Sep 10, 2021

It also seems that marks aren't saved to disk like registers. So marks are lost too after Reload Window.

@searleser97
Copy link

searleser97 commented Nov 12, 2021

I also have this issue my marks disappear :c, I use "VSCode's undo" because it can undo just words instead of whole lines (vim's undo), and the UI updates accordingly when undoing or redoing.

Also related to this issue vscode-neovim/vscode-neovim#636

@mbahnmiller
Copy link

Any resolution? This is still happening - and with a variety of actions. Delete a line. Undo. Open a new line. All kinds of things. I've noticed this in PHP, though haven't been paying attention in other files.

@johnywojtek
Copy link

Still the same :(

EerikSaksi added a commit to EerikSaksi/Vim that referenced this issue Aug 28, 2023
EerikSaksi added a commit to EerikSaksi/Vim that referenced this issue Aug 28, 2023
EerikSaksi added a commit to EerikSaksi/Vim that referenced this issue Aug 28, 2023
@EerikSaksi
Copy link

I fixed this for global marks as I don't really use local marks much but I do really rely on global ones, should I open a PR?

Also apologies if the code is bad I haven't worked with extensions before, I just really wanted this fixed

EerikSaksi added a commit to EerikSaksi/Vim that referenced this issue Sep 10, 2023
@EerikSaksi EerikSaksi linked a pull request Sep 10, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.