This is a pretty minor thing, but I always find myself having to turn on line numbering for my source files. It's a chore.
Now, bor source files, you pretty much always want line numbers, but for non-source-files, they're unnecessary or even annoying. So it would be lovely if Kate could intelligently display line numbers when you open a file that it detects as a source file, perhaps based on its file extension and/or MIME type.
Or maybe we should just turn them on by default. Kate is an advanced, programmer-centric text editor, after all.
Submitted a patch: https://phabricator.kde.org/D11838
Displaying line numbers based on mimetype gets a -2 from me: the classification is by far too fuzzy to know when a user wants line numbers and when not. If fact, I can only see that such a behavior will certainly confuse users.
So if at all, change defaults.
What do other text editors do? ;)
As far as I can tell, other common advanced, programmer-centric text editors (notepad++, Sublime Text, Textmate) generally have line numbers on by default. That's what my patch does, in fact.
Guys, please don't forget that KatePart is also used in non-programmer centric editors like Kile ;)
I don't see an immediate benefit from having line numbers shown by default in Kile. Considering smaller laptop screens, I would actually turn them off.
If you want to change the default setting, can you please allow for it to be changed back to the current setting programmatically?
Kile is a pretty advanced piece of software for experts (everyone I know who uses LaTeX is a pretty advanced computer user who's used to text editors having line numbers), so I didn't think it would be a problem.
This just changes a default; it can be switched off manually or programmatically, by editing ~/.config/katepartrc.
(In reply to Nate Graham from comment #7)
> Kile is a pretty advanced piece of software for experts (everyone I know who
> uses LaTeX is a pretty advanced computer user who's used to text editors
> having line numbers), so I didn't think it would be a problem.
Just to clarify, Kile's user base includes computer scientists, mathematicians, physicists, and so on. Not every computer scientist is an advanced computer user, and the same is probably true for the latter two. And when I say "not advanced", I really mean it ;)
Of course, everyone could understand the concept of line numbers, but my point is that line numbers are not essential for the editing workflow in Kile. In fact, Kile tries to do everything to hide line numbers from the users, and it will do even more so in the future. So, turning them on by default would undermine those efforts. (To provide a little empirical evidence for that claim, there hasn't been a feature wish requesting that line numbers are turned on by default in Kile so far)
The screen on my (admittedly really old) laptop has a resolution of 1600x900 and line numbers consume too much space in Kile (especially in combination with code folding arrows), while not bringing an immediate benefit.
> This just changes a default; it can be switched off manually or
> programmatically, by editing ~/.config/katepartrc.
Now, editing configuration files by hand is really for advanced advanced users only ;)
I'm not sure whether there is a method in KTextEditor::View at the moment for toggling the display of line numbers. Moreover, a "constructor" argument for setting the default value of the show-line-numbers internal variable would also be needed. Otherwise, I will have to add such code to Kile, which checks whether the user changed that setting from the default value before turning line numbers off at the construction time of the KTextEditor::View. The logic behind the show-line-numbers setting would then be moved into Kile essentially.
author Christoph Cullmann <firstname.lastname@example.org> 2018-08-14 20:50:10 (GMT)
committer Christoph Cullmann <email@example.com> 2018-08-14 20:52:24 (GMT)
commit d7b19c5abffcfd99a6d9dc2c7e44cdc0a29f87e6 (patch)
parent ada3f3239df3f8a835526c13aad4ddc76f3390cb (diff)
turn on line numbers and line modifications per default for KateHEADmaster
CHANGELOG: line numbers and line modifications per default on for Kate
Differential Revision: https://phabricator.kde.org/D11838
-rw-r--r-- kate/main.cpp 24
1 files changed, 16 insertions, 8 deletions