mugiwara85 / CodeblockCustomizer

Codeblock Customizer plugin for Obsidian
MIT License
147 stars 7 forks source link

[BUG] Highlight active line highlights all lines, not only ones inside code blocks #91

Closed EastArctica closed 2 weeks ago

EastArctica commented 2 weeks ago

Note: I wrote this entire thing and then my browser crashed so I'm rewriting it a bit snipper and less proper.

First off, wanted to say I love the plugin and that it works great.

Okay so, issue is: Active line is highlighted no matter whether we're inside a code block or not.

With highlight active line enabled Here's it being shown on a random file. (bottom line is highlighted) ![image](https://github.com/mugiwara85/CodeblockCustomizer/assets/32211444/34912746-5810-4fab-806f-fb29ee21c1cd) Here it can be seen working correctly while inside of a code block. ![image](https://github.com/mugiwara85/CodeblockCustomizer/assets/32211444/064ca6a5-95dd-443f-9c1e-3cf19b135294)
With highlight active line disabled ![image](https://github.com/mugiwara85/CodeblockCustomizer/assets/32211444/42ab2018-4b5e-4139-bbc8-0d5ac1c9b83a) ![image](https://github.com/mugiwara85/CodeblockCustomizer/assets/32211444/b22eb832-807c-4efb-b811-eb528da5153b)

Of note, you can also tell in the last image that the line is still being slightly highlighted even with the setting disabled. (This does not occur with the plugin disabled)

Also, if you need my config or anything just let me know how I can send it over and I will.

mugiwara85 commented 2 weeks ago

@EastArctica Hi, there two options for highlighting the active line:

This one would only highlight the active line inside code blocks. image

However if this is enabled, then it highlights the active line inside and outside of code blocks. image

Can you check please? If I disable both of them, then I have no active line highlight.

EastArctica commented 2 weeks ago

I can confirm setting Enable editor active line highlight to disabled does fix all the issues.

I still wonder if the slight background inside the code block when we have Enable editor active line highlight enabled and Enable codeblock active line highlight disabled should occur? This would be up to you though I don't mind either way 🤷

mugiwara85 commented 2 weeks ago

No, it should not. I checked again, and if both are disabled, there is no highlight for the active line. What Obsidian Theme are you using? This may be coming from your theme. Try to switch themes, or disable custom CSS (if you have applied any), to check if you can still see it then.

EastArctica commented 2 weeks ago

No, it should not. I checked again, and if both are disabled, there is no highlight for the active line. What Obsidian Theme are you using? This may be coming from your theme. Try to switch themes, or disable custom CSS (if you have applied any), to check if you can still see it then.

Sorry, I must've worded it badly in my message.

Is it intended for the active line inside of a code block to be highlighted under these conditions: Enable editor active line highlight: Enabled Enable codeblock active line highlight: Disabled

The highlight I'm referring to is very transparent and barely appears, but appears nonetheless.

mugiwara85 commented 2 weeks ago

In that case yes. Editor active line highlight applies the active line highlight for the whole editor (inside and outside) of code blocks. Codeblock active line highlight applies the active line highlight to only code blocks. If you enable both of them, then you can have different highlight colors when you click inside or outside of a code block.

If you disable both of them, do you still have active line highlight?

EastArctica commented 2 weeks ago

If you disable both of them, do you still have active line highlight?

Yes. With both disabled, I get no active highlights.

Thank you for your help. I wanted to make sure that the editor active line highlight triggering inside the code block was intended and not a bug.

mugiwara85 commented 2 weeks ago

No problem.