From 88e7688edaf6fcf079d3c1b1070c852cfbb28185 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 27 Feb 2017 20:33:46 +0100 Subject: [PATCH 1/5] patch 8.0.0382: warning in tiny build for unused variable Problem: Warning in tiny build for unused variable. (Tony Mechelynck) Solution: Add #ifdefs. --- src/screen.c | 11 ++++++++++- src/version.c | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/screen.c b/src/screen.c index cc9c9f6dc5..2c9bbef9e5 100644 --- a/src/screen.c +++ b/src/screen.c @@ -4189,7 +4189,9 @@ win_line( } else { +#ifdef FEAT_LINEBREAK int c0; +#endif if (p_extra_free != NULL) { @@ -4199,7 +4201,9 @@ win_line( /* * Get a character from the line itself. */ +#ifdef FEAT_LINEBREAK c0 = c = *ptr; +#endif #ifdef FEAT_MBYTE if (has_mbyte) { @@ -4216,7 +4220,12 @@ win_line( /* Overlong encoded ASCII or ASCII with composing char * is displayed normally, except a NUL. */ if (mb_c < 0x80) - c0 = c = mb_c; + { + c = mb_c; +# ifdef FEAT_LINEBREAK + c0 = mb_c; +# endif + } mb_utf8 = TRUE; /* At start of the line we can have a composing char. diff --git a/src/version.c b/src/version.c index ccde26dd14..7099c2d653 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 382, /**/ 381, /**/ From 10a8da0594406c37f8971cbd16ebbebf831dc60f Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 27 Feb 2017 21:11:35 +0100 Subject: [PATCH 2/5] patch 8.0.0383: misplaced #ifdef Problem: Misplaced #ifdef. (Christ van Willigen) Solution: Split assignment. --- src/screen.c | 3 ++- src/version.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/screen.c b/src/screen.c index 2c9bbef9e5..8514f3e384 100644 --- a/src/screen.c +++ b/src/screen.c @@ -4201,8 +4201,9 @@ win_line( /* * Get a character from the line itself. */ + c = *ptr; #ifdef FEAT_LINEBREAK - c0 = c = *ptr; + c0 = *ptr; #endif #ifdef FEAT_MBYTE if (has_mbyte) diff --git a/src/version.c b/src/version.c index 7099c2d653..232b65dc89 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 383, /**/ 382, /**/ From d512e17ea4cebe547197b759a047138228acc06f Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 27 Feb 2017 21:35:53 +0100 Subject: [PATCH 3/5] patch 8.0.0384: timer test failed for no apparent reason Problem: Timer test failed for no apparent reason. Solution: Mark the test as flaky. --- src/testdir/runtest.vim | 1 + src/version.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/testdir/runtest.vim b/src/testdir/runtest.vim index 0c0a197902..71028a1914 100644 --- a/src/testdir/runtest.vim +++ b/src/testdir/runtest.vim @@ -165,6 +165,7 @@ let s:flaky = [ \ 'Test_collapse_buffers()', \ 'Test_communicate()', \ 'Test_nb_basic()', + \ 'Test_oneshot()', \ 'Test_pipe_through_sort_all()', \ 'Test_pipe_through_sort_some()', \ 'Test_reltime()', diff --git a/src/version.c b/src/version.c index 232b65dc89..713b54c2b9 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 384, /**/ 383, /**/ From b5e8377364110ee70090274da15d202778e96a64 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 27 Feb 2017 21:48:26 +0100 Subject: [PATCH 4/5] patch 8.0.0385: no tests for arabic Problem: No tests for arabic. Solution: Add a first test for arabic. (Dominique Pelle, closes #1518) --- src/Makefile | 1 + src/testdir/Make_all.mak | 3 +- src/testdir/test_arabic.vim | 92 +++++++++++++++++++++++++++++++++++++ src/version.c | 2 + 4 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 src/testdir/test_arabic.vim diff --git a/src/Makefile b/src/Makefile index 09adb9a2bc..0bdd1d470c 100644 --- a/src/Makefile +++ b/src/Makefile @@ -2092,6 +2092,7 @@ test1 \ # Run individual NEW style test, assuming that Vim was already compiled. test_arglist \ + test_arabic \ test_assert \ test_assign \ test_autochdir \ diff --git a/src/testdir/Make_all.mak b/src/testdir/Make_all.mak index 18dfdc8e74..513fd89717 100644 --- a/src/testdir/Make_all.mak +++ b/src/testdir/Make_all.mak @@ -133,7 +133,8 @@ SCRIPTS_GUI = # Tests using runtest.vim.vim. # Keep test_alot*.res as the last one, sort the others. -NEW_TESTS = test_arglist.res \ +NEW_TESTS = test_arabic.res \ + test_arglist.res \ test_assert.res \ test_autochdir.res \ test_backspace_opt.res \ diff --git a/src/testdir/test_arabic.vim b/src/testdir/test_arabic.vim new file mode 100644 index 0000000000..b9e033462e --- /dev/null +++ b/src/testdir/test_arabic.vim @@ -0,0 +1,92 @@ +" Simplistic testing of Arabic mode. + +if !has('arabic') + finish +endif + +set encoding=utf-8 +scriptencoding utf-8 + +" Return list of utf8 sequences of each character at line lnum. +" Combining characters are treated as a single item. +func GetCharsUtf8(lnum) + call cursor(a:lnum, 1) + let chars = [] + let numchars = strchars(getline('.'), 1) + for i in range(1, numchars) + exe 'norm ' i . '|' + call add(chars, execute('norm g8')) + endfor + return chars +endfunc + +func Test_arabic_toggle() + set arabic + call assert_equal(1, &rightleft) + call assert_equal(1, &arabicshape) + call assert_equal('arabic', &keymap) + call assert_equal(1, &delcombine) + + set iminsert=1 imsearch=1 + set arabic& + call assert_equal(0, &rightleft) + call assert_equal(1, &arabicshape) + call assert_equal('arabic', &keymap) + call assert_equal(1, &delcombine) + call assert_equal(0, &iminsert) + call assert_equal(-1, &imsearch) + + set arabicshape& keymap= delcombine& +endfunc + +func Test_arabic_input() + new + set arabic + " Typing sghl in Arabic insert mode should show the + " Arabic word 'Salaam' i.e. 'peace'. + call feedkeys('isghl', 'tx') + redraw + call assert_equal([ + \ "\nd8 b3 ", + \ "\nd9 84 + d8 a7 ", + \ "\nd9 85 "], GetCharsUtf8(1)) + + " Without shaping, it should give individual Arabic letters. + set noarabicshape + redraw + call assert_equal([ + \ "\nd8 b3 ", + \ "\nd9 84 ", + \ "\nd8 a7 ", + \ "\nd9 85 "], GetCharsUtf8(1)) + + set arabicshape& + set arabic& + bwipe! +endfunc + +func Test_arabic_toggle_keymap() + new + set arabic + call feedkeys("i12\12\12", 'tx') + redraw + call assert_equal('١٢12١٢', getline('.')) + set arabic& + bwipe! +endfunc + +func Test_delcombine() + new + set arabic + call feedkeys("isghl\\", 'tx') + redraw + call assert_equal(["\nd8 b3 ", "\nd9 84 "], GetCharsUtf8(1)) + + " Now the same with nodelcombine + set nodelcombine + %d + call feedkeys("isghl\\", 'tx') + call assert_equal(["\nd8 b3 "], GetCharsUtf8(1)) + set arabic& + bwipe! +endfunc diff --git a/src/version.c b/src/version.c index 713b54c2b9..4479cc2168 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 385, /**/ 384, /**/ From 5b3af14b34c97ab58bfd4699bc2f3e5a2b704117 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 27 Feb 2017 22:59:40 +0100 Subject: [PATCH 5/5] patch 8.0.0386: tiny build has a problem with generating the options test Problem: Tiny build has a problem with generating the options test. Solution: Change the "if" to skip over statements. --- src/gen_opt_test.vim | 11 ++++++----- src/version.c | 2 ++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/gen_opt_test.vim b/src/gen_opt_test.vim index 745e5ea4c1..677aa74e34 100644 --- a/src/gen_opt_test.vim +++ b/src/gen_opt_test.vim @@ -1,10 +1,10 @@ " Script to generate testdir/opt_test.vim from option.c -if 0 - finish -endif - set cpo=&vim + +" Only do this when build with the +eval feature. +if 1 + set nomore let script = [ @@ -130,7 +130,6 @@ let test_values = { \ 'winaltkeys': [['menu', 'no'], ['', 'xxx']], \ \ 'luadll': [[], []], - \ 'macatsui': [[], []], \ 'perldll': [[], []], \ 'pythondll': [[], []], \ 'pythonthreedll': [[], []], @@ -192,4 +191,6 @@ call add(script, 'let &lines = save_lines') call writefile(script, 'testdir/opt_test.vim') +endif + qa! diff --git a/src/version.c b/src/version.c index 4479cc2168..c99c368a2b 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 386, /**/ 385, /**/