El lunes, 27 de agosto de 2012 05:59:48 UTC-5, 柳永峰 escribió:
> hi thanks,it's very useful to me
>
> On Wednesday, October 21, 2009 10:26:10 PM UTC+8, Arkanosis wrote:
>
> > Hello,
>
> >
>
> > I've just started to use Vim, and missed the possibility to display
>
> > middle-dots (or any other visible character) instead of spaces, so I
>
> > made the following patch.
>
> > It adds "space" in the allowed "listchars" arguments.
>
> >
>
> > Just in case someone find this useful ; I found easier to patch Vim
>
> > than to look for another existing solution ;-)
>
> >
>
> > Best regards,
>
> >
>
> > Index: option.c
>
> > ===================================================================
>
> > --- option.c (revision 1626)
>
> > +++ option.c (working copy)
>
> > @@ -6847,6 +6847,7 @@
>
> > {&lcs_ext, "extends"},
>
> > {&lcs_nbsp, "nbsp"},
>
> > {&lcs_prec, "precedes"},
>
> > + {&lcs_space, "space"},
>
> > {&lcs_tab2, "tab"},
>
> > {&lcs_trail, "trail"},
>
> > };
>
> > Index: screen.c
>
> > ===================================================================
>
> > --- screen.c (revision 1626)
>
> > +++ screen.c (working copy)
>
> > @@ -3886,6 +3886,18 @@
>
> > #endif
>
> > }
>
> >
>
> > + /* 'list' : change space to lcs_space. */
>
> > + if (wp->w_p_list && c == ' ' && lcs_space)
>
> > + {
>
> > + c = lcs_space;
>
> > + if (area_attr == 0 && search_attr == 0)
>
> > + {
>
> > + n_attr = 1;
>
> > + extra_attr = hl_attr(HLF_8);
>
> > + saved_attr2 = char_attr; /* save current attr */
>
> > + }
>
> > + }
>
> > +
>
> > if (extra_check)
>
> > {
>
> > #ifdef FEAT_SPELL
>
> > @@ -4040,7 +4052,7 @@
>
> > }
>
> > #endif
>
> >
>
> > - if (trailcol != MAXCOL && ptr > line + trailcol && c == ' ')
>
> > + if (trailcol != MAXCOL && ptr > line + trailcol && (c == ' ' ||
> > c
>
> > == lcs_space))
>
> > {
>
> > c = lcs_trail;
>
> > if (!attr_pri)
>
> > Index: globals.h
>
> > ===================================================================
>
> > --- globals.h (revision 1626)
>
> > +++ globals.h (working copy)
>
> > @@ -1146,6 +1146,7 @@
>
> > EXTERN int lcs_tab1 INIT(= NUL);
>
> > EXTERN int lcs_tab2 INIT(= NUL);
>
> > EXTERN int lcs_trail INIT(= NUL);
>
> > +EXTERN int lcs_space INIT(= NUL);
>
> >
>
> > #if defined(FEAT_WINDOWS) || defined(FEAT_WILDMENU) ||
> > defined(FEAT_STL_OPT) \
>
> > || defined(FEAT_FOLDING)
>
> >
>
> > --
>
> > Jérémie Roquet - Arkanosis
>
> > Programming artist
>
> > Developer in natural language processing - Exalead
That would be very useful for me!
I'm developing a plaint text file now and was very excited while reading how
listchars works specially the trail option. However almost immediately I find
myself googling the way to convert middle-dots... until I found this thread.
So, really, I can see real benefits from having this, besides looking the patch
it seems not so difficult to merge or maintain... ( Things are easier to do if
you don't have to do them yourself ;) )
If you ever consider the possibility of including this count me on to test it.
J.
--
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