W dniu środa, 22 kwietnia 2015 22:25:19 UTC+2 użytkownik Christian Brabandt
napisał:
> Hi mgaleski!
>
> On Mi, 22 Apr 2015, [email protected] wrote:
>
> > Hello,
> >
> > If wrap is set and text on line ends just on columns size (for example 80),
> > then VIM will display empty EOL below the line.
> >
> > Example:
> > :set listchars=eol:$
> > :set list
> > :set columns=80
> > 80ia<ESC>
> >
> > When you disable EOL completely you can't visually select empty lines.
> > Maybe there should be an additional listchar for just an empty line?
> >
> > Example:
> > :set listchars=
> > :set list
> > :new
> > 5o<ESC>
> > vgg
> >
> > Can't see the visual selection on the empty lines (to be fair Windows
> > Notepad and many other editors do the same).
> >
> > This issue can somewhat circumvented with the use of linebreak, but it's
> > not always the best solution.
>
> So only the second part is a problem that needs to be fixed, right?
>
> Something like this?
>
> diff --git a/src/screen.c b/src/screen.c
> --- a/src/screen.c
> +++ b/src/screen.c
> @@ -4703,7 +4703,7 @@ win_line(wp, lnum, startrow, endrow, noc
> }
> }
> else if (c == NUL
> - && ((wp->w_p_list && lcs_eol > 0)
> + && (wp->w_p_list
> || ((fromcol >= 0 || fromcol_prev >= 0)
> && tocol > vcol
> && VIsual_mode != Ctrl_V
> @@ -4749,7 +4749,7 @@ win_line(wp, lnum, startrow, endrow, noc
> c_extra = NUL;
> }
> }
> - if (wp->w_p_list)
> + if (wp->w_p_list && lcs_eol > 0)
> c = lcs_eol;
> else
> c = ' ';
>
>
> Best,
> Christian
> --
> Letzte Worte eines Baustatikers:
> "Ich glaube da habe ich mich irgendwo verrechnet."
It seems that in your patch there is a ")" missing on line 4718 in screen.c:
&& lcs_eol_one >= 0))
I can already see that it applies NonText highlight group (not Normal) for
whatever reason on those empty lines and eols.
It also changes the behavior to more resemble nolist, so I'm not quite sure if
this is it. If I set listchars to empty value, then no eols should be shown.
But regardless of any settings, VIM operates as if empty lines are normal chars
(you can dd, or whatever), for this it makes sense to be able to select them
visually.
I find the way EMACS with evil does visual line selection makes more sense, if
you select EOL then the whole line width gets selected (highlighted). This
makes easy to select empty lines and doesn't make bogus empty lines when
wrapping long lines.
I've attached a screenshot with some ideas. Read from left to right:
1) Your patch (with set listchars= and columns=40 and showbreak)
2) One idea how it could look
3) This one is inspired by how EMACS with evil does line highlight.
The third option makes a lot of sense, because it distinguishes between line
being selected wholly with EOL (it can be clearly seen) and you can also tell
at a glance if a visual selection ends on empty line and which one. It's hard
to explain that issue, I hope the photo makes it clearer.
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.