leodevbro / vscode-blockman

VSCode extension to highlight nested code blocks
https://github.com/leodevbro/vscode-blockman
MIT License
345 stars 16 forks source link

Feature request - highlight selected block only #40

Closed ghost closed 2 years ago

ghost commented 2 years ago

Is there a possibility to add a toggle that lets you highlight only the last block you are working on? Personally, I think that the rest of the lines are distracting. I would like to focus only on what I am working on without extra visuals. What would be perfect is to have a feature for negative depth. The last block and two blocks before for example.

leodevbro commented 2 years ago

You can hide all non-focused blocks. Go to Blockman settings and type "none" in all 11 depth-color fields from 0 to 10. Also type "none" in N19 (Custom Color Of Block Border) and N20 (Custom Color Of Depth0 Border). depth 0 block is the ground block.

And then maybe you'd like to enable Editor: Render Indent Guides.

And negative depth (two/three... blocks before) is interesting idea, but it's not yet implemented in Blockman. I'll think about it.

tlemo commented 2 years ago

This is pretty close to what the Qt Creator IDE is doing

Having used Qt Creator for a while, I really liked that model: highlight blocks from inside out (the most visible is the current scope, then the parent one, and so on until the top scope). The rest of the blocks are not highlighted.

leodevbro commented 2 years ago

Also there is BlueJ editor, but the highlighting features are very limited.

tlemo commented 2 years ago

Right. I just want to add my +1 to the original request: I think it would be great to have an option to highlight only the nesting of the current scope (including the parents up to the root)

leodevbro commented 2 years ago

@tlemo, You mean to highlight only the blocks on the path: from the root to the focused scope? Like this: 2021-12-02_23-47-43

tlemo commented 2 years ago

@tlemo, You mean to highlight only the blocks on the path: from the root to the focused scope? Like this:

Exactly!

PS. if I understand it correctly, #28 is also describing the same request

leodevbro commented 2 years ago

Yeah, I guess it's the same request. I did not understand the request first time, but now I understand. I'll think about implementing it. If it's not a huge brain pain, then maybe I'll be able to do it in several days.

leodevbro commented 2 years ago

@tlemo, Huge Thanks for the donation, super enthusiastic people like you give me so much motivation to make my open source software as cool as possible.

curiobeing commented 2 years ago

This would be very useful and increases focus.

leodevbro commented 2 years ago

Guys, good news, I almost implemented the focus tree coloring logic. It will be VERY customizable, you'll see. This is just info about my progress, yeah, it took me many days, and maybe I need more days, but I want you to know that I'm working on your feature requests and I want to release them as soon as possible.

focus-tree

tlemo commented 2 years ago

Fantastic! Can't wait to try it!

leodevbro commented 2 years ago

It's practically finished. I just need to test before releasing. What do you think about it? The advanced coloring settings are very customizable. There are 10 advanced coloring fields (5 for backgrounds and 5 for borders). Is the instruction easy to understand?

2021-12-21_02-40-23

tlemo commented 2 years ago

Great news!

The advanced coloring scheme seems powerful, although it's independent from the "selected-block-only" functionality, am I wrong?

leodevbro commented 2 years ago

With this update (not yet released), Blockman now has it all:

What would be perfect is to have a feature for negative depth. The last block and two blocks before for example.

This one is the N33 A02 or N33 A04. As you can see, there are many choices of how the advanced coloring would behave based on block selection logic.

selected-block means focused block, right? The advanced coloring fields are very flexible with the focused block.

leodevbro commented 2 years ago

@ghost, @tlemo, @curiobeing, Blockman 1.4.0 is now released. Here is the video instruction for the advanced coloring settings:

https://www.youtube.com/watch?v=UsET6-kPu90

If you find it difficult to adjust the settings exactly for your needs, please let me know and I will help you with the instructions specifically for your cases.

tlemo commented 2 years ago

Thank you @leodevbro! I finally got a chance to give it a try, and I was able to configure it pretty close to what I had in mind: my goal is a simple (clean?) setup, with no borders and a subtle gradient for the background - here's an example:

image

While the settings seem to allow for finely grained customization, I think most users (myself included) would like a simplified model with fewer settings to tweak.

Finally, here are a few ideas and a bug I discovered while trying these new settings:

  1. https://github.com/leodevbro/vscode-blockman/issues/58
  2. https://github.com/leodevbro/vscode-blockman/issues/59
  3. https://github.com/leodevbro/vscode-blockman/issues/60

Cheers!

leodevbro commented 2 years ago

Thanks, I'll check them out.