aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-11-01 00:43:20 -0400
committerJustin M. Keyes <justinkz@gmail.com>2019-11-01 13:43:20 +0900
commit471427d045f74fa9d2e47b2975ef178e719c2ae8 (patch)
tree2a3bf3f62e0c9ad9215f6f1acd0ee90eaaa4acaa /src/nvim/testdir
parentefaf4732e26e2f0fbfab947296141376223b30d7 (diff)
downloadrneovim-471427d045f74fa9d2e47b2975ef178e719c2ae8.tar.gz
rneovim-471427d045f74fa9d2e47b2975ef178e719c2ae8.tar.bz2
rneovim-471427d045f74fa9d2e47b2975ef178e719c2ae8.zip
vim-patch:8.1.2231: introduce gM command #11321
Problem: Not easy to move to the middle of a text line. Solution: Add the gM command. (Yasuhiro Matsumoto, closes vim/vim#2070) https://github.com/vim/vim/commit/8b530c1ff91f07cf6b0289a536992b7dfbc86598
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_normal.vim24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_normal.vim b/src/nvim/testdir/test_normal.vim
index 07d250cace..eab638d19a 100644
--- a/src/nvim/testdir/test_normal.vim
+++ b/src/nvim/testdir/test_normal.vim
@@ -1895,6 +1895,7 @@ fun! Test_normal33_g_cmd2()
set wrap listchars= sbr=
let lineA='abcdefghijklmnopqrstuvwxyz'
let lineB='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+ let lineC='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
$put =lineA
$put =lineB
@@ -1928,9 +1929,30 @@ fun! Test_normal33_g_cmd2()
call assert_equal(15, col('.'))
call assert_equal('l', getreg(0))
+ norm! 2ggdd
+ $put =lineC
+
+ " Test for gM
+ norm! gMyl
+ call assert_equal(73, col('.'))
+ call assert_equal('0', getreg(0))
+ " Test for 20gM
+ norm! 20gMyl
+ call assert_equal(29, col('.'))
+ call assert_equal('S', getreg(0))
+ " Test for 60gM
+ norm! 60gMyl
+ call assert_equal(87, col('.'))
+ call assert_equal('E', getreg(0))
+
+ " Test for g Ctrl-G
+ set ff=unix
+ let a=execute(":norm! g\<c-g>")
+ call assert_match('Col 87 of 144; Line 2 of 2; Word 1 of 1; Byte 88 of 146', a)
+
" Test for gI
norm! gIfoo
- call assert_equal(['', 'fooabcdefghijk lmno0123456789AMNOPQRSTUVWXYZ'], getline(1,'$'))
+ call assert_equal(['', 'foo0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'], getline(1,'$'))
" Test for gi
wincmd c