alefragnani / vscode-bookmarks

Bookmarks Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=alefragnani.Bookmarks
GNU General Public License v3.0
1.7k stars 163 forks source link

[FEATURE] - Make bookmarks “selection based” with different decorations for line and selection #495

Open snnsnn opened 2 years ago

snnsnn commented 2 years ago

Hi,

It would be easier to navigate inside a large document if we have strong visual cues for bookmarked text, like a discernible background color, inside the document itself.

We can apply a specific decoration when bookmarking which can be clean out when the bookmark toggled off. The idea is making bookmarked text stand out. With margin icons, it is easier to navigate between documents but way hard to find your way inside the document.

User can control the visual aspects of the decorator via additional settings.

Changing color may interfere with the code highlighting and using background color may be less invasive but it would be best if we add the option change color, size, border etc with sensible defaults and let the user decide. For example, for color we can use transparent as the default value, or for font-size, we can use the default font-size. Better yet, a separate setting may toggle the highlights on and off.

Additional indicators on the minimap and the scrollbar also helps a lot.

snnsnn commented 2 years ago

Something like this: https://marketplace.visualstudio.com/items?itemName=ryu1kn.text-marker

alefragnani commented 2 years ago

Hi @snnsnn ,

You already can customize a few aspects of the bookmarked lines and the scrollbar/overview rule. Take a look at README https://github.com/alefragnani/vscode-bookmarks#available-colors. Minimap on the other hand, is not allowed by VSCode (no API yet), neither font size, which in fact, would end up messing with the text.

Just to clarify, the bookmarks are line based, so the decorations only works/support line based approach.

Hope this helps

snnsnn commented 2 years ago

@alefragnani Line coloring is good enough for me but having specific range rather than whole line would be better for focus or finding your way inside the code. When specific range is colored, I immediately know what I am after, but with lines, it becomes just another line and now I have to take some time and remember why I bookmarked it.

alefragnani commented 2 years ago

As I said, right now the extension's decoration is line based. But in fact, internally, it is position based, so it already stores the column position as well.

About 3 years ago, #191 has been opened requesting for bookmarks to be selection based. But in the end it was closed because it didn't receive enough upvotes.

Let's keep you issue opened, so other users could look and upvote. Depending on the feedback, it could be added to the backlog.

Hope this helps

clockwood commented 2 years ago

I would LOVE for it to be selection based, or at least have the option. Seems more intuitive.