On Do, 10 Jul 2014, Bram Moolenaar wrote: > Danek Duvall wrote: > > > On Wed, Jul 02, 2014 at 08:01:04PM +0200, Bram Moolenaar wrote: > > > > > > > > Patch 7.4.353 > > > Problem: 'breakindent' doesn't work with the 'list' option. > > > Solution: Make it work. (Christian Brabandt) > > > Files: runtime/doc/options.txt, src/charset.c, src/screen.c, > > > src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak, > > > src/testdir/Make_ming.mak, src/testdir/Make_os2.mak, > > > src/testdir/Make_vms.mms, src/testdir/Makefile, > > > src/testdir/test_listlbr.in, src/testdir/test_listlbr.ok > > > > When the tests are run with LC_ALL=C, this test fails, apparently because > > test_listlbr.out ends up having converted the various unicode characters to > > something other than utf-8, and so it doesn't match the .ok file. AFAICT, > > this is the only test with that problem (at least, it's the only test that > > fails for me). > > > > Running the tests in a utf-8 locale isn't really an option for me, but I'm > > not sure what the right answer actually is. Should the test be modified to > > not require "fancy" unicode characters, or should the test suite be sure to > > run this particular test to force utf-8 encoding (assuming the system is > > even configured with it)? Or is there some other option? > > Well, I suppose we do want to test if the feature works with those > characters. So perhaps just forfeit the test on systems without utf-8?
How about the attached patch? It checks, if Vim is running in utf-8 mode and if not skips 2 checks. Best, Christian -- Einer Liebhaberin wird die Treue viel leichter als einer Gattin. -- Jean Paul -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
diff --git a/src/testdir/test1.in b/src/testdir/test1.in --- a/src/testdir/test1.in +++ b/src/testdir/test1.in @@ -44,6 +44,9 @@ qa! :" If +lua feature supported, make lua.vim empty. :if has("lua") | sp another | w! lua.vim | q | endif :" +:" If &enc==utf-8, copy create special ok files +:if has("multi_byte") && &enc==?"utf-8" | sp test_listlbr_utf8.ok | else | sp test_listlbr_nonutf8.ok| endif | w! test_listlbr.ok | q +:" :" If +eval feature supported quit here, leaving tiny.vim and small.vim empty. :" Otherwise write small.vim to skip the test. :if 1 | q! | endif diff --git a/src/testdir/test_listlbr.in b/src/testdir/test_listlbr.in --- a/src/testdir/test_listlbr.in +++ b/src/testdir/test_listlbr.in @@ -4,7 +4,8 @@ STARTTEST :so small.vim :if !exists("+linebreak") | e! test.ok | w! test.out | qa! | endif :10new|:vsp|:vert resize 20 -:put =\"\tabcdef hijklmn\tpqrstuvwxyz\u00a01060ABCDEFGHIJKLMNOP \" +:if &enc==?"utf-8" | :let g:spc="\u00a0" | else | :let g:spc="_" | endif +:put =\"\tabcdef hijklmn\tpqrstuvwxyz\".g:spc.\"1060ABCDEFGHIJKLMNOP \" :norm! zt :set ts=4 sw=4 sts=4 linebreak sbr=+ wrap :fu! ScreenChar(width) @@ -32,21 +33,25 @@ STARTTEST :redraw! :let line=ScreenChar(winwidth(0)) :call DoRecordScreen() +:if &enc==?"utf-8" :let g:test ="Test 3: set linebreak + set list + fancy listchars" :exe "set linebreak list listchars=nbsp:\u2423,tab:\u2595\u2014,trail:\u02d1,eol:\ub6" :redraw! :let line=ScreenChar(winwidth(0)) :call DoRecordScreen() +:endif :let g:test ="Test 4: set linebreak nolist" :set nolist linebreak :redraw! :let line=ScreenChar(winwidth(0)) :call DoRecordScreen() +:if &enc==?"utf-8" :let g:test ="Test 5: set nolinebreak list" :set list nolinebreak :redraw! :let line=ScreenChar(winwidth(0)) :call DoRecordScreen() +:endif :let g:test ="Test 6: set linebreak with tab and 1 line as long as screen: should break!" :set nolist linebreak ts=8 :let line="1\t".repeat('a', winwidth(0)-2) diff --git a/src/testdir/test_listlbr.ok b/src/testdir/test_listlbr.ok deleted file mode 100644 --- a/src/testdir/test_listlbr.ok +++ /dev/null @@ -1,39 +0,0 @@ - - abcdef hijklmn pqrstuvwxyz 1060ABCDEFGHIJKLMNOP - -Test 1: set linebreak - abcdef -+hijklmn -+pqrstuvwxyz 1060ABC -+DEFGHIJKLMNOP - -Test 2: set linebreak + set list -^Iabcdef hijklmn^I -+pqrstuvwxyz 1060ABC -+DEFGHIJKLMNOP - - -Test 3: set linebreak + set list + fancy listchars -ââââabcdef -+hijklmnââââ -+pqrstuvwxyzâ£1060ABC -+DEFGHIJKLMNOP˶ - -Test 4: set linebreak nolist - abcdef -+hijklmn -+pqrstuvwxyz 1060ABC -+DEFGHIJKLMNOP - -Test 5: set nolinebreak list -ââââabcdef hijklmnââ -+pqrstuvwxyzâ£1060ABC -+DEFGHIJKLMNOP˶ -¶ -1 aaaaaaaaaaaaaaaaaa - -Test 6: set linebreak with tab and 1 line as long as screen: should break! -1 -+aaaaaaaaaaaaaaaaaa -~ -~ diff --git a/src/testdir/test_listlbr_nonutf8.ok b/src/testdir/test_listlbr_nonutf8.ok new file mode 100644 --- /dev/null +++ b/src/testdir/test_listlbr_nonutf8.ok @@ -0,0 +1,28 @@ + + abcdef hijklmn pqrstuvwxyz_1060ABCDEFGHIJKLMNOP + +Test 1: set linebreak + abcdef ++hijklmn ++pqrstuvwxyz_1060ABC ++DEFGHIJKLMNOP + +Test 2: set linebreak + set list +^Iabcdef hijklmn^I ++pqrstuvwxyz_1060ABC ++DEFGHIJKLMNOP + + +Test 4: set linebreak nolist + abcdef ++hijklmn ++pqrstuvwxyz_1060ABC ++DEFGHIJKLMNOP + +1 aaaaaaaaaaaaaaaaaa + +Test 6: set linebreak with tab and 1 line as long as screen: should break! +1 ++aaaaaaaaaaaaaaaaaa +~ +~ diff --git a/src/testdir/test_listlbr_utf8.ok b/src/testdir/test_listlbr_utf8.ok new file mode 100644 --- /dev/null +++ b/src/testdir/test_listlbr_utf8.ok @@ -0,0 +1,39 @@ + + abcdef hijklmn pqrstuvwxyz 1060ABCDEFGHIJKLMNOP + +Test 1: set linebreak + abcdef ++hijklmn ++pqrstuvwxyz 1060ABC ++DEFGHIJKLMNOP + +Test 2: set linebreak + set list +^Iabcdef hijklmn^I ++pqrstuvwxyz 1060ABC ++DEFGHIJKLMNOP + + +Test 3: set linebreak + set list + fancy listchars +ââââabcdef ++hijklmnââââ ++pqrstuvwxyzâ£1060ABC ++DEFGHIJKLMNOP˶ + +Test 4: set linebreak nolist + abcdef ++hijklmn ++pqrstuvwxyz 1060ABC ++DEFGHIJKLMNOP + +Test 5: set nolinebreak list +ââââabcdef hijklmnââ ++pqrstuvwxyzâ£1060ABC ++DEFGHIJKLMNOP˶ +¶ +1 aaaaaaaaaaaaaaaaaa + +Test 6: set linebreak with tab and 1 line as long as screen: should break! +1 ++aaaaaaaaaaaaaaaaaa +~ +~