Skip to content

Commit a903472

Browse files
committed
patch 8.0.1604: paste test may fail if $DISPLAY is not set
Problem: Paste test may fail if $DISPLAY is not set. Solution: Add WorkingClipboard() and use it in the paste test.
1 parent f118d48 commit a903472

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

src/testdir/shared.vim

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,16 @@ func CanRunGui()
260260
return has('gui') && ($DISPLAY != "" || has('gui_running'))
261261
endfunc
262262

263+
func WorkingClipboard()
264+
if !has('clipboard')
265+
return 0
266+
endif
267+
if has('x11')
268+
return $DISPLAY != ""
269+
endif
270+
return 1
271+
endfunc
272+
263273
" Get line "lnum" as displayed on the screen.
264274
" Trailing white space is trimmed.
265275
func! Screenline(lnum)

src/testdir/test_paste.vim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ if has('gui_running')
66
endif
77
set term=xterm
88

9+
source shared.vim
10+
911
func Test_paste_normal_mode()
1012
new
1113
" In first column text is inserted
@@ -67,7 +69,7 @@ func Test_paste_insert_mode()
6769
endfunc
6870

6971
func Test_paste_clipboard()
70-
if !has('clipboard')
72+
if !WorkingClipboard()
7173
return
7274
endif
7375
let @+ = "nasty\<Esc>:!ls\<CR>command"

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,8 @@ static char *(features[]) =
766766

767767
static int included_patches[] =
768768
{ /* Add new patch number below this line */
769+
/**/
770+
1604,
769771
/**/
770772
1603,
771773
/**/

0 commit comments

Comments
 (0)