D27285: Add left/right indent fill (as opposed to left-only), extend indent lines to broken lines
noreply at phabricator.kde.org
Thu Feb 13 08:59:29 GMT 2020
eudoxos added a comment.
> No offense meant, but even with the screenshots I still have no idea what this is about :)
Good point, I somehow missed to explain the rationale for the change. :) If you are familiar with vim, this would be the `breakindent` and `breakindentopt` settings (that was my patch from 2007 which did not make it into vim until a few years back).
> Can you add a before/after screenshot so we can see the visual difference?
I will use this example from std::sort documentation <https://en.cppreference.com/w/cpp/algorithm/sort> which is not the most convoluted code (those changes are the most useful for deeply nested code).
This is the original rendering (with narrow window to make the point) and D27238 <https://phabricator.kde.org/D27238> applied (breaking line anywhere rather than at whitespace-only):
F8100695: image.png <https://phabricator.kde.org/F8100695>
Note how indentation blocks, manifest from empty space left, and also vertical indentation lines, are visually damaged by the dynamic wrap fill (I call this left fill, it is left of the indentation level). Dynamic wrap is something related to presentation only, not to overall code logic (indentation), and is line-local; so the option to enable/disable this fill is to make it possible to remove this globally-prominent visual cue about something very much local. This is without the left fill (note how indentation lines now also extend vertically):
F8100700: image.png <https://phabricator.kde.org/F8100700>
Now, the line being wrapped does have some importance and it should be shown somewhere. It is shown already by the arrow in the left margin, but that is way too far from the break, even left from folding markers (global logic) (I understand the wrap markers are there probably from the age when dynamic wrapping did not respect indentation and it was a sin to write code beyond col 80 ;) ).
So the "right fill" is **right** of the indentation level on subsequent visual lines and gives visual cue about the line being wrapped; like this (2 characters wide, that is adjustable):
F8100703: image.png <https://phabricator.kde.org/F8100703>
Of course, there are many options how to mark the break where it occurs, this one was just the easiest one. Onec can clutter configuration more and think of options like moving the arrow in the left margin to the line beginning, like this (this is just GIMP, not in the code)
F8100706: image.png <https://phabricator.kde.org/F8100706>
but I think it is better to start with something relatively simple.
It is possible to enable both left and right fill (not sure why anybody would want that, but I was not sure even for the original (left) fill):
F8100716: image.png <https://phabricator.kde.org/F8100716>
> Also, the "fill left" and "fill right" wording is new, and not intuitively understandable for me.
That is a new "terminology" I am free to adjust. Left is simply left of indentation level, right is on the right.
Hope this explains somewhat.
To: eudoxos, #vdg
Cc: dhaumann, kwrite-devel, kde-frameworks-devel, rrosch, LeGast00n, cblack, GB_2, domson, michaelh, ngraham, bruns, demsking, cullmann, sars
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the KWrite-Devel