patch 8.1.1307: cannot reconnect to the X server after it restarted
Problem: Cannot reconnect to the X server after it restarted.
Solution: Add the :xrestore command. (Adrian Kocis, closes #844)
diff --git a/src/testdir/test_paste.vim b/src/testdir/test_paste.vim
index f3664f6..29206b94 100644
--- a/src/testdir/test_paste.vim
+++ b/src/testdir/test_paste.vim
@@ -110,3 +110,29 @@
bwipe!
endfunc
+
+func CheckCopyPaste()
+ call setline(1, ['copy this', ''])
+ normal 1G0"*y$
+ normal j"*p
+ call assert_equal('copy this', getline(2))
+endfunc
+
+func Test_xrestore()
+ if !has('xterm_clipboard')
+ return
+ endif
+call ch_logfile('logfile', 'w')
+ let display = $DISPLAY
+ new
+ call CheckCopyPaste()
+
+ xrestore
+ call CheckCopyPaste()
+
+ exe "xrestore " .. display
+ call CheckCopyPaste()
+
+call ch_logfile('', '')
+ bwipe!
+endfunc