nb-codeoutline icon indicating copy to clipboard operation
nb-codeoutline copied to clipboard

Viewport highlighting is not accurate

Open nmatt opened this issue 9 years ago • 2 comments

NetBeans adds blank space in the editor at the bottom of files. The viewport highlighting in the code outline does not take this into account and highlights a different (larger) section of the file than is visible in the editor viewport (see example screenshot below).

To compensate for the blank space that NetBeans adds, the section highlighted in the code outline would either have to shrink correspondingly, or else sufficient blank space would have to be added to the bottom in the code outline as well. Personally, I think the first option would be preferable.

bottom-of-file

nmatt avatar Jan 08 '16 21:01 nmatt

PS: The highlighting is inaccurate not just at the bottom, but throughout the file. The shorter the file, the more inaccurate it gets. Here is another example where the full code is visible in the editor window, but only part of it is highlighted in the code outline:

inaccuracy

nmatt avatar Jan 08 '16 22:01 nmatt

Thanks @nmatt: It depends somehow on the font-size. The font-size isn't taken in account.

I will have to dig deep in others code for that. So do not expect me to do this soon. The original code of BlueJ uses the font-size 1 IIRC, so the new font-size option from https://github.com/markiewb/nb-codeoutline/issues/20 may introduced this issue.

markiewb avatar Jan 10 '16 21:01 markiewb