]> granicus.if.org Git - vim/commitdiff
patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off v8.1.1299
authorBram Moolenaar <Bram@vim.org>
Wed, 8 May 2019 18:20:46 +0000 (20:20 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 8 May 2019 18:20:46 +0000 (20:20 +0200)
Problem:    "extends" from 'listchars' is used when 'list' is off. (Hiroyuki
            Yoshinaga)
Solution:   Only use the "extends" character when 'list' is on. (Hirohito
            Higashi, closes #4360)

src/screen.c
src/testdir/test_listchars.vim
src/version.c

index eb81bee84afd191be1a550678af72e6773e5ec70..e56d2bc018b58468d5cdd549d78fd6fd1840acb2 100644 (file)
@@ -5594,8 +5594,10 @@ win_line(
            break;
        }
 
-       /* line continues beyond line end */
-       if (lcs_ext
+       // Show "extends" character from 'listchars' if beyond the line end and
+       // 'list' is set.
+       if (lcs_ext != NUL
+               && wp->w_p_list
                && !wp->w_p_wrap
 #ifdef FEAT_DIFF
                && filler_todo <= 0
index 3eef75d28935629e98f49848afe0fade13624823..5df50103962cf547ceb2189bbb455b9b3ae87c7c 100644 (file)
@@ -110,6 +110,25 @@ func Test_listchars()
   call cursor(1, 1)
   call assert_equal([expected], ScreenLines(1, virtcol('$')))
 
+  " test extends
+  normal ggdG
+  set listchars=extends:Z
+  set nowrap
+  set nolist
+  call append(0, [ repeat('A', &columns + 1) ])
+
+  let expected = repeat('A', &columns)
+
+  redraw!
+  call cursor(1, 1)
+  call assert_equal([expected], ScreenLines(1, &columns))
+
+  set list
+  let expected = expected[:-2] . 'Z'
+  redraw!
+  call cursor(1, 1)
+  call assert_equal([expected], ScreenLines(1, &columns))
+
   enew!
   set listchars& ff&
 endfunc
index 90f9e87bf9ae24e1c6e162c82c24f08dd773f51d..1ea47db720c0779b65e5c7e4720758a1b51ec4fe 100644 (file)
@@ -767,6 +767,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1299,
 /**/
     1298,
 /**/