Created attachment 185563 [details] Screenshot showing the problem Full disclosure: this is a nitpick. In all code editors/IDEs I use (PyCharm, VSCode and Kate), line numbers in the code editor are aligned to the right. I also noticed that this is the case in various other code editors (Gedit, Sublime, etc). However, Basic IDE aligns numbers to the left (see attached screenshot comparing Basic IDE and Kate). When the code module gets to the hundreds or thousands of lines, then it looks weird to have left-aligned numbers. I believe we should align them to the right as other code editors do.
Notepad++ and Vim use line numbers at left (at least with English/French UI, I don't know for RTL UI), I find it fine. Perhaps there should be some config option for this? Of course, there would still be the pb of which side by default.
(In reply to Julien Nabet from comment #1) > Notepad++ and Vim use line numbers at left (at least with English/French UI, > I don't know for RTL UI), I find it fine. > > Perhaps there should be some config option for this? > Of course, there would still be the pb of which side by default. Basic IDE has 1 2 ... 9 10 11 12 etc PyCharm 1 2 ... 9 10 11 12 etc But there is some space to right from numbers in PyCharm anyway I don't think it's so much matter, btw
Created attachment 185576 [details] PyCharm line numbering
(In reply to Roman Kuznetsov from comment #2) > I don't think it's so much matter, btw Indeed it's not a very significant issue. It's more about aesthetics, which is subjective. The right alignment might be a better choice when code folding is implemented (see bug 146667). The folding symbol would always be the same distance from the line number if the numbers are aligned to the right. (In reply to Julien Nabet from comment #1) > Notepad++ and Vim use line numbers at left (at least with English/French UI, > I don't know for RTL UI), I find it fine. As far as I remember, Notepad++ aligns to the right as well. I no longer use it, but the screenshots I found online align line numbers to the right. See: https://static.techspot.com/images2/downloads/bigimage/2019/2019-06-03-image-p_1100.webp
(In reply to Roman Kuznetsov from comment #2) > (In reply to Julien Nabet from comment #1) ... > But there is some space to right from numbers in PyCharm anyway > > I don't think it's so much matter, btw Very sorry, I misinterpreted what you said, I thought the line number was on the right of the code for these IDEs. Forget my previous comment then.
Imho, valid enhancement. How should we treat them in the RTL mode?
(In reply to Andreas Heinisch from comment #6) > Imho, valid enhancement. How should we treat them in the RTL mode? +1, regarding RTL I think the number frame will be on the right but since numbers are left-oriented I think right-aligning makes sense. Eyal, what do you think? Fun-fact: starting the app with SAL_RTL_ENABLED=1 shows the number frame right hand with numbers right-aligned.
Well, things are kind of complicated. First there's the question of whether numbers should be on the right in the first place - seeing how the Basic _code_ is not RTL and not right-aligned. In fact, I'd probably say the line numbers should be to the left of the code - otherwise they're very far from the code, which is bad. Another option is placing line numbers on _both_ sides. About alignment of the numbers within their column - I'd say this depends on the number representation system of each written language. If the digit position corresponds to a power of 10, with highest-powers on the left (which is the case for all of English, Hebrew, Arabic - but perhaps not for all languages) - then right-aligning makes sense. Otherwise - depending on the specifics of the language.
(In reply to Eyal Rozenberg from comment #8) > Basic _code_ is not RTL and not right-aligned... Good point. Maybe worth another ticket / patch. > About alignment of the numbers within their column - I'd say this depends on > the number representation system of each written language. Okay, so let's have it always right-aligned, as requested.
(In reply to Eyal Rozenberg from comment #8) > First there's the question of whether numbers should be on the right in the > first place - seeing how the Basic _code_ is not RTL and not right-aligned. > In fact, I'd probably say the line numbers should be to the left of the code > - otherwise they're very far from the code, which is bad. Just to be clear, what I'm proposing is to leave the line numbers to the left of the code, but they'll be right-aligned inside the box where line numbers are displayed.
(In reply to Rafael Lima from comment #10) > Just to be clear, what I'm proposing is to leave the line numbers to the > left of the code, but they'll be right-aligned inside the box where line > numbers are displayed. I understand, I was opining about the more general question, not just the alignment, and I realize that's beyond the scope of this bug.
(In reply to Heiko Tietze from comment #9) > Good point. Maybe worth another ticket / patch. Filed bug 153853. > Okay, so let's have it always right-aligned, as requested. Are you sure we don't support languages which lay their numbers differently?
Andreas Heinisch committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/dbd96e1c9a066979cb80ced6268edb148a8fc73b tdf#153798 - Basic IDE: align line numbers to the right It will be available in 7.6.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Thanks Andreas, it's working perfectly!