Mercurial > vim
comparison src/testdir/test_paste.vim @ 13425:bb789ed5113a v8.0.1587
patch 8.0.1587: inserting from the clipboard doesn't work literally
commit https://github.com/vim/vim/commit/3324d0a86421a634572758dcfde917547f4d4c67
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Mar 6 19:51:13 2018 +0100
patch 8.0.1587: inserting from the clipboard doesn't work literally
Problem: inserting from the clipboard doesn't work literally
Solution: When pasting from the * or + register always assume literally.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 06 Mar 2018 20:00:07 +0100 |
parents | e366b968bf08 |
children | aa6ecb272236 |
comparison
equal
deleted
inserted
replaced
13424:22b13b27d9fe | 13425:bb789ed5113a |
---|---|
1 " Tests for bracketed paste. | 1 " Tests for bracketed paste and other forms of pasting. |
2 | 2 |
3 " Bracketed paste only works with "xterm". Not in GUI. | 3 " Bracketed paste only works with "xterm". Not in GUI. |
4 if has('gui_running') | 4 if has('gui_running') |
5 finish | 5 finish |
6 endif | 6 endif |
64 | 64 |
65 set ai& et& tw=0 | 65 set ai& et& tw=0 |
66 bwipe! | 66 bwipe! |
67 endfunc | 67 endfunc |
68 | 68 |
69 func Test_paste_clipboard() | |
70 if !has('clipboard') | |
71 return | |
72 endif | |
73 let @+ = "nasty\<Esc>:!ls\<CR>command" | |
74 new | |
75 exe "normal i\<C-R>+\<Esc>" | |
76 call assert_equal("nasty\<Esc>:!ls\<CR>command", getline(1)) | |
77 bwipe! | |
78 endfunc | |
79 | |
69 func Test_paste_cmdline() | 80 func Test_paste_cmdline() |
70 call feedkeys(":a\<Esc>[200~foo\<CR>bar\<Esc>[201~b\<Home>\"\<CR>", 'xt') | 81 call feedkeys(":a\<Esc>[200~foo\<CR>bar\<Esc>[201~b\<Home>\"\<CR>", 'xt') |
71 call assert_equal("\"afoo\<CR>barb", getreg(':')) | 82 call assert_equal("\"afoo\<CR>barb", getreg(':')) |
72 endfunc | 83 endfunc |
73 | 84 |