comparison src/testdir/test_textprop.vim @ 33000:bc3b293a965c v9.0.1792

patch 9.0.1792: problem with gj/gk/gM and virtual text Commit: https://github.com/vim/vim/commit/d809c0a90387a23aed21ba37d0b65332fb5dafe7 Author: zeertzjq <zeertzjq@outlook.com> Date: Sun Aug 27 11:17:39 2023 +0200 patch 9.0.1792: problem with gj/gk/gM and virtual text Problem: Normal mode "gM", "gj", "gk" commands behave incorrectly with virtual text. Solution: Use linetabsize() instead of linetabsize_str(). closes: #12909 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
author Christian Brabandt <cb@256bit.org>
date Sun, 27 Aug 2023 11:30:08 +0200
parents 75c283beb74f
children 7d0357f70cf8
comparison
equal deleted inserted replaced
32999:679ce4872871 33000:bc3b293a965c
2600 call VerifyScreenDump(buf, 'Test_prop_inserts_text_hi_6', {}) 2600 call VerifyScreenDump(buf, 'Test_prop_inserts_text_hi_6', {})
2601 2601
2602 call StopVimInTerminal(buf) 2602 call StopVimInTerminal(buf)
2603 endfunc 2603 endfunc
2604 2604
2605 func Test_prop_inserts_text_normal_gM()
2606 CheckRunVimInTerminal
2607
2608 let lines =<< trim END
2609 call setline(1, '123456789')
2610 call prop_type_add('theprop', #{highlight: 'Special'})
2611 call prop_add(1, 3, {'type': 'theprop', 'text': 'bbb'})
2612 call prop_add(1, 8, {'type': 'theprop', 'text': 'bbb'})
2613 END
2614 call writefile(lines, 'XscriptPropsNormal_gM', 'D')
2615 let buf = RunVimInTerminal('-S XscriptPropsNormal_gM', #{rows: 3, cols: 60})
2616 call term_sendkeys(buf, "gM")
2617 call VerifyScreenDump(buf, 'Test_prop_inserts_text_normal_gM', {})
2618
2619 call StopVimInTerminal(buf)
2620 endfunc
2621
2622 func Run_test_prop_inserts_text_normal_gj_gk(cmd)
2623 CheckRunVimInTerminal
2624
2625 let lines =<< trim END
2626 call setline(1, repeat([repeat('a', 55)], 2))
2627 call prop_type_add('theprop', {})
2628 call prop_add(1, 41, {'type': 'theprop', 'text': repeat('b', 10)})
2629 call prop_add(2, 41, {'type': 'theprop', 'text': repeat('b', 10)})
2630 END
2631 let lines = insert(lines, a:cmd)
2632 call writefile(lines, 'XscriptPropsNormal_gj_gk', 'D')
2633 let buf = RunVimInTerminal('-S XscriptPropsNormal_gj_gk', #{rows: 6, cols: 60})
2634 call VerifyScreenDump(buf, 'Test_prop_inserts_text_normal_gj_gk_1', {})
2635 call term_sendkeys(buf, "gj")
2636 call VerifyScreenDump(buf, 'Test_prop_inserts_text_normal_gj_gk_2', {})
2637 call term_sendkeys(buf, "gj")
2638 call VerifyScreenDump(buf, 'Test_prop_inserts_text_normal_gj_gk_3', {})
2639 call term_sendkeys(buf, "gj")
2640 call VerifyScreenDump(buf, 'Test_prop_inserts_text_normal_gj_gk_4', {})
2641 call term_sendkeys(buf, "gk")
2642 call VerifyScreenDump(buf, 'Test_prop_inserts_text_normal_gj_gk_5', {})
2643 call term_sendkeys(buf, "gk")
2644 call VerifyScreenDump(buf, 'Test_prop_inserts_text_normal_gj_gk_6', {})
2645 call term_sendkeys(buf, "gk")
2646 call VerifyScreenDump(buf, 'Test_prop_inserts_text_normal_gj_gk_7', {})
2647
2648 call StopVimInTerminal(buf)
2649 endfunc
2650
2651 func Test_prop_inserts_text_normal_gj_gk()
2652 call Run_test_prop_inserts_text_normal_gj_gk('')
2653 call Run_test_prop_inserts_text_normal_gj_gk('set virtualedit=all')
2654 endfunc
2655
2605 func Test_prop_inserts_text_visual_block() 2656 func Test_prop_inserts_text_visual_block()
2606 CheckRunVimInTerminal 2657 CheckRunVimInTerminal
2607 2658
2608 let lines =<< trim END 2659 let lines =<< trim END
2609 call setline(1, repeat(['123456789'], 4)) 2660 call setline(1, repeat(['123456789'], 4))