1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0865
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------
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 -- Bram@Moolenaar.net -- 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 ///
|