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

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui