-
Notifications
You must be signed in to change notification settings - Fork 709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Highlight EOL by highlighting to the end of the terminal #1909
Comments
Highlighting newlines as tabs are sounds better indeed. |
I think that might be very noisy, visually-speaking |
As you mention, I always have the white-space highlighter on, so the recent changes concerning EOL have been very smooth. I'll try to see what is the visual impact on xterm to get an idea. |
@occivink Yeah, I can definitely imagine people finding it noisy, but I feel the current system is too subtle, and I couldn't think of a good middle-ground. Maybe just highlighting the first n cells, or trying to fade out the selection colour... but those are all kind of arbitrary, where "just highlight the whole thing" feels more logical and consistent to me. |
I'm also concerned about the visual noise this proposal could cause. |
I am afraid it will really get noisy, and I am not sure that an end of line character conceptually continues up the the end of the terminal window. For tabs, their start and end position seem pretty clear, but for end of lines, I dont really think of them as something meaning "fill the rest of the line so that we end up on next line", just as something meaning "go to next line". Similarly, when a selection spans multiple lines, it does fill the full terminal lines, only the actual characters (including the eol one). It might be good to still try it, just to get a better idea of how it would look like. |
Just pushed a commit on branch |
Regardless of whether or not this behaviour reaches mainline Kakoune, thank you very much for trying it out! I just built from that branch and spent 30 seconds trying it out myself. Initial impressions:
I'll keep using it for a bit and see how I feel. |
My vote is also going against this proposal, but I also want to point out that the whole reason you came up with this idea is because you want to know if there are trailing whitespaces on the current line. First of all, I don't think there is any code that requires having trailing whitespaces, and for a long time I have my editors configured to automatically remove trailing whitespaces when a file is saved. I have never heard complaints when my PR cleaned up a few extra lines in a file that I modified, plus there usually an option to hide whitespace-only changes in the diff. Maybe kakoune should just always cleanup trailing whitespaces, and then the whole problem is gone (a more general discussion about trailing whitespaces is in #2175). Alternatively you could just add a highlighter for trailing whitespaces, and there will be no confusion where your cursor will move. It would have been cool to have an option in the built-in
|
@mawww I've found a bug in the change in that branch. |
When I started using Kakoune a few months ago, it allowed the user to move the cursor onto the
\n
at the end of a line, but did not display any glyph there. The only ways to tell if the cursor was on the newline or just a trailing whitespace were to enable the whitespace highlighter, to hitd
and see if the next line got joined, or (the most popular choice) to hitl
and see if nothing happened.Recently, Kakoune was changed so that
h
andl
would wrap to adjacent lines, messing with people's ability to see whether their cursor was on EOL or not. To counter this, Kakoune was modified so that when a cursor is on EOL, it would be displayed in thePrimaryCursorEol
/SecondaryCursorEol
face rather thanPrimaryCursor/SecondaryCursor
.I have some problems with this system:
SecondaryCursor
to be black-on-cyan so that I could identify the primary cursor even with a 1-char selection; now if that one character is\n
I'm back to my original problem again.Instead, I propose an alternative behaviour: As a general rule throughout Kakoune, whenever any character in the underlying buffer takes up more than one character-space on screen, all the relevant character-spaces should be highlighted when the cursor moves over them.
wrap -word
highlighter, and leading whitespace created by thewrap -indent
highlighter.Such a scheme should already be familiar to users of terminals like gnome-terminal, xterm, PuTTY and st, since their mouse selection already works this way. Even for people unfamiliar with those terminals, it should be obvious that when all the space from the end of one line to the beginning of the next is highlighted, pressing
d
will delete the space and join the lines together.The text was updated successfully, but these errors were encountered: