Patch 8.1.0865
Problem:    When 'listchars' only contains "nbsp:X" it does not work.
Solution:   Set extra_check when lcs_nbsp is set. (Ralf Schandl, closes #3889)
Files:      src/screen.c, src/testdir/test_listchars.vim


*** ../vim-8.1.0864/src/screen.c        2019-01-30 21:40:58.943219829 +0100
--- src/screen.c        2019-01-31 21:42:38.888191457 +0100
***************
*** 1164,1171 ****
            mod_bot = wp->w_redraw_bot + 1;
        else
            mod_bot = 0;
-       wp->w_redraw_top = 0;   /* reset for next time */
-       wp->w_redraw_bot = 0;
        if (buf->b_mod_set)
        {
            if (mod_top == 0 || mod_top > buf->b_mod_top)
--- 1164,1169 ----
***************
*** 1277,1282 ****
--- 1275,1282 ----
        if (mod_top != 0 && buf->b_mod_xlines != 0 && wp->w_p_nu)
            mod_bot = MAXLNUM;
      }
+     wp->w_redraw_top = 0;     // reset for next time
+     wp->w_redraw_bot = 0;
  
      /*
       * When only displaying the lines at the top, set top_end.  Used when
***************
*** 3498,3504 ****
  
      if (wp->w_p_list)
      {
!       if (lcs_space || lcs_trail)
            extra_check = TRUE;
        /* find start of trailing whitespace */
        if (lcs_trail)
--- 3498,3504 ----
  
      if (wp->w_p_list)
      {
!       if (lcs_space || lcs_trail || lcs_nbsp)
            extra_check = TRUE;
        /* find start of trailing whitespace */
        if (lcs_trail)
*** ../vim-8.1.0864/src/testdir/test_listchars.vim      2019-01-16 
22:41:50.095917784 +0100
--- src/testdir/test_listchars.vim      2019-01-31 21:56:14.185986054 +0100
***************
*** 90,95 ****
--- 90,115 ----
              \ '.....h>-$',
              \ 'iii<<<<><<$', '$'], l)
  
+ 
+   " test nbsp
+   normal ggdG
+   set listchars=nbsp:X,trail:Y
+   set list
+   " Non-breaking space
+   let nbsp = nr2char(0xa0)
+   call append(0, [ ">".nbsp."<" ])
+ 
+   let expected = '>X< '
+ 
+   redraw!
+   call cursor(1, 1)
+   call assert_equal([expected], ScreenLines(1, virtcol('$')))
+ 
+   set listchars=nbsp:X
+   redraw!
+   call cursor(1, 1)
+   call assert_equal([expected], ScreenLines(1, virtcol('$')))
+ 
    enew!
    set listchars& ff&
  endfunc
*** ../vim-8.1.0864/src/version.c       2019-01-31 18:26:05.742803481 +0100
--- src/version.c       2019-01-31 21:44:23.091510073 +0100
***************
*** 785,786 ****
--- 785,788 ----
  {   /* Add new patch number below this line */
+ /**/
+     865,
  /**/

-- 
Q: What's orange and sounds like a parrot?
A: A carrot

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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.

Raspunde prin e-mail lui