]> granicus.if.org Git - vim/commitdiff
patch 8.0.1604: paste test may fail if $DISPLAY is not set v8.0.1604
authorBram Moolenaar <Bram@vim.org>
Tue, 13 Mar 2018 14:43:46 +0000 (15:43 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 13 Mar 2018 14:43:46 +0000 (15:43 +0100)
Problem:    Paste test may fail if $DISPLAY is not set.
Solution:   Add WorkingClipboard() and use it in the paste test.

src/testdir/shared.vim
src/testdir/test_paste.vim
src/version.c

index 877c5f9d7039fc8e67168342906dd80f2e5844ba..d47a3553831f2397cf057525246aac3aa4335b4d 100644 (file)
@@ -260,6 +260,16 @@ func CanRunGui()
   return has('gui') && ($DISPLAY != "" || has('gui_running'))
 endfunc
 
+func WorkingClipboard()
+  if !has('clipboard')
+    return 0
+  endif
+  if has('x11')
+    return $DISPLAY != ""
+  endif
+  return 1
+endfunc
+
 " Get line "lnum" as displayed on the screen.
 " Trailing white space is trimmed.
 func! Screenline(lnum)
index 6450989ec01d85e4eb8c3dfe07eedac55cf3fc23..65f300cef02d58c43b4d08c6251f8a710ee911d0 100644 (file)
@@ -6,6 +6,8 @@ if has('gui_running')
 endif
 set term=xterm
 
+source shared.vim
+
 func Test_paste_normal_mode()
   new
   " In first column text is inserted
@@ -67,7 +69,7 @@ func Test_paste_insert_mode()
 endfunc
 
 func Test_paste_clipboard()
-  if !has('clipboard')
+  if !WorkingClipboard()
     return
   endif
   let @+ = "nasty\<Esc>:!ls\<CR>command"
index d1fd6ea5f9149e7438ae2d1169f09ff672da4d43..36e94b122879d3b6b05306a902787e1779b46d83 100644 (file)
@@ -766,6 +766,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1604,
 /**/
     1603,
 /**/