Mercurial > vim
comparison src/testdir/test_normal.vim @ 24731:a6a4224902f5 v8.2.2904
patch 8.2.2904: "g$" causes scroll if half a double width char is visible
Commit: https://github.com/vim/vim/commit/74ede80aeb272ac81d41a256057c4f250372dd00
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat May 29 19:18:01 2021 +0200
patch 8.2.2904: "g$" causes scroll if half a double width char is visible
Problem: "g$" causes scroll if half a double width char is visible.
Solution: Advance to the last fully visible character. (closes https://github.com/vim/vim/issues/8254)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 29 May 2021 19:30:03 +0200 |
parents | 3cdbce5ba73f |
children | 1ce39e257f1b |
comparison
equal
deleted
inserted
replaced
24730:0cc7f1a2af5c | 24731:a6a4224902f5 |
---|---|
2199 | 2199 |
2200 " Test for gk/gj | 2200 " Test for gk/gj |
2201 %d | 2201 %d |
2202 15vsp | 2202 15vsp |
2203 set wrap listchars= sbr= | 2203 set wrap listchars= sbr= |
2204 let lineA='abcdefghijklmnopqrstuvwxyz' | 2204 let lineA = 'abcdefghijklmnopqrstuvwxyz' |
2205 let lineB='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' | 2205 let lineB = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' |
2206 let lineC='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' | 2206 let lineC = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' |
2207 $put =lineA | 2207 $put =lineA |
2208 $put =lineB | 2208 $put =lineB |
2209 | 2209 |
2210 norm! 3gg0dgk | 2210 norm! 3gg0dgk |
2211 call assert_equal(['', 'abcdefghijklmno', '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'], getline(1, '$')) | 2211 call assert_equal(['', 'abcdefghijklmno', '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'], getline(1, '$')) |
2235 call assert_equal('n', getreg(0)) | 2235 call assert_equal('n', getreg(0)) |
2236 norm! g^yl | 2236 norm! g^yl |
2237 call assert_equal(15, col('.')) | 2237 call assert_equal(15, col('.')) |
2238 call assert_equal('l', getreg(0)) | 2238 call assert_equal('l', getreg(0)) |
2239 call assert_beeps('normal 5g$') | 2239 call assert_beeps('normal 5g$') |
2240 | |
2241 " Test for g$ with double-width character half displayed | |
2242 vsplit | |
2243 9wincmd | | |
2244 setlocal nowrap nonumber | |
2245 call setline(2, 'asdfasdfヨ') | |
2246 2 | |
2247 normal 0g$ | |
2248 call assert_equal(8, col('.')) | |
2249 10wincmd | | |
2250 normal 0g$ | |
2251 call assert_equal(9, col('.')) | |
2252 | |
2253 setlocal signcolumn=yes | |
2254 11wincmd | | |
2255 normal 0g$ | |
2256 call assert_equal(8, col('.')) | |
2257 12wincmd | | |
2258 normal 0g$ | |
2259 call assert_equal(9, col('.')) | |
2260 | |
2261 close | |
2240 | 2262 |
2241 " Test for g_ | 2263 " Test for g_ |
2242 call assert_beeps('normal! 100g_') | 2264 call assert_beeps('normal! 100g_') |
2243 call setline(2, [' foo ', ' foobar ']) | 2265 call setline(2, [' foo ', ' foobar ']) |
2244 normal! 2ggg_ | 2266 normal! 2ggg_ |