Mercurial > vim
comparison src/testdir/test_visual.vim @ 27428:3f8a57b8c7d8 v8.2.4242
patch 8.2.4242: put in Visual mode cannot be repeated
Commit: https://github.com/vim/vim/commit/fb55207ed17918c8a2a6cadf5ad9d5fcf686a7ab
Author: Shougo Matsushita <Shougo.Matsu@gmail.com>
Date: Fri Jan 28 16:01:13 2022 +0000
patch 8.2.4242: put in Visual mode cannot be repeated
Problem: Put in Visual mode cannot be repeated.
Solution: Use "P" to put without yanking the deleted text into the unnamed
register. (Shougo Matsushita, closes #9591)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 28 Jan 2022 17:15:03 +0100 |
parents | 123b0747fa10 |
children | 40d844af56a5 |
comparison
equal
deleted
inserted
replaced
27427:9cf9ba0101f6 | 27428:3f8a57b8c7d8 |
---|---|
1356 set undolevels=100 | 1356 set undolevels=100 |
1357 /y | 1357 /y |
1358 exe "normal ggvjfxO" | 1358 exe "normal ggvjfxO" |
1359 undo | 1359 undo |
1360 normal gNU | 1360 normal gNU |
1361 bwipe! | 1361 |
1362 endfunc | 1362 bwipe! |
1363 | 1363 endfunc |
1364 | |
1365 func Test_visual_paste() | |
1366 new | |
1367 | |
1368 " v_p overwrites unnamed register. | |
1369 call setline(1, ['xxxx']) | |
1370 call setreg('"', 'foo') | |
1371 call setreg('-', 'bar') | |
1372 normal 1Gvp | |
1373 call assert_equal(@", 'x') | |
1374 call assert_equal(@-, 'x') | |
1375 | |
1376 if has('clipboard') | |
1377 " v_P does not overwrite unnamed register. | |
1378 call setline(1, ['xxxx']) | |
1379 call setreg('"', 'foo') | |
1380 call setreg('-', 'bar') | |
1381 normal 1GvP | |
1382 call assert_equal(@", 'foo') | |
1383 call assert_equal(@-, 'x') | |
1384 endif | |
1385 | |
1386 bwipe! | |
1387 endfunc | |
1364 | 1388 |
1365 " vim: shiftwidth=2 sts=2 expandtab | 1389 " vim: shiftwidth=2 sts=2 expandtab |