Mercurial > vim
comparison src/testdir/test_breakindent.vim @ 29346:336c99d14cc5 v9.0.0016
patch 9.0.0016: comparing line pointer for 'breakindent' is not reliable
Commit: https://github.com/vim/vim/commit/c2a79b87fc31080ba24394c0b30bab45f1bea852
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Jul 1 13:15:35 2022 +0100
patch 9.0.0016: comparing line pointer for 'breakindent' is not reliable
Problem: Comparing line pointer for 'breakindent' is not reliable.
Solution: Make a copy of the line.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 01 Jul 2022 14:30:03 +0200 |
parents | fba9e366ced4 |
children | 1100c9c3fd2a |
comparison
equal
deleted
inserted
replaced
29345:ab6b4e105fa5 | 29346:336c99d14cc5 |
---|---|
714 | 714 |
715 call s:close_windows('set breakindent& briopt& cpo& number&') | 715 call s:close_windows('set breakindent& briopt& cpo& number&') |
716 endfunc | 716 endfunc |
717 | 717 |
718 func Test_breakindent20_list() | 718 func Test_breakindent20_list() |
719 " FIXME - this should not matter | |
720 call test_override('alloc_lines', 0) | |
721 | |
722 call s:test_windows('setl breakindent breakindentopt= linebreak') | 719 call s:test_windows('setl breakindent breakindentopt= linebreak') |
723 " default: | 720 " default: |
724 call setline(1, [' 1. Congress shall make no law', | 721 call setline(1, [' 1. Congress shall make no law', |
725 \ ' 2.) Congress shall make no law', | 722 \ ' 2.) Congress shall make no law', |
726 \ ' 3.] Congress shall make no law']) | 723 \ ' 3.] Congress shall make no law']) |
800 \ ] | 797 \ ] |
801 let lines = s:screen_lines2(1, 9, 20) | 798 let lines = s:screen_lines2(1, 9, 20) |
802 call s:compare_lines(expect, lines) | 799 call s:compare_lines(expect, lines) |
803 " check formatlistpat indent with different list levels | 800 " check formatlistpat indent with different list levels |
804 let &l:flp = '^\s*\*\+\s\+' | 801 let &l:flp = '^\s*\*\+\s\+' |
805 redraw! | |
806 %delete _ | 802 %delete _ |
807 call setline(1, ['* Congress shall make no law', | 803 call setline(1, ['* Congress shall make no law', |
808 \ '*** Congress shall make no law', | 804 \ '*** Congress shall make no law', |
809 \ '**** Congress shall make no law']) | 805 \ '**** Congress shall make no law']) |
810 norm! 1gg | 806 norm! 1gg |
807 redraw! | |
811 let expect = [ | 808 let expect = [ |
812 \ "* Congress shall ", | 809 \ "* Congress shall ", |
813 \ " make no law ", | 810 \ " make no law ", |
814 \ "*** Congress shall ", | 811 \ "*** Congress shall ", |
815 \ " make no law ", | 812 \ " make no law ", |
833 \ "> make no law ", | 830 \ "> make no law ", |
834 \ ] | 831 \ ] |
835 let lines = s:screen_lines2(1, 6, 20) | 832 let lines = s:screen_lines2(1, 6, 20) |
836 call s:compare_lines(expect, lines) | 833 call s:compare_lines(expect, lines) |
837 call s:close_windows('set breakindent& briopt& linebreak& list& listchars& showbreak&') | 834 call s:close_windows('set breakindent& briopt& linebreak& list& listchars& showbreak&') |
838 | |
839 " FIXME - this should not matter | |
840 call test_override('alloc_lines', 1) | |
841 endfunc | 835 endfunc |
842 | 836 |
843 " The following used to crash Vim. This is fixed by 8.2.3391. | 837 " The following used to crash Vim. This is fixed by 8.2.3391. |
844 " This is a regression introduced by 8.2.2903. | 838 " This is a regression introduced by 8.2.2903. |
845 func Test_window_resize_with_linebreak() | 839 func Test_window_resize_with_linebreak() |
879 call StopVimInTerminal(buf) | 873 call StopVimInTerminal(buf) |
880 call delete('XscriptShowbreak') | 874 call delete('XscriptShowbreak') |
881 endfunc | 875 endfunc |
882 | 876 |
883 func Test_no_spurious_match() | 877 func Test_no_spurious_match() |
884 " FIXME - fails under valgrind - this should not matter - timing issue? | |
885 call test_override('alloc_lines', 0) | |
886 | |
887 let s:input = printf('- y %s y %s', repeat('x', 50), repeat('x', 50)) | 878 let s:input = printf('- y %s y %s', repeat('x', 50), repeat('x', 50)) |
888 call s:test_windows('setl breakindent breakindentopt=list:-1 formatlistpat=^- hls') | 879 call s:test_windows('setl breakindent breakindentopt=list:-1 formatlistpat=^- hls') |
889 let @/ = '\%>3v[y]' | 880 let @/ = '\%>3v[y]' |
890 redraw! | 881 redraw! |
891 call searchcount().total->assert_equal(1) | 882 call searchcount().total->assert_equal(1) |
892 | 883 |
893 " cleanup | 884 " cleanup |
894 set hls&vim | 885 set hls&vim |
895 bwipeout! | 886 bwipeout! |
896 " FIXME - this should not matter | |
897 call test_override('alloc_lines', 1) | |
898 endfunc | 887 endfunc |
899 | 888 |
900 func Test_no_extra_indent() | 889 func Test_no_extra_indent() |
901 call s:test_windows('setl breakindent breakindentopt=list:-1,min:10') | 890 call s:test_windows('setl breakindent breakindentopt=list:-1,min:10') |
902 %d | 891 %d |