This forum has been archived. All content is frozen. Please use KDE Discuss instead.

SUGGESTION: KATE to have a ruler

Tags: None
(comma "," separated)
yereverluvinunclebert
Registered Member
Posts
17
Karma
0

SUGGESTION: KATE to have a ruler

Sun Nov 27, 2016 3:30 pm
Kate currently has no ruler bar. It is a useful function to know the horizontal character position in the current line. Other advanced editors and word processing tools have this functionality by default for a long time.

I have made a mockup of the Kate Editor showing such a ruler bar just above the code window.

Image

https://bugs.kde.org/show_bug.cgi?id=372997
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS
Is the column display in the status bar for the cursor not sufficient? To me this seems more like a word processor feature, no? And in word processors, it displays centimers, not characters ...

Greetings,
Sven


I'm working on the KDevelop IDE.
yereverluvinunclebert
Registered Member
Posts
17
Karma
0

Re: SUGGESTION: KATE to have a ruler

Sun Nov 27, 2016 11:26 pm
It is a useful feature and I have had it in my past use of text and code editors. It is a visual tool much in the same way as the slider map is a visual enhancement.

It is a useful adjunct that could be switched on/off at will. Once you have grown used to with these sort of minor enhancements, it feels a retrograde step to have an editor without it. I don't see it as solely a word processor feature as it reports character position. Having mentioned word processing though, Kate is proposed as an advanced text editor so it is a valid argument that Kate should have some of the functions of a good word processor.

I always run Kate with the line number feature switched on and in combination with such a ruler, I could instantly find/report my position in the code as an x,y position. Yes, I think it would be very useful.

Whether it is a request that is worth the hours of programming is a moot point and down to the dev. team I suppose.

Try the context editor to see it in action: http://www.contexteditor.org/index.php
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS

Re: SUGGESTION: KATE to have a ruler

Wed Nov 30, 2016 11:14 pm
Orthogonal to whether it's useful or not, there are a few issues in principle:
- you can have non-fixed width fonts, I have seen people do that
- even with a fixed-width font, not each character has the same width, esp. tabs, but others as well.

For those reasons, I think it's unlikely to be implemented ... but feel free to report a wish of course.

Greetings,
Sven


I'm working on the KDevelop IDE.
yereverluvinunclebert
Registered Member
Posts
17
Karma
0
As that functionality already exists in the editors that I mentioned, and they cope instantly with a change of font, spacing &c then I know in principle that it could be done but also, because someone bothered to implement it already that others must find it intrinsically useful. Also, I find it useful for the purpose suggested.

All functions if taken by themselves are small and individually perhaps not of great importance but when you've grown used to a function, find it useful, then you'd like your potential choice for new editor to have it. I have raised it already, it is on my wish list.

In any case, so far, my only pet hate with regard to Kate is not the lack of a ruler but the rather painful search function, I will raise a point for that later when I am sure of my thoughts.

PS. That editor Context I believe is completely available as open source here:
https://code.google.com/archive/p/contexteditor/source/default/source

It is Delphi unfortunately but it might make it a little easier to start coding such changes.
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS

Re: SUGGESTION: KATE to have a ruler

Thu Dec 01, 2016 11:28 pm
yereverluvinunclebert wrote:As that functionality already exists in the editors that I mentioned, and they cope instantly with a change of font, spacing &c then I know in principle that it could be done but also, because someone bothered to implement it already that others must find it intrinsically useful. Also, I find it useful for the purpose suggested.

But what does the ruler display for a non-fixed-width font? A line containing ffffff will have its column 5 at a different place than one containing mmmmmm. Same goes for tabs.


I'm working on the KDevelop IDE.
yereverluvinunclebert
Registered Member
Posts
17
Karma
0

Re: SUGGESTION: KATE to have a ruler

Fri Dec 02, 2016 11:05 am
Do you tend to use non-fixed width fonts when using Kate? Isn't that more like Word Processing than text editing? My use for Kate is as a code editor and I presume that is very much the same for most. Would you use a non-fixed width font for editing? (I am merely asking).

I see that Kate allows for all fonts but having a look at the editors I have been using, they seem to use fixed length fonts such as courier new, fixedsys, MS gothic &c. An option to use solely fixed width fonts or only displaying the ruler on fixed width fonts would seem a suitable solution.

Personally I struggle to see why anyone would do code editing using anything other than a fixed width font. I've never even imagined it before.
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS
I don't do it, but I have seen people doing it (and not just newcomers who don't know better). But yes, turning it off for non-fixed-width fonts would be an option. You still have issues with e.g. tabs though.


I'm working on the KDevelop IDE.
airdrik
Registered Member
Posts
1854
Karma
5
OS
I'll raise my voice as one of the few experienced developers in this world of fixed-width fonts who insists on using proportional fonts for his code. Of course my tastes are definitely eccentric: Among the things I find distracting are the rectangular rigidness of fixed-width fonts, greyscale window/widget backgrounds and overly flat and/or rectangular themes. I appreciate (and sometimes spend a bit too much time trying to achieve) a higher level of style, taste, distinctiveness to the appearance of my working environment.

As for this case, I certainly have no objection to the addition of a ruler to Kate. I suppose it could be useful when using fixed-width fonts to help with visually aligning things. I wouldn't see it as a measure of how many characters are in the current line, but as a general measure to assist with alignment. Thus with lines that have tabs in it I would expect the ruler would not change, instead indicating that the tab is N (normal-width) characters wide. Similarly for other multi-character-wide characters


airdrik, proud to be a member of KDE forums since 2008-Dec.


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]