Merge remote-tracking branch 'vim/master'

This commit is contained in:
Kazuki Sakamoto
2017-02-27 14:07:00 -08:00
7 changed files with 124 additions and 8 deletions
+1
View File
@@ -2109,6 +2109,7 @@ test1 \
# Run individual NEW style test, assuming that Vim was already compiled.
test_arglist \
test_arabic \
test_assert \
test_assign \
test_autochdir \
+6 -5
View File
@@ -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': [[], []],
@@ -196,4 +195,6 @@ call add(script, 'let &lines = save_lines')
call writefile(script, 'testdir/opt_test.vim')
endif
qa!
+12 -2
View File
@@ -4189,7 +4189,9 @@ win_line(
}
else
{
#ifdef FEAT_LINEBREAK
int c0;
#endif
if (p_extra_free != NULL)
{
@@ -4199,7 +4201,10 @@ win_line(
/*
* Get a character from the line itself.
*/
c0 = c = *ptr;
c = *ptr;
#ifdef FEAT_LINEBREAK
c0 = *ptr;
#endif
#ifdef FEAT_MBYTE
if (has_mbyte)
{
@@ -4216,7 +4221,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.
+2 -1
View File
@@ -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 \
+1
View File
@@ -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()',
+92
View File
@@ -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\<C-^>12\<C-^>12", 'tx')
redraw
call assert_equal('١٢12١٢', getline('.'))
set arabic&
bwipe!
endfunc
func Test_delcombine()
new
set arabic
call feedkeys("isghl\<BS>\<BS>", 'tx')
redraw
call assert_equal(["\nd8 b3 ", "\nd9 84 "], GetCharsUtf8(1))
" Now the same with nodelcombine
set nodelcombine
%d
call feedkeys("isghl\<BS>\<BS>", 'tx')
call assert_equal(["\nd8 b3 "], GetCharsUtf8(1))
set arabic&
bwipe!
endfunc
+10
View File
@@ -779,6 +779,16 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
386,
/**/
385,
/**/
384,
/**/
383,
/**/
382,
/**/
381,
/**/