summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_normal.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-05-29 19:18:01 +0200
committerBram Moolenaar <Bram@vim.org>2021-05-29 19:18:01 +0200
commit74ede80aeb272ac81d41a256057c4f250372dd00 (patch)
tree8174d5c488076e8fb910d88ed08b85fafba6d2a9 /src/testdir/test_normal.vim
parenta06e345af5b8261c072c95b0446e67cfda439848 (diff)
patch 8.2.2904: "g$" causes scroll if half a double width char is visiblev8.2.2904
Problem: "g$" causes scroll if half a double width char is visible. Solution: Advance to the last fully visible character. (closes #8254)
Diffstat (limited to 'src/testdir/test_normal.vim')
-rw-r--r--src/testdir/test_normal.vim28
1 files changed, 25 insertions, 3 deletions
diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim
index 72a7253ff4..f6e60a8ae5 100644
--- a/src/testdir/test_normal.vim
+++ b/src/testdir/test_normal.vim
@@ -2201,9 +2201,9 @@ func Test_normal33_g_cmd2()
%d
15vsp
set wrap listchars= sbr=
- let lineA='abcdefghijklmnopqrstuvwxyz'
- let lineB='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
- let lineC='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
+ let lineA = 'abcdefghijklmnopqrstuvwxyz'
+ let lineB = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+ let lineC = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
$put =lineA
$put =lineB
@@ -2238,6 +2238,28 @@ func Test_normal33_g_cmd2()
call assert_equal('l', getreg(0))
call assert_beeps('normal 5g$')
+ " Test for g$ with double-width character half displayed
+ vsplit
+ 9wincmd |
+ setlocal nowrap nonumber
+ call setline(2, 'asdfasdfヨ')
+ 2
+ normal 0g$
+ call assert_equal(8, col('.'))
+ 10wincmd |
+ normal 0g$
+ call assert_equal(9, col('.'))
+
+ setlocal signcolumn=yes
+ 11wincmd |
+ normal 0g$
+ call assert_equal(8, col('.'))
+ 12wincmd |
+ normal 0g$
+ call assert_equal(9, col('.'))
+
+ close
+
" Test for g_
call assert_beeps('normal! 100g_')
call setline(2, [' foo ', ' foobar '])