Merge remote-tracking branch 'vim/master'

This commit is contained in:
Kazuki Sakamoto
2017-02-14 21:36:46 -08:00
4 changed files with 150 additions and 2 deletions
+1 -1
View File
@@ -2497,7 +2497,7 @@ do_one_cmd(
&& !IS_USER_CMDIDX(ea.cmdidx))
{
/* Command not allowed when editing the command line. */
errormsg = get_text_locked_msg();
errormsg = (char_u *)_(get_text_locked_msg());
goto doend;
}
#ifdef FEAT_AUTOCMD
+1 -1
View File
@@ -1585,7 +1585,7 @@ EXTERN char_u e_winheight[] INIT(= N_("E591: 'winheight' cannot be smaller than
EXTERN char_u e_winwidth[] INIT(= N_("E592: 'winwidth' cannot be smaller than 'winminwidth'"));
#endif
EXTERN char_u e_write[] INIT(= N_("E80: Error while writing"));
EXTERN char_u e_zerocount[] INIT(= N_("Zero count"));
EXTERN char_u e_zerocount[] INIT(= N_("E939: Positive count required"));
#ifdef FEAT_EVAL
EXTERN char_u e_usingsid[] INIT(= N_("E81: Using <SID> not in a script context"));
#endif
+142
View File
@@ -131,6 +131,148 @@ func Test_set_guifont()
endif
endfunc
func Test_set_guifontset()
let skipped = 0
if has('xfontset')
let l:ctype_saved = v:ctype
" For UTF-8 locales, XCreateFontSet(3) is likely to fail in constructing a
" fontset automatically from one or two simple XLFDs because it requires
" the host system to have a fairly comprehensive collection of fixed-width
" fonts with various sizes and registries/encodings in order to get the
" job done. To make the test meaningful for a wide variety of hosts, we
" confine ourselves to the following locale for which X11 historically has
" the fonts to use with.
language ctype ja_JP.eucJP
" Since XCreateFontSet(3) is very sensitive to locale, fonts must be
" chosen meticulously.
let l:font_head = '-misc-fixed-medium-r-normal--14'
let l:font_aw70 = l:font_head . '-130-75-75-c-70'
let l:font_aw140 = l:font_head . '-130-75-75-c-140'
let l:font_jisx0201 = l:font_aw70 . '-jisx0201.1976-0'
let l:font_jisx0208 = l:font_aw140 . '-jisx0208.1983-0'
" Full XLFDs
let l:fontset_name = join([ l:font_jisx0208, l:font_jisx0201 ], ',')
exec 'set guifontset=' . l:fontset_name
call assert_equal(l:fontset_name, &guifontset)
" XLFDs w/o CharSetRegistry and CharSetEncoding
let l:fontset_name = join([ l:font_aw140, l:font_aw70 ], ',')
exec 'set guifontset=' . l:fontset_name
call assert_equal(l:fontset_name, &guifontset)
" Singleton
let l:fontset_name = l:font_head . '-*'
exec 'set guifontset=' . l:fontset_name
call assert_equal(l:fontset_name, &guifontset)
" Aliases
let l:fontset_name = 'k14,r14'
exec 'set guifontset=' . l:fontset_name
call assert_equal(l:fontset_name, &guifontset)
exec 'language ctype' l:ctype_saved
else
let skipped = 1
endif
if skipped
throw "Skipped: Not supported by this GUI"
endif
endfunc
func Test_set_guifontwide()
let skipped = 0
if has('gui_gtk')
let l:guifont_saved = &guifont
let l:guifontwide_saved = &guifontwide
let l:fc_match = exepath('fc-match')
if l:fc_match != ''
let &guifont = system('fc-match -f "%{family[0]} %{size}" monospace:size=10')
let l:wide = system('fc-match -f "%{family[0]} %{size}" monospace:size=10:lang=ja')
exec 'set guifontwide=' . fnameescape(l:wide)
call assert_equal(l:wide, &guifontwide)
else
let skipped = 3
endif
let &guifontwide = l:guifontwide_saved
let &guifont = l:guifont_saved
elseif has('gui_athena') || has('gui_motif')
" guifontwide is premised upon the xfontset feature.
if has('xfontset')
let l:encoding_saved = &encoding
let l:guifont_saved = &guifont
let l:guifontset_saved = &guifontset
let l:guifontwide_saved = &guifontwide
let l:nfont = '-misc-fixed-medium-r-normal-*-18-120-100-100-c-90-iso10646-1'
let l:wfont = '-misc-fixed-medium-r-normal-*-18-120-100-100-c-180-iso10646-1'
set encoding=utf-8
" Case 1: guifontset is empty
set guifontset=
" Case 1-1: Automatic selection
set guifontwide=
exec 'set guifont=' . l:nfont
call assert_equal(l:wfont, &guifontwide)
" Case 1-2: Manual selection
exec 'set guifontwide=' . l:wfont
exec 'set guifont=' . l:nfont
call assert_equal(l:wfont, &guifontwide)
" Case 2: guifontset is invalid
try
set guifontset=-*-notexist-*
call assert_false(1, "'set guifontset=notexist' should have failed")
catch
call assert_exception('E598')
endtry
" Set it to an invalid value brutally for preparation.
let &guifontset = '-*-notexist-*'
" Case 2-1: Automatic selection
set guifontwide=
exec 'set guifont=' . l:nfont
call assert_equal(l:wfont, &guifontwide)
" Case 2-2: Manual selection
exec 'set guifontwide=' . l:wfont
exec 'set guifont=' . l:nfont
call assert_equal(l:wfont, &guifontwide)
let &guifontwide = l:guifontwide_saved
let &guifontset = l:guifontset_saved
let &guifont = l:guifont_saved
let &encoding = l:encoding_saved
else
let skipped = 2
endif
else
let skipped = 1
endif
if skipped == 1
throw "Skipped: Test not implemented yet for this GUI"
elseif skipped == 2
throw "Skipped: Not supported by this GUI"
elseif skipped == 3
throw "Skipped: Test not supported by the environment"
endif
endfunc
func Test_getwinpos()
call assert_match('Window position: X \d\+, Y \d\+', execute('winpos'))
call assert_true(getwinposx() >= 0)
+6
View File
@@ -779,6 +779,12 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
329,
/**/
328,
/**/
327,
/**/
326,
/**/