comparison src/testdir/test_visual.vim @ 27577:40d844af56a5 v8.2.4315

patch 8.2.4315: put in Visual mode not fully tested Commit: https://github.com/vim/vim/commit/6bf821e8abe1da24e5d0624f032d7eda745756e8 Author: zeertzjq <zeertzjq@outlook.com> Date: Mon Feb 7 10:33:20 2022 +0000 patch 8.2.4315: put in Visual mode not fully tested Problem: Put in Visual mode not fully tested. Solution: Add a few more test cases. (closes https://github.com/vim/vim/issues/9708)
author Bram Moolenaar <Bram@vim.org>
date Mon, 07 Feb 2022 11:45:03 +0100
parents 3f8a57b8c7d8
children 5eea8a249f86
comparison
equal deleted inserted replaced
27576:55ea029fa9cd 27577:40d844af56a5
1367 1367
1368 " v_p overwrites unnamed register. 1368 " v_p overwrites unnamed register.
1369 call setline(1, ['xxxx']) 1369 call setline(1, ['xxxx'])
1370 call setreg('"', 'foo') 1370 call setreg('"', 'foo')
1371 call setreg('-', 'bar') 1371 call setreg('-', 'bar')
1372 normal 1Gvp 1372 normal gg0vp
1373 call assert_equal(@", 'x') 1373 call assert_equal('x', @")
1374 call assert_equal(@-, 'x') 1374 call assert_equal('x', @-)
1375 call assert_equal('fooxxx', getline(1))
1376 normal $vp
1377 call assert_equal('x', @")
1378 call assert_equal('x', @-)
1379 call assert_equal('fooxxx', getline(1))
1380 " Test with a different register as unnamed register.
1381 call setline(2, ['baz'])
1382 normal 2gg0"rD
1383 call assert_equal('baz', @")
1384 normal gg0vp
1385 call assert_equal('f', @")
1386 call assert_equal('f', @-)
1387 call assert_equal('bazooxxx', getline(1))
1388 normal $vp
1389 call assert_equal('x', @")
1390 call assert_equal('x', @-)
1391 call assert_equal('bazooxxf', getline(1))
1375 1392
1376 if has('clipboard') 1393 if has('clipboard')
1377 " v_P does not overwrite unnamed register. 1394 " v_P does not overwrite unnamed register.
1378 call setline(1, ['xxxx']) 1395 call setline(1, ['xxxx'])
1379 call setreg('"', 'foo') 1396 call setreg('"', 'foo')
1380 call setreg('-', 'bar') 1397 call setreg('-', 'bar')
1381 normal 1GvP 1398 normal gg0vP
1382 call assert_equal(@", 'foo') 1399 call assert_equal('foo', @")
1383 call assert_equal(@-, 'x') 1400 call assert_equal('x', @-)
1401 call assert_equal('fooxxx', getline(1))
1402 normal $vP
1403 call assert_equal('foo', @")
1404 call assert_equal('x', @-)
1405 call assert_equal('fooxxfoo', getline(1))
1406 " Test with a different register as unnamed register.
1407 call setline(2, ['baz'])
1408 normal 2gg0"rD
1409 call assert_equal('baz', @")
1410 normal gg0vP
1411 call assert_equal('baz', @")
1412 call assert_equal('f', @-)
1413 call assert_equal('bazooxxfoo', getline(1))
1414 normal $vP
1415 call assert_equal('baz', @")
1416 call assert_equal('o', @-)
1417 call assert_equal('bazooxxfobaz', getline(1))
1384 endif 1418 endif
1385 1419
1386 bwipe! 1420 bwipe!
1387 endfunc 1421 endfunc
1388 1422