Bug 390870 - Display line numbers by default, or for files detected as source files
Summary: Display line numbers by default, or for files detected as source files
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: application (show other bugs)
Version: Git
Platform: Other Linux
: NOR wishlist (vote)
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2018-02-21 21:42 UTC by Nate Graham
Modified: 2018-08-14 21:08 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 18.12


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2018-02-21 21:42:31 UTC
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.
Comment 1 Nate Graham 2018-03-31 16:43:57 UTC
Or maybe we should just turn them on by default. Kate is an advanced, programmer-centric text editor, after all.
Comment 2 Nate Graham 2018-03-31 16:47:18 UTC
Submitted a patch: https://phabricator.kde.org/D11838
Comment 3 Dominik Haumann 2018-03-31 19:56:09 UTC
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? ;)
Comment 4 Nate Graham 2018-03-31 20:01:12 UTC
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.
Comment 5 Nate Graham 2018-03-31 20:06:03 UTC
Atom, too.
Comment 6 Michel Ludwig 2018-03-31 20:13:52 UTC
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?
Comment 7 Nate Graham 2018-03-31 20:53:46 UTC
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.
Comment 8 Michel Ludwig 2018-04-01 05:08:19 UTC
(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.
Comment 9 Nate Graham 2018-08-14 21:08:46 UTC
author	Christoph Cullmann <cullmann@kde.org>	2018-08-14 20:50:10 (GMT)
committer	Christoph Cullmann <cullmann@kde.org>	2018-08-14 20:52:24 (GMT)
commit	d7b19c5abffcfd99a6d9dc2c7e44cdc0a29f87e6 (patch)
tree	f06e431b0549c197a12727777f53003978b54701
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
Diffstat
-rw-r--r--	kate/main.cpp	24	
		
1 files changed, 16 insertions, 8 deletions