Vim icon indicating copy to clipboard operation
Vim copied to clipboard

Persist global marks on disk

Open EerikSaksi opened this issue 2 years ago • 9 comments

Fixes #3841

What this PR does / why we need it: This PR ensures that marks are persisted between sessions through a new history file. This makes marks much more usable as marks set before the editor was closed/loaded will still work. This persists local and global marks. Also includes duplicate dedection, so when old marks are overriden the history file also removes the old mark from the file.

Which issue(s) this PR fixes #3841

Special notes for your reviewer:

EerikSaksi avatar Sep 10 '23 19:09 EerikSaksi

I merged this PR and roughly used it, and found two issues:

  1. When 'vim. showMarksInGutter' is set to true, the initialization plugin prompts: mark. position. getLineBegin is not a function
  2. Using ` + marker cannot jump and will result in an invalid button state

HenryTSZ avatar Nov 23 '23 07:11 HenryTSZ

Hey @EerikSaksi was this something you were hoping to come back to? Persistent marks would be great to have

jasonwilliams avatar Aug 13 '24 09:08 jasonwilliams

I fixed the gutter issues and fixed some linting stuff, I think the `+ thing should also be solved now

EerikSaksi avatar Aug 13 '24 13:08 EerikSaksi

Hey @EerikSaksi I can test this, before I do some questions..

Are global marks supposed to be workspace wide? So if I set a global mark (uppercase letter after m) then move to another file and call it ('M) should it take me to that file? Or are they only file dependent?

jasonwilliams avatar Aug 14 '24 09:08 jasonwilliams

Yeah global marks mark a position and a file and will take you to that file, lower case marks are specific to files

EerikSaksi avatar Aug 14 '24 15:08 EerikSaksi

I've tested @EerikSaksi's PR and I can confirm it works, I've tried setting a permanent mark and reloading the window and it does take me back to the right place, this doesn't happen on the main branch.

I don't see a gutter mark for permanent marks only local marks, is this intended?

jasonwilliams avatar Aug 14 '24 21:08 jasonwilliams

is there any way I can help pushing this PR to be merged?

I really want to have this feature :)

greg0x avatar Nov 14 '24 22:11 greg0x

Sorry been busy keep forgetting I’ll try look into getting this merged this weekend

EerikSaksi avatar Nov 15 '24 08:11 EerikSaksi

@J-Fields I think this might be ready for prime time and to be merged

greg0x avatar Feb 07 '25 05:02 greg0x