Closed lcrockett closed 2 years ago
The commmand MarksToggleSigns doesn't seem to do anything as the bookmark signs stay put
I have a WIP PR that will fix this, and allow toggling signs on a per buffer basis.
Using vim.api.nvim_buf_clear_namespace, leaving the buffer and then returning to it, the following persistent error message pops up: (Error executing vim.schedule lua callback: ...site/pack/packer/start/marks.nvim/lua/marks/bookmark.lua:233: attempt to perform arithmetic on local 'line' (a nil value)% )
This seems like a bad idea. The extmark namespaces used by the plugin are an implementation detail and shouldn't be modified by users. In this case, you have deleted all of the extmarks placed by the plugin without it knowing; when it then checks to see the positions of these extmarks, it runs into an error since they are no longer there.
Set bookmarks don't seem to survive Neovim restarts (not sure if bookmarks are supposed to survive Neovim sessions, would be a fantastic-to-have feature however)
This is on the todo list, but no timeline.
That's great, looking forward to trying out the PR or merge for both the per-buffer toggling of signs and being able to restore bookmarks in between sessions.
Regarding clearing the extmark namespace; i'd reckon that the upcoming per-buffer basis toggling will make the need for this redundant so i'll just wait for that to come out to continue testing.
Cheers !
I'm trying to hide the bookmark signs + virtual text upon a
BufLeave,FocusLost
and showing them again upon aBufEnter,FocusGained
as I do with other plugins likevim-gitgutter
and Neovim's LSP decorations. This prevents unnecessary clutter on windows with many simultaneous splits opened.I'm using the snippet below to toggle signs and remove the virtual text on a per-buffer basis.
Upon
BufLeave,FocusLost
:Upon
BufEnter,FocusGained
:I'm running into a few items however with bookmarks set via (
lua require('marks').set_bookmark1()
):MarksToggleSigns
doesn't seem to do anything as the bookmark signs stay putvim.api.nvim_buf_clear_namespace
, leaving the buffer and then returning to it, the following persistent error message pops up: (Error executing vim.schedule lua callback: ...site/pack/packer/start/marks.nvim/lua/marks/bookmark.lua:233: attempt to perform arithmetic on local 'line' (a nil value)%
)Would it additionally be possible to have additional commands
MarksSignsBufferDisable
+MarksSignsBufferEnable
to allow for more control on when to show signs on a per-buffer basis ? This is similar tovim-gitgutter
and would allow for non-interactive control of signs display as opposed to theMarksToggleSigns
command which is very useful interactively.Currently used configuration:
Cheers