view src/testdir/test39.in @ 15255:19e79a1ed6b6 v8.1.0636

patch 8.1.0636: line2byte() gives wrong values with text properties commit https://github.com/vim/vim/commit/b413d2e6a8cc7b1611a41bfa9462b986393ca5fe Author: Bram Moolenaar <Bram@vim.org> Date: Tue Dec 25 23:15:46 2018 +0100 patch 8.1.0636: line2byte() gives wrong values with text properties Problem: line2byte() gives wrong values with text properties. (Bjorn Linse) Solution: Compute byte offsets differently when text properties were added. (closes #3718)
author Bram Moolenaar <Bram@vim.org>
date Tue, 25 Dec 2018 23:30:07 +0100
parents c7d12c7eb2b6
children
line wrap: on
line source


Test Visual block mode commands
And test "U" in Visual mode, also on German sharp S.

#define BO_ALL	    0x0001
#define BO_BS	    0x0002
#define BO_CRSR	    0x0004

STARTTEST
:so small.vim
:so mbyte.vim
:" This only works when 'encoding' is "latin1", don't depend on the environment
:set enc=latin1
/^abcde
:" Test shift-right of a block
jlllljj>wlljlll>
:" Test shift-left of a block
G$hhhhkk<
:" Test block-insert
GklkkkIxyz
:" Test block-replace
Gllllkkklllrq
:" Test block-change
G$khhhhhkkcmno
:$-4,$w! test.out
:" Test block-insert using cursor keys for movement
/^aaaa/
:exe ":norm! l\<C-V>jjjlllI\<Right>\<Right>  \<Esc>"
:/^aa/,/^$/w >> test.out
/xaaa$/
:exe ":norm! \<C-V>jjjI<>\<Left>p\<Esc>"
:/xaaa$/,/^$/w >> test.out
:" Test for Visual block was created with the last <C-v>$
/^A23$/
:exe ":norm! l\<C-V>j$Aab\<Esc>"
:.,/^$/w >> test.out
:" Test for Visual block was created with the middle <C-v>$ (1)
/^B23$/
:exe ":norm! l\<C-V>j$hAab\<Esc>"
:.,/^$/w >> test.out
:" Test for Visual block was created with the middle <C-v>$ (2)
/^C23$/
:exe ":norm! l\<C-V>j$hhAab\<Esc>"
:.,/^$/w >> test.out
:" Test for Visual block insert when virtualedit=all and utf-8 encoding
:set ve=all enc=utf-8
:/\t\tline
:exe ":norm! 07l\<C-V>jjIx\<Esc>"
:.,/^$/w >> test.out
:" Test for Visual block append when virtualedit=all
:exe ":norm! 012l\<C-v>jjAx\<Esc>"
:set ve= enc=latin1
:.,/^$/w >> test.out
:" gUe must uppercase a whole word, also when ß changes to SS
Gothe youtußeuu endYpk0wgUe
:" gUfx must uppercase until x, inclusive.
O- youßtußexu -0fogUfx
:" VU must uppercase a whole line
YpkVU
:" same, when it's the last line in the buffer
YPGi111VUddP
:" Uppercase two lines
Oblah di
doh dutVkUj
:" Uppercase part of two lines
ddppi333k0i222fyllvjfuUk
:" visual replace using Enter or NL
G3o1234567892k05l2jr
G3o987652k02l2jr
G3o1234567892k05l2jr
G3o987652k02l2jr
:"
:" Test cursor position. When ve=block and Visual block mode and $gj
:set ve=block
:exe ":norm! 2k\<C-V>$gj\<Esc>"
:let cpos=getpos("'>")
:$put ='col:'.cpos[2].' off:'.cpos[3]
:"
:" block_insert when replacing spaces in front of the block with tabs
:set ts=8 sts=4 sw=4
:4,7y
Gp
:exe ":norm! f0\<C-V>2jI\<tab>\<esc>"
:/^the/,$w >> test.out
:qa!
ENDTEST

		line1
		line2
		line3

aaaaaa
bbbbbb
cccccc
dddddd

xaaa
bbbb
cccc
dddd

yaaa
¿¿¿
bbb

A23
4567

B23
4567

C23
4567

abcdefghijklm
abcdefghijklm
abcdefghijklm
abcdefghijklm
abcdefghijklm