Closed pidgeon777 closed 1 year ago
That's interesting. I'm busy right now, I'll do it a little later.
Hi @Dook1, just wondering if you were still integrating my proposal.
One thing I forgot to add, is that columns could be ordered by dragging them if a user decided to do so.
I will be free in 2 weeks and will do it.
This cannot be done because NPP does not provide an api to retrieve information from open tabs without switching to them.
@Dook1 ,
This NPP issue and this spawned Community discussion show that there really is a desire in the Notepad++ user base for multi-tab management of the bookmarks, and your plugin seems like the most natural and likely fit.
I know you said,
This cannot be done because NPP does not provide an api to retrieve information from open tabs without switching to them.
... but that's really not as much of an inhibitor to the idea as you seem to indicate: For the initial information and NPP-startup, you could have your plugin initialization note the active tab, cycle through all the available tabs quickly to do your original processing, then re-activate the original tab, so the user is presented with the expected tab by the time they start editing. And since the bookmarks won't be changing in any given tab unless the user has activated that tab, and your plugin already knows how to track the changes to bookmarks in the active tab, that's already handled correctly.
Cycle through all the tabs will cause: 1) flickering 2) if the size of files is large or their number is large, it will cause serious delays
A flickering one time probably wouldn't bother anyone (at least, probably not me). But yes, long delays caused by large files would be more likely to annoy users.
Alternatives:
The session.xml
file has a <Mark line="13" />
inside each file's entry for files that have bookmarks. So on load, you could scan through the session file to get the initial bookmarks to populate your panel.
Or you could just wait to process a given file's bookmarks until the user activates that tab (and maybe give them a menu entry to initiate an intentional scan of all the open files for bookmarks) -- so it would at least give the users access to the bookmarks in all the tabs they've visited so far.
The first alternative is not suitable because it does not allow to get the content of the line. And the second alternative I have long ago implemented, but due to lack of time I abandoned it with minor flaws.
added in 3.0.0 https://github.com/Dook1/Bookmarks-Dook/releases/tag/3.0
My suggestion is to add:
BookmarksDook
panel.This would be the resulting bookmark list with the newly added columns:
The columns could be draggable so a user could decide in wich order display them.
An essential feature, would be to guarantee that all the currently active bookmarks of all the open files are listed.
Also, supposing that the
BookmarksDook
panel is focused, the following hotkeys could be activated:Bookmark Label
textbox of the selected bookmark.Or, the contrary:
Bookmark Label
textbox of the selected bookmark.The shortcuts could more in general be decided by a user through the plugin Settings window
These suggestions would in my opinion greatly improve your already good plugin.