Bug 466492 - The line number sidebar moves when adding/removing lines who's line number contains extra digits
Summary: The line number sidebar moves when adding/removing lines who's line number co...
Status: RESOLVED NOT A BUG
Alias: None
Product: kate
Classification: Applications
Component: application (other bugs)
Version First Reported In: 22.12.2
Platform: openSUSE Linux
: NOR minor
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-26 22:32 UTC by Cars
Modified: 2023-02-27 04:41 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
lines 1-9 (74.69 KB, image/png)
2023-02-26 22:32 UTC, Cars
Details
line 10 moves (107.87 KB, image/png)
2023-02-26 22:33 UTC, Cars
Details
padding sizes (13.35 KB, image/png)
2023-02-26 22:47 UTC, Cars
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Cars 2023-02-26 22:32:31 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1.  Open a new document
2.  Write out 9 lines
3.  Move to the 10th line

OBSERVED RESULT
The sidebar moves to accommodate the extra digit in the 10's place

EXPECTED RESULT
The sidebar shouldn't move

Operating System: openSUSE Tumbleweed 20230225
KDE Plasma Version: 5.27.1
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8
Kernel Version: 6.1.12-1-default (64-bit)
Graphics Platform: Wayland
Comment 1 Cars 2023-02-26 22:32:59 UTC
Created attachment 156768 [details]
lines 1-9
Comment 2 Cars 2023-02-26 22:33:16 UTC
Created attachment 156769 [details]
line 10 moves
Comment 3 Christoph Cullmann 2023-02-26 22:34:34 UTC
I don't see what is should do otherwise. Cut the numbers?
Comment 4 Cars 2023-02-26 22:38:31 UTC
(In reply to Christoph Cullmann from comment #3)
> I don't see what is should do otherwise. Cut the numbers?

Could right justify the numbers and add enough padding by default for 3-4 digits? There's close to enough room for that many now
Comment 5 Waqar Ahmed 2023-02-26 22:42:08 UTC
> There's close to enough room for that many now

There isn't. The room you see is a separate column used by folding markers.

I think this is working as intended.
Comment 6 Cars 2023-02-26 22:47:28 UTC
Created attachment 156770 [details]
padding sizes
Comment 7 Cars 2023-02-26 22:50:39 UTC
(In reply to Waqar Ahmed from comment #5)
> > There's close to enough room for that many now
> 
> There isn't. The room you see is a separate column used by folding markers.
> 
> I think this is working as intended.

I just uploaded a new attachment to clarify what I meant. There's a bit of space represented by the blue line, obviously this is intentional to keep the line numbers visually separated from the document, but that column doesn't need much more space, represented by red, to accommodate more digits without jumping. Obviously, having a document with 10000s of lines will have enough digits to cause it to jump, but for 90% of cases, I think adding a few more digits of padding would be sufficient.
Comment 8 Christoph Cullmann 2023-02-26 22:52:09 UTC
That is no padding, that is the place for e.g. folding markers.
Comment 9 Waqar Ahmed 2023-02-27 04:41:45 UTC
> I think adding a few more digits of padding would be sufficient.

That won't happen. We will not occupy anymore space than needed. The extra space marked by blue is for the folding column, line numbers can't and won't use that space.

Sorry, there's nothing we can do here. I will close this now.