comparison src/testdir/test_textprop.vim @ 32984:75c283beb74f

re-sync with git
author Christian Brabandt <cb@256bit.org>
date Thu, 24 Aug 2023 07:58:05 +0200
parents c7a332a34fe7
children bc3b293a965c
comparison
equal deleted inserted replaced
32983:5cc3522384b1 32984:75c283beb74f
2628 call VerifyScreenDump(buf, 'Test_prop_inserts_text_visual_block_7', {}) 2628 call VerifyScreenDump(buf, 'Test_prop_inserts_text_visual_block_7', {})
2629 2629
2630 call StopVimInTerminal(buf) 2630 call StopVimInTerminal(buf)
2631 endfunc 2631 endfunc
2632 2632
2633 func Run_test_prop_inserts_text_showbreak(cmd)
2634 CheckRunVimInTerminal
2635
2636 let lines =<< trim END
2637 highlight! link LineNr Normal
2638 call setline(1, repeat('a', 28))
2639 call prop_type_add('theprop', #{highlight: 'Special'})
2640 call prop_add(1, 28, #{type: 'theprop', text: repeat('123', 23), text_wrap: 'wrap'})
2641 setlocal number showbreak=+ breakindent breakindentopt=shift:2
2642 setlocal scrolloff=0 smoothscroll
2643 normal! $
2644 END
2645 let lines = insert(lines, a:cmd)
2646 call writefile(lines, 'XscriptPropsShowbreak', 'D')
2647 let buf = RunVimInTerminal('-S XscriptPropsShowbreak', #{rows: 6, cols: 30})
2648 call term_sendkeys(buf, ":set noruler\<CR>")
2649 call VerifyScreenDump(buf, 'Test_prop_inserts_text_showbreak_1', {})
2650 call term_sendkeys(buf, "\<C-E>")
2651 call VerifyScreenDump(buf, 'Test_prop_inserts_text_showbreak_2', {})
2652 call term_sendkeys(buf, "\<C-E>")
2653 call VerifyScreenDump(buf, 'Test_prop_inserts_text_showbreak_3', {})
2654 call term_sendkeys(buf, "\<C-E>")
2655 call VerifyScreenDump(buf, 'Test_prop_inserts_text_showbreak_4', {})
2656 call term_sendkeys(buf, "\<C-E>")
2657 call VerifyScreenDump(buf, 'Test_prop_inserts_text_showbreak_5', {})
2658 call term_sendkeys(buf, "zbi")
2659 call VerifyScreenDump(buf, 'Test_prop_inserts_text_showbreak_6', {})
2660 call term_sendkeys(buf, "\<BS>")
2661 call VerifyScreenDump(buf, 'Test_prop_inserts_text_showbreak_7', {})
2662 call term_sendkeys(buf, "\<Esc>l")
2663 call VerifyScreenDump(buf, 'Test_prop_inserts_text_showbreak_8', {})
2664 call term_sendkeys(buf, "\<C-E>")
2665 call VerifyScreenDump(buf, 'Test_prop_inserts_text_showbreak_9', {})
2666 call term_sendkeys(buf, "\<C-E>")
2667 call VerifyScreenDump(buf, 'Test_prop_inserts_text_showbreak_10', {})
2668 call term_sendkeys(buf, "\<C-E>")
2669 call VerifyScreenDump(buf, 'Test_prop_inserts_text_showbreak_11', {})
2670 call term_sendkeys(buf, "\<C-E>")
2671 call VerifyScreenDump(buf, 'Test_prop_inserts_text_showbreak_12', {})
2672 call term_sendkeys(buf, "023x$")
2673 call VerifyScreenDump(buf, 'Test_prop_inserts_text_showbreak_13', {})
2674 call term_sendkeys(buf, "\<C-E>")
2675 call VerifyScreenDump(buf, 'Test_prop_inserts_text_showbreak_14', {})
2676 call term_sendkeys(buf, "\<C-E>")
2677 call VerifyScreenDump(buf, 'Test_prop_inserts_text_showbreak_15', {})
2678 call term_sendkeys(buf, "\<C-E>")
2679 call VerifyScreenDump(buf, 'Test_prop_inserts_text_showbreak_16', {})
2680 call term_sendkeys(buf, "zbi")
2681 call VerifyScreenDump(buf, 'Test_prop_inserts_text_showbreak_17', {})
2682 call term_sendkeys(buf, "\<C-U>")
2683 call VerifyScreenDump(buf, 'Test_prop_inserts_text_showbreak_18', {})
2684 call term_sendkeys(buf, "\<Esc>")
2685 call VerifyScreenDump(buf, 'Test_prop_inserts_text_showbreak_19', {})
2686 call term_sendkeys(buf, "\<C-E>")
2687 call VerifyScreenDump(buf, 'Test_prop_inserts_text_showbreak_20', {})
2688 call term_sendkeys(buf, "\<C-E>")
2689 call VerifyScreenDump(buf, 'Test_prop_inserts_text_showbreak_21', {})
2690 call term_sendkeys(buf, "zbx")
2691 call VerifyScreenDump(buf, 'Test_prop_inserts_text_showbreak_22', {})
2692
2693 call StopVimInTerminal(buf)
2694 endfunc
2695
2696 func Test_prop_inserts_text_showbreak()
2697 call Run_test_prop_inserts_text_showbreak('')
2698 " because of 'breakindent' the screendumps are the same
2699 call Run_test_prop_inserts_text_showbreak('set cpoptions+=n')
2700 endfunc
2701
2702 func Test_prop_before_tab_skipcol()
2703 CheckRunVimInTerminal
2704
2705 let lines =<< trim END
2706 call setline(1, repeat("\t", 4) .. 'a')
2707 call prop_type_add('theprop', #{highlight: 'Special'})
2708 call prop_add(1, 4, #{type: 'theprop', text: repeat('12', 32), text_wrap: 'wrap'})
2709 setlocal list listchars=tab:<-> scrolloff=0 smoothscroll
2710 normal! $
2711 END
2712 call writefile(lines, 'XscriptPropsBeforeTabSkipcol', 'D')
2713 let buf = RunVimInTerminal('-S XscriptPropsBeforeTabSkipcol', #{rows: 6, cols: 30})
2714 call VerifyScreenDump(buf, 'Test_prop_before_tab_skipcol_1', {})
2715 call term_sendkeys(buf, "\<C-E>")
2716 call VerifyScreenDump(buf, 'Test_prop_before_tab_skipcol_2', {})
2717 call term_sendkeys(buf, "\<C-E>")
2718 call VerifyScreenDump(buf, 'Test_prop_before_tab_skipcol_3', {})
2719 call term_sendkeys(buf, "\<C-E>")
2720 call VerifyScreenDump(buf, 'Test_prop_before_tab_skipcol_4', {})
2721 call term_sendkeys(buf, "zbh")
2722 call VerifyScreenDump(buf, 'Test_prop_before_tab_skipcol_5', {})
2723 call term_sendkeys(buf, "i")
2724 call VerifyScreenDump(buf, 'Test_prop_before_tab_skipcol_6', {})
2725 call term_sendkeys(buf, "\<C-O>:setlocal nolist\<CR>")
2726 call VerifyScreenDump(buf, 'Test_prop_before_tab_skipcol_7', {})
2727 call term_sendkeys(buf, "\<Esc>l")
2728 call VerifyScreenDump(buf, 'Test_prop_before_tab_skipcol_8', {})
2729 call term_sendkeys(buf, "\<C-E>")
2730 call VerifyScreenDump(buf, 'Test_prop_before_tab_skipcol_9', {})
2731 call term_sendkeys(buf, "\<C-E>")
2732 call VerifyScreenDump(buf, 'Test_prop_before_tab_skipcol_10', {})
2733 call term_sendkeys(buf, "\<C-E>")
2734 call VerifyScreenDump(buf, 'Test_prop_before_tab_skipcol_11', {})
2735
2736 call StopVimInTerminal(buf)
2737 endfunc
2738
2633 func Test_prop_add_with_text_fails() 2739 func Test_prop_add_with_text_fails()
2634 call prop_type_add('failing', #{highlight: 'ErrorMsg'}) 2740 call prop_type_add('failing', #{highlight: 'ErrorMsg'})
2635 call assert_fails("call prop_add(1, 0, #{type: 'failing', text: 'X', end_lnum: 1})", 'E1305:') 2741 call assert_fails("call prop_add(1, 0, #{type: 'failing', text: 'X', end_lnum: 1})", 'E1305:')
2636 call assert_fails("call prop_add(1, 0, #{type: 'failing', text: 'X', end_col: 1})", 'E1305:') 2742 call assert_fails("call prop_add(1, 0, #{type: 'failing', text: 'X', end_col: 1})", 'E1305:')
2637 call assert_fails("call prop_add(1, 0, #{type: 'failing', text: 'X', length: 1})", 'E1305:') 2743 call assert_fails("call prop_add(1, 0, #{type: 'failing', text: 'X', length: 1})", 'E1305:')