doc comment rendering & linenumber scrolling
Closed this issue · 14 comments
Thanks for your excellent job!It's almost the best codeblock plugin of Obsidian now. Howerver I still find 2 bugs as following:
1. doc comment rendering
1.1 enabling CodeblockCustomizer
<div class="codeblock-customizer-RVline">
<div class="codeblock-customizer-RVline-number" style="--codeblock-customizer-RVline-number-color:#2B2B2F; --codeblock-customizer-RVline-number-textColor:#6C6C6C;">7</div>
<div class="codeblock-customizer-RVline-text"> * <span class="token keyword">@param</span> <span class="token class-name"><span class="token punctuation">{</span>number<span class="token punctuation">}</span></span> <span class="token parameter">key</span></div>
</div>
The doc-comment token of line 7-11 is rendered as common text
1.2 disableing CodeblockCustomizer
<span class="token doc-comment comment">/**
* <span class="token keyword">@param</span> <span class="token class-name"><span class="token punctuation">{</span>number<span class="token punctuation">}</span></span> <span class="token parameter">key</span>
...
</span>
The doc-comment token is rendered right (because it is in a span that has class doc-comment
and comment
)
2. linenumber scrolling
Only almost the best? :) If you have ideas for new features, or how to make it better, feel free to tell me.
Regarding the problems:
- --> I will look into this this week.
- --> What exactly is the problem there? That it displayed a scrollbar? If yes, should it have broken the line into a new line?
So, it's not the scrolling that is problematic, but rather that when you scroll the line number is not displayed, because it is scrolled with the text, and is not visible? This is what you mean?
Exactly.
Ok, I just wanted to be sure, that I understood the problem. But you are right, that shouldn't be that way. I will look into this as well.
Thanks for your reply! Keep up the good work.
I mean the setting of IDE like Intelli J. It has an option about line-wrap like following:
Wouldn't it be better if the text would wrap like this
Since you asked if line-wrap is better, I want to use the conditon that IDE makes wrap-line as an option to prove that it's a matter of personal perference.
ok, I understand, however, I am not yet sure if it is possible. Obsidian works a little different unfortunately. I am having a little trouble regarding this, but I do what I can :)
Thanks for this amazing plugin! Finally codeblocks can be styled nicely! I too would be very interested in maintaining the line number to the side whilst scrolling. Could this be done via css position absolute and some margin?
With regards to line wrap vs no line wrap, I prefer to read code with no line wrap and edit with line wrap so in reading mode, it would be very preferable to be able to have a scrollable agnostic line numbering.
The next release will contain the fix for the line numbers and comment rendering as well. I am having a little trouble to get all the things fixed, because now if I fix something it breaks something else. Unfortunately, CSS is not my strength. I think in the worst case I can release the next version with the fixes. It will also include a new feature where you can override line numbering behavior with ln:true
or ln:false
for specific code blocks. Hang in there a little :)
Both problem should be fixed in v1.2.0. Sorry it took this long. Try out the current version, and report back if you experience any other problems. Please also read the README.