[RFC] KateRenderer: Show tabs and space characters the smart way
Needs ReviewPublic

Authored by loh.tar on Feb 23 2019, 3:11 PM.

Details

Reviewers
None
Group Reviewers
KTextEditor
Summary

The original bug says: Show tabs and space characters only on selection
but I thought this way is it more handy

  • Show them always in current line
  • Show them as requested in selected lines
  • Enhanced to show also non printable spaces

Questions:

  • Could it be the default, without the need for an option?
  • Ideas for naming?

BUG: 333446

Test Plan

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
loh.tar created this revision.Feb 23 2019, 3:11 PM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptFeb 23 2019, 3:11 PM
Restricted Application added subscribers: kde-frameworks-devel, kwrite-devel. · View Herald Transcript
loh.tar requested review of this revision.Feb 23 2019, 3:11 PM

I think this, since it removes visual clutter. I think this should be configurable...

Question is how to properly add an option in the config widget, since in the code I can see that this feature changes several options: tabs + trailing spaces + nonprintable chars.
One way would be to turn the checkable options into tri-state comboboxes: Show trailing spaces [Always, In Current Line and Selection, Never]

Pushing this further, it would maybe be interesting to "Show indentation lines" only for the current block.

PS: Better naming for foobar ? :-)

loh.tar updated this revision to Diff 56110.Apr 13 2019, 7:07 AM
  • Rebase on master to keep it compile
  • Not further investigated if changes by D19163 needs more tweeks here

PS: Better naming for foobar ? :-)

Yes :-)

I think this should be configurable...

ATM me too
Without more feedback, like "what a great feature" it has very low prio for me

meven edited the summary of this revision. (Show Details)Apr 13 2019, 8:29 AM

I think this feature is nice.
Given we already have now some enum for the show spaces stuff (None/Trailing/All) I would just vote to have some "Smart" 4th variant inside.
We can later tweak this "Smart" variant like we want it to behave, actually the "always show stuff on current line and for selections" doesn't sound that bad.

Given we already have now some enum for the show spaces stuff (None/Trailing/All) I would just vote to have some "Smart" 4th variant inside

Can do, but this combobox reads to me for true spaces only, no tabs. See also Dominiks comment https://phabricator.kde.org/D19254#418143
So, changing all bools to comboboxes?

Ah, you mean because of the "show tabs" extra option, yeah, forgot that :/
What would be the concrete content of the combobox then?

What would be the concrete content of the combobox then?

What? Which box? These box can became these 4th "Smart" option but the code should then only work on spaces....to be "correct/right".

How about one extra bool which covers all normaly hidden stuff to be shown the smart way? Guess much easier to implement.

At the moment we have one combobox "Whitespaces" and one checkbox "Highlight tabulators" in "Whitespace Highlighting".

I thought one wanted now to collapse/change that into 1-2 comboboxes ;=)

Perhaps it would be better to have some "Smart" vs. these two settings we have at the moment checkbox.

But I am no good ui designer ;=)

Perhaps Nate has some idea for that part.

I'm wondering if this really needs to be configurable, and if it really needs to exist as described here.

Maybe what would make more sense is to always show whitespace characters for the current/selected line even if the current option is off. Then when the global whitespace visibility option is turned on, whitespace characters are shown everywhere. This way we don't need to add a new option, and we enhance the functionality in a relatively unobtrusive way for people who don't have the global whitespace visibility toggle turned on.

Thoughts?