-
-
Notifications
You must be signed in to change notification settings - Fork 378
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
Harpoon doesn't save cursor position after quit #441
Comments
I can replicate this issue. Here is a video, in two parts because size requirements: Vid_P1.movVid_P2.movHarpoon isn't updating the global list when you move places. The logger shows the parent list, and not the updated list. The updated list is also not being written. In addition, harpooning at the new position doesn't do anything, and it will still move to the initial harpoon position upon a new session. |
It's also a failing test in
|
Any updates or workarounds? |
I'm going to have to think about a way to be able to debug. It works on my machine, but that sucks. I'll have to make the log be able to save to a file. And then have you share the file |
I've isolated it down to the BufLeave function definition in |
Additionally, after a but more searching, I'm seeing that the BufLeave function defined by the default config doesn't seem to be called anywhere, as there is no place where an autocmd is created using that function. |
@ThePrimeagen two questions: What is your config; the default with both sync_on_ui_close and save_on_ui_toggle set to false? And do your marks persist if you close a buffer or you exit neovim? |
I have the same issue + I don't get line numbers anymore sometimes, not sure how that happened. |
I'll see if I can spend some time on this tonight. I'll stream it to |
I also have this issue and I thought it was due to how BufLeave is supposed to work as the documentation states the following:
|
I'm going to rework how the files are stored. This will prevent the aforementioned problem from happening |
I am currently writing a custom list and I think I discovered what is causing this. I think the issue is in BufLeave. It is looking up by the display name and the display name is not always the same as I added some log statements to Having the full file path as part of the context would be helpful for solving this issue and I think it would be helpful for many other use cases. |
I have been looking into this a bit and there are at least two issues going on here.
Edit:
|
Workaround that seems to work, but could use (a lot of) improvement:
|
I'm going to be changing how I save files here soon. Instead of one big configuration, I will have many small files. This is going to allow me to not wait until exit to save |
Unfortunately, Prime is still APM-Brained. We should probably expect harpoon to be slowed down for at least another month, maybe even two. |
@theKnightsOfRohan I get it. It's open source, it's his project, and he can do as little or as much as he wants with it. |
Still issue at time of this comment, just bumping for others who end up here |
Vim has a builtin mechanism for saving and restoring cursor positions and marks across restarts. Leverage mkview and loadview to make harpoon restore marks and cursor positions after quitting. https://www.reddit.com/r/vim/comments/ex1vlv/comment/fg63erw Closes: ThePrimeagen#441
Another approach is to leverage the viminfo I took that and minimally wired it into harpoon2 in #525 as a proof of concept. The code's not terrible so it could be merged as-is, but it does call into question whether the context table needs to keep track of row and col anymore now that vim's handling that part. I'm not sure if this is the best way since it's setup to save/restore on switch and sync unconditionally, but it does work pretty reliably. |
@davvid I have ran into some weird issues with cwd, folds etc. when using mkview, etc. Depending on your global settings, more stuff than you want could be saved unfavorably and I think the purpose of harpoon is to be pretty explicit and defined about what it is trying to harpoon / focus in on. Just my 2 cents that bringing views in could get messy pretty quickly based on my experience with other plugins. |
Thanks @GitMurf +1 to that. Indeed, it'd be better to make it so that the row and col fields are always correct so that a proper and more minimalist approach can be taken. Another reason why we'd want a more minimalist implementation is that mkview and loadview are slower than setting just setting the cursor directly. |
Harpoon was not remembering the cursor position after quitting nvim. Ensure that the cursor information is always saved and applied so that we get back to exactly where we last were in the harpooned file. Closes: ThePrimeagen#441
Harpoon was not remembering the cursor position after quitting nvim. Ensure that the cursor information is always saved and applied so that we get back to exactly where we last were in the harpooned file. Closes: ThePrimeagen#441
Harpoon was not remembering the cursor position after quitting nvim. Ensure that the cursor information is always saved and applied so that we get back to exactly where we last were in the harpooned file. Closes: ThePrimeagen#441
Harpoon was not remembering the cursor position after quitting nvim. Ensure that the cursor information is always saved and applied so that we get back to exactly where we last were in the harpooned file. Closes: ThePrimeagen#441
Harpoon was not remembering the cursor position after quitting nvim. Ensure that the cursor information is always saved and applied so that we get back to exactly where we last were in the harpooned file. Closes: ThePrimeagen#441
Harpoon was not remembering the cursor position after quitting nvim. Ensure that the cursor information is always saved and applied so that we get back to exactly where we last were in the harpooned file. Closes: ThePrimeagen#441
Harpoon was not remembering the cursor position after quitting nvim. Ensure that the cursor information is always saved and applied so that we get back to exactly where we last were in the harpooned file. Closes: ThePrimeagen#441
Harpoon was not remembering the cursor position after quitting nvim. Ensure that the cursor information is always saved and applied so that we get back to exactly where we last were in the harpooned file. Closes: ThePrimeagen#441
Harpoon was not remembering the cursor position after quitting nvim. Ensure that the cursor information is always saved and applied so that we get back to exactly where we last were in the harpooned file. Closes: ThePrimeagen#441
Harpoon was not remembering the cursor position after quitting nvim. Ensure that the cursor information is always saved and applied so that we get back to exactly where we last were in the harpooned file. Closes: ThePrimeagen#441
Harpoon was not remembering the cursor position after quitting nvim. Ensure that the cursor information is always saved and applied so that we get back to exactly where we last were in the harpooned file. Closes: ThePrimeagen#441
Harpoon was not remembering the cursor position after quitting nvim. Ensure that the cursor information is always saved and applied so that we get back to exactly where we last were in the harpooned file. Closes: ThePrimeagen#441
I've noticed an issue with Harpoon related to the persistence of cursor positions. When a file is harpooned, the cursor position is saved upon quitting neovim (I could see this from harpoon.json). However, when reopening the harpooned file and moving the cursor to a new position, the Harpoon doesn't preserve the updated cursor position if I quit from neovim again. So every time I open harpooned file it jumps to a position which was initially saved when file was harpooned.
My configuration:
The text was updated successfully, but these errors were encountered: