annotate src/testdir/test_paste.vim @ 17049:f38fcbf343ce v8.1.1524

patch 8.1.1524: tests are silently skipped commit https://github.com/vim/vim/commit/b0f94c1ff34d27d33aa9f96204985ea29c2eb0a1 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jun 13 22:19:53 2019 +0200 patch 8.1.1524: tests are silently skipped Problem: Tests are silently skipped. Solution: Throw an exception for skipped tests in more places.
author Bram Moolenaar <Bram@vim.org>
date Thu, 13 Jun 2019 22:30:07 +0200
parents 0422b14bce58
children 8e9e9124c7a2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13425
bb789ed5113a patch 8.0.1587: inserting from the clipboard doesn't work literally
Christian Brabandt <cb@256bit.org>
parents: 10827
diff changeset
1 " Tests for bracketed paste and other forms of pasting.
10682
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
16074
fa133cd14f87 patch 8.1.1042: the paste test doesn't work properly in the Windows console
Bram Moolenaar <Bram@vim.org>
parents: 13460
diff changeset
3 " Bracketed paste only works with "xterm". Not in GUI or Windows console.
17049
f38fcbf343ce patch 8.1.1524: tests are silently skipped
Bram Moolenaar <Bram@vim.org>
parents: 16608
diff changeset
4 if has('win32')
f38fcbf343ce patch 8.1.1524: tests are silently skipped
Bram Moolenaar <Bram@vim.org>
parents: 16608
diff changeset
5 throw 'Skipped, does not work on MS-Windows'
f38fcbf343ce patch 8.1.1524: tests are silently skipped
Bram Moolenaar <Bram@vim.org>
parents: 16608
diff changeset
6 endif
f38fcbf343ce patch 8.1.1524: tests are silently skipped
Bram Moolenaar <Bram@vim.org>
parents: 16608
diff changeset
7 if has('gui_running')
f38fcbf343ce patch 8.1.1524: tests are silently skipped
Bram Moolenaar <Bram@vim.org>
parents: 16608
diff changeset
8 throw 'Skipped, does not work in the GUI'
10686
23ada4caa13b patch 8.0.0233: paste test fails in the GUI
Christian Brabandt <cb@256bit.org>
parents: 10682
diff changeset
9 endif
10682
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 set term=xterm
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11
13460
aa6ecb272236 patch 8.0.1604: paste test may fail if $DISPLAY is not set
Christian Brabandt <cb@256bit.org>
parents: 13425
diff changeset
12 source shared.vim
aa6ecb272236 patch 8.0.1604: paste test may fail if $DISPLAY is not set
Christian Brabandt <cb@256bit.org>
parents: 13425
diff changeset
13
10682
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 func Test_paste_normal_mode()
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 new
10813
09eb5fd275e0 patch 8.0.0296: bracketed paste can only append, not insert
Christian Brabandt <cb@256bit.org>
parents: 10696
diff changeset
16 " In first column text is inserted
10682
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 call setline(1, ['a', 'b', 'c'])
10813
09eb5fd275e0 patch 8.0.0296: bracketed paste can only append, not insert
Christian Brabandt <cb@256bit.org>
parents: 10696
diff changeset
18 call cursor(2, 1)
10682
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 call feedkeys("\<Esc>[200~foo\<CR>bar\<Esc>[201~", 'xt')
10813
09eb5fd275e0 patch 8.0.0296: bracketed paste can only append, not insert
Christian Brabandt <cb@256bit.org>
parents: 10696
diff changeset
20 call assert_equal('foo', getline(2))
09eb5fd275e0 patch 8.0.0296: bracketed paste can only append, not insert
Christian Brabandt <cb@256bit.org>
parents: 10696
diff changeset
21 call assert_equal('barb', getline(3))
09eb5fd275e0 patch 8.0.0296: bracketed paste can only append, not insert
Christian Brabandt <cb@256bit.org>
parents: 10696
diff changeset
22 call assert_equal('c', getline(4))
09eb5fd275e0 patch 8.0.0296: bracketed paste can only append, not insert
Christian Brabandt <cb@256bit.org>
parents: 10696
diff changeset
23
09eb5fd275e0 patch 8.0.0296: bracketed paste can only append, not insert
Christian Brabandt <cb@256bit.org>
parents: 10696
diff changeset
24 " When repeating text is appended
09eb5fd275e0 patch 8.0.0296: bracketed paste can only append, not insert
Christian Brabandt <cb@256bit.org>
parents: 10696
diff changeset
25 normal .
09eb5fd275e0 patch 8.0.0296: bracketed paste can only append, not insert
Christian Brabandt <cb@256bit.org>
parents: 10696
diff changeset
26 call assert_equal('barfoo', getline(3))
09eb5fd275e0 patch 8.0.0296: bracketed paste can only append, not insert
Christian Brabandt <cb@256bit.org>
parents: 10696
diff changeset
27 call assert_equal('barb', getline(4))
09eb5fd275e0 patch 8.0.0296: bracketed paste can only append, not insert
Christian Brabandt <cb@256bit.org>
parents: 10696
diff changeset
28 call assert_equal('c', getline(5))
09eb5fd275e0 patch 8.0.0296: bracketed paste can only append, not insert
Christian Brabandt <cb@256bit.org>
parents: 10696
diff changeset
29 bwipe!
09eb5fd275e0 patch 8.0.0296: bracketed paste can only append, not insert
Christian Brabandt <cb@256bit.org>
parents: 10696
diff changeset
30
09eb5fd275e0 patch 8.0.0296: bracketed paste can only append, not insert
Christian Brabandt <cb@256bit.org>
parents: 10696
diff changeset
31 " In second column text is appended
09eb5fd275e0 patch 8.0.0296: bracketed paste can only append, not insert
Christian Brabandt <cb@256bit.org>
parents: 10696
diff changeset
32 call setline(1, ['a', 'bbb', 'c'])
09eb5fd275e0 patch 8.0.0296: bracketed paste can only append, not insert
Christian Brabandt <cb@256bit.org>
parents: 10696
diff changeset
33 call cursor(2, 2)
09eb5fd275e0 patch 8.0.0296: bracketed paste can only append, not insert
Christian Brabandt <cb@256bit.org>
parents: 10696
diff changeset
34 call feedkeys("\<Esc>[200~foo\<CR>bar\<Esc>[201~", 'xt')
09eb5fd275e0 patch 8.0.0296: bracketed paste can only append, not insert
Christian Brabandt <cb@256bit.org>
parents: 10696
diff changeset
35 call assert_equal('bbfoo', getline(2))
09eb5fd275e0 patch 8.0.0296: bracketed paste can only append, not insert
Christian Brabandt <cb@256bit.org>
parents: 10696
diff changeset
36 call assert_equal('barb', getline(3))
09eb5fd275e0 patch 8.0.0296: bracketed paste can only append, not insert
Christian Brabandt <cb@256bit.org>
parents: 10696
diff changeset
37 call assert_equal('c', getline(4))
09eb5fd275e0 patch 8.0.0296: bracketed paste can only append, not insert
Christian Brabandt <cb@256bit.org>
parents: 10696
diff changeset
38
09eb5fd275e0 patch 8.0.0296: bracketed paste can only append, not insert
Christian Brabandt <cb@256bit.org>
parents: 10696
diff changeset
39 " In last column text is appended
09eb5fd275e0 patch 8.0.0296: bracketed paste can only append, not insert
Christian Brabandt <cb@256bit.org>
parents: 10696
diff changeset
40 call setline(1, ['a', 'bbb', 'c'])
09eb5fd275e0 patch 8.0.0296: bracketed paste can only append, not insert
Christian Brabandt <cb@256bit.org>
parents: 10696
diff changeset
41 call cursor(2, 3)
09eb5fd275e0 patch 8.0.0296: bracketed paste can only append, not insert
Christian Brabandt <cb@256bit.org>
parents: 10696
diff changeset
42 call feedkeys("\<Esc>[200~foo\<CR>bar\<Esc>[201~", 'xt')
09eb5fd275e0 patch 8.0.0296: bracketed paste can only append, not insert
Christian Brabandt <cb@256bit.org>
parents: 10696
diff changeset
43 call assert_equal('bbbfoo', getline(2))
10682
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
44 call assert_equal('bar', getline(3))
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
45 call assert_equal('c', getline(4))
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
46 endfunc
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
47
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
48 func Test_paste_insert_mode()
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
49 new
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
50 call setline(1, ['a', 'b', 'c'])
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
51 2
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
52 call feedkeys("i\<Esc>[200~foo\<CR>bar\<Esc>[201~ done\<Esc>", 'xt')
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
53 call assert_equal('foo', getline(2))
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
54 call assert_equal('bar doneb', getline(3))
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
55 call assert_equal('c', getline(4))
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
56
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
57 normal .
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
58 call assert_equal('bar donfoo', getline(3))
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
59 call assert_equal('bar doneeb', getline(4))
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
60 call assert_equal('c', getline(5))
10696
689e88afdd11 patch 8.0.0238: bracketed paste does not disable autoindent
Christian Brabandt <cb@256bit.org>
parents: 10686
diff changeset
61
689e88afdd11 patch 8.0.0238: bracketed paste does not disable autoindent
Christian Brabandt <cb@256bit.org>
parents: 10686
diff changeset
62 set ai et tw=10
689e88afdd11 patch 8.0.0238: bracketed paste does not disable autoindent
Christian Brabandt <cb@256bit.org>
parents: 10686
diff changeset
63 call setline(1, ['a', ' b', 'c'])
689e88afdd11 patch 8.0.0238: bracketed paste does not disable autoindent
Christian Brabandt <cb@256bit.org>
parents: 10686
diff changeset
64 2
689e88afdd11 patch 8.0.0238: bracketed paste does not disable autoindent
Christian Brabandt <cb@256bit.org>
parents: 10686
diff changeset
65 call feedkeys("A\<Esc>[200~foo\<CR> bar bar bar\<Esc>[201~\<Esc>", 'xt')
689e88afdd11 patch 8.0.0238: bracketed paste does not disable autoindent
Christian Brabandt <cb@256bit.org>
parents: 10686
diff changeset
66 call assert_equal(' bfoo', getline(2))
689e88afdd11 patch 8.0.0238: bracketed paste does not disable autoindent
Christian Brabandt <cb@256bit.org>
parents: 10686
diff changeset
67 call assert_equal(' bar bar bar', getline(3))
689e88afdd11 patch 8.0.0238: bracketed paste does not disable autoindent
Christian Brabandt <cb@256bit.org>
parents: 10686
diff changeset
68 call assert_equal('c', getline(4))
689e88afdd11 patch 8.0.0238: bracketed paste does not disable autoindent
Christian Brabandt <cb@256bit.org>
parents: 10686
diff changeset
69
689e88afdd11 patch 8.0.0238: bracketed paste does not disable autoindent
Christian Brabandt <cb@256bit.org>
parents: 10686
diff changeset
70 set ai& et& tw=0
10682
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
71 bwipe!
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
72 endfunc
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
73
13425
bb789ed5113a patch 8.0.1587: inserting from the clipboard doesn't work literally
Christian Brabandt <cb@256bit.org>
parents: 10827
diff changeset
74 func Test_paste_clipboard()
13460
aa6ecb272236 patch 8.0.1604: paste test may fail if $DISPLAY is not set
Christian Brabandt <cb@256bit.org>
parents: 13425
diff changeset
75 if !WorkingClipboard()
13425
bb789ed5113a patch 8.0.1587: inserting from the clipboard doesn't work literally
Christian Brabandt <cb@256bit.org>
parents: 10827
diff changeset
76 return
bb789ed5113a patch 8.0.1587: inserting from the clipboard doesn't work literally
Christian Brabandt <cb@256bit.org>
parents: 10827
diff changeset
77 endif
bb789ed5113a patch 8.0.1587: inserting from the clipboard doesn't work literally
Christian Brabandt <cb@256bit.org>
parents: 10827
diff changeset
78 let @+ = "nasty\<Esc>:!ls\<CR>command"
bb789ed5113a patch 8.0.1587: inserting from the clipboard doesn't work literally
Christian Brabandt <cb@256bit.org>
parents: 10827
diff changeset
79 new
bb789ed5113a patch 8.0.1587: inserting from the clipboard doesn't work literally
Christian Brabandt <cb@256bit.org>
parents: 10827
diff changeset
80 exe "normal i\<C-R>+\<Esc>"
bb789ed5113a patch 8.0.1587: inserting from the clipboard doesn't work literally
Christian Brabandt <cb@256bit.org>
parents: 10827
diff changeset
81 call assert_equal("nasty\<Esc>:!ls\<CR>command", getline(1))
bb789ed5113a patch 8.0.1587: inserting from the clipboard doesn't work literally
Christian Brabandt <cb@256bit.org>
parents: 10827
diff changeset
82 bwipe!
bb789ed5113a patch 8.0.1587: inserting from the clipboard doesn't work literally
Christian Brabandt <cb@256bit.org>
parents: 10827
diff changeset
83 endfunc
bb789ed5113a patch 8.0.1587: inserting from the clipboard doesn't work literally
Christian Brabandt <cb@256bit.org>
parents: 10827
diff changeset
84
10682
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
85 func Test_paste_cmdline()
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
86 call feedkeys(":a\<Esc>[200~foo\<CR>bar\<Esc>[201~b\<Home>\"\<CR>", 'xt')
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
87 call assert_equal("\"afoo\<CR>barb", getreg(':'))
d564e73ff9ee patch 8.0.0231: bracketed paste mode is not tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
88 endfunc
10827
e366b968bf08 patch 8.0.0303: bracketed paste does not work in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10813
diff changeset
89
e366b968bf08 patch 8.0.0303: bracketed paste does not work in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10813
diff changeset
90 func Test_paste_visual_mode()
e366b968bf08 patch 8.0.0303: bracketed paste does not work in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10813
diff changeset
91 new
e366b968bf08 patch 8.0.0303: bracketed paste does not work in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10813
diff changeset
92 call setline(1, 'here are some words')
e366b968bf08 patch 8.0.0303: bracketed paste does not work in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10813
diff changeset
93 call feedkeys("0fsve\<Esc>[200~more\<Esc>[201~", 'xt')
e366b968bf08 patch 8.0.0303: bracketed paste does not work in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10813
diff changeset
94 call assert_equal('here are more words', getline(1))
e366b968bf08 patch 8.0.0303: bracketed paste does not work in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10813
diff changeset
95 call assert_equal('some', getreg('-'))
e366b968bf08 patch 8.0.0303: bracketed paste does not work in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10813
diff changeset
96
e366b968bf08 patch 8.0.0303: bracketed paste does not work in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10813
diff changeset
97 " include last char in the line
e366b968bf08 patch 8.0.0303: bracketed paste does not work in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10813
diff changeset
98 call feedkeys("0fwve\<Esc>[200~noises\<Esc>[201~", 'xt')
e366b968bf08 patch 8.0.0303: bracketed paste does not work in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10813
diff changeset
99 call assert_equal('here are more noises', getline(1))
e366b968bf08 patch 8.0.0303: bracketed paste does not work in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10813
diff changeset
100 call assert_equal('words', getreg('-'))
e366b968bf08 patch 8.0.0303: bracketed paste does not work in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10813
diff changeset
101
e366b968bf08 patch 8.0.0303: bracketed paste does not work in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10813
diff changeset
102 " exclude last char in the line
e366b968bf08 patch 8.0.0303: bracketed paste does not work in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10813
diff changeset
103 call setline(1, 'some words!')
e366b968bf08 patch 8.0.0303: bracketed paste does not work in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10813
diff changeset
104 call feedkeys("0fwve\<Esc>[200~noises\<Esc>[201~", 'xt')
e366b968bf08 patch 8.0.0303: bracketed paste does not work in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10813
diff changeset
105 call assert_equal('some noises!', getline(1))
e366b968bf08 patch 8.0.0303: bracketed paste does not work in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10813
diff changeset
106 call assert_equal('words', getreg('-'))
e366b968bf08 patch 8.0.0303: bracketed paste does not work in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10813
diff changeset
107
e366b968bf08 patch 8.0.0303: bracketed paste does not work in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10813
diff changeset
108 " multi-line selection
e366b968bf08 patch 8.0.0303: bracketed paste does not work in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10813
diff changeset
109 call setline(1, ['some words', 'and more'])
e366b968bf08 patch 8.0.0303: bracketed paste does not work in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10813
diff changeset
110 call feedkeys("0fwvj0fd\<Esc>[200~letters\<Esc>[201~", 'xt')
e366b968bf08 patch 8.0.0303: bracketed paste does not work in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10813
diff changeset
111 call assert_equal('some letters more', getline(1))
e366b968bf08 patch 8.0.0303: bracketed paste does not work in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10813
diff changeset
112 call assert_equal("words\nand", getreg('1'))
e366b968bf08 patch 8.0.0303: bracketed paste does not work in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10813
diff changeset
113
e366b968bf08 patch 8.0.0303: bracketed paste does not work in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10813
diff changeset
114 bwipe!
e366b968bf08 patch 8.0.0303: bracketed paste does not work in Visual mode
Christian Brabandt <cb@256bit.org>
parents: 10813
diff changeset
115 endfunc
16608
0422b14bce58 patch 8.1.1307: cannot reconnect to the X server after it restarted
Bram Moolenaar <Bram@vim.org>
parents: 16074
diff changeset
116
0422b14bce58 patch 8.1.1307: cannot reconnect to the X server after it restarted
Bram Moolenaar <Bram@vim.org>
parents: 16074
diff changeset
117 func CheckCopyPaste()
0422b14bce58 patch 8.1.1307: cannot reconnect to the X server after it restarted
Bram Moolenaar <Bram@vim.org>
parents: 16074
diff changeset
118 call setline(1, ['copy this', ''])
0422b14bce58 patch 8.1.1307: cannot reconnect to the X server after it restarted
Bram Moolenaar <Bram@vim.org>
parents: 16074
diff changeset
119 normal 1G0"*y$
0422b14bce58 patch 8.1.1307: cannot reconnect to the X server after it restarted
Bram Moolenaar <Bram@vim.org>
parents: 16074
diff changeset
120 normal j"*p
0422b14bce58 patch 8.1.1307: cannot reconnect to the X server after it restarted
Bram Moolenaar <Bram@vim.org>
parents: 16074
diff changeset
121 call assert_equal('copy this', getline(2))
0422b14bce58 patch 8.1.1307: cannot reconnect to the X server after it restarted
Bram Moolenaar <Bram@vim.org>
parents: 16074
diff changeset
122 endfunc
0422b14bce58 patch 8.1.1307: cannot reconnect to the X server after it restarted
Bram Moolenaar <Bram@vim.org>
parents: 16074
diff changeset
123
0422b14bce58 patch 8.1.1307: cannot reconnect to the X server after it restarted
Bram Moolenaar <Bram@vim.org>
parents: 16074
diff changeset
124 func Test_xrestore()
0422b14bce58 patch 8.1.1307: cannot reconnect to the X server after it restarted
Bram Moolenaar <Bram@vim.org>
parents: 16074
diff changeset
125 if !has('xterm_clipboard')
0422b14bce58 patch 8.1.1307: cannot reconnect to the X server after it restarted
Bram Moolenaar <Bram@vim.org>
parents: 16074
diff changeset
126 return
0422b14bce58 patch 8.1.1307: cannot reconnect to the X server after it restarted
Bram Moolenaar <Bram@vim.org>
parents: 16074
diff changeset
127 endif
0422b14bce58 patch 8.1.1307: cannot reconnect to the X server after it restarted
Bram Moolenaar <Bram@vim.org>
parents: 16074
diff changeset
128 let display = $DISPLAY
0422b14bce58 patch 8.1.1307: cannot reconnect to the X server after it restarted
Bram Moolenaar <Bram@vim.org>
parents: 16074
diff changeset
129 new
0422b14bce58 patch 8.1.1307: cannot reconnect to the X server after it restarted
Bram Moolenaar <Bram@vim.org>
parents: 16074
diff changeset
130 call CheckCopyPaste()
0422b14bce58 patch 8.1.1307: cannot reconnect to the X server after it restarted
Bram Moolenaar <Bram@vim.org>
parents: 16074
diff changeset
131
0422b14bce58 patch 8.1.1307: cannot reconnect to the X server after it restarted
Bram Moolenaar <Bram@vim.org>
parents: 16074
diff changeset
132 xrestore
0422b14bce58 patch 8.1.1307: cannot reconnect to the X server after it restarted
Bram Moolenaar <Bram@vim.org>
parents: 16074
diff changeset
133 call CheckCopyPaste()
0422b14bce58 patch 8.1.1307: cannot reconnect to the X server after it restarted
Bram Moolenaar <Bram@vim.org>
parents: 16074
diff changeset
134
0422b14bce58 patch 8.1.1307: cannot reconnect to the X server after it restarted
Bram Moolenaar <Bram@vim.org>
parents: 16074
diff changeset
135 exe "xrestore " .. display
0422b14bce58 patch 8.1.1307: cannot reconnect to the X server after it restarted
Bram Moolenaar <Bram@vim.org>
parents: 16074
diff changeset
136 call CheckCopyPaste()
0422b14bce58 patch 8.1.1307: cannot reconnect to the X server after it restarted
Bram Moolenaar <Bram@vim.org>
parents: 16074
diff changeset
137
0422b14bce58 patch 8.1.1307: cannot reconnect to the X server after it restarted
Bram Moolenaar <Bram@vim.org>
parents: 16074
diff changeset
138 bwipe!
0422b14bce58 patch 8.1.1307: cannot reconnect to the X server after it restarted
Bram Moolenaar <Bram@vim.org>
parents: 16074
diff changeset
139 endfunc