From 75c19464ed7fb6024af64747379e61abc4e4a483 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 12 Feb 2017 18:34:05 +0100 Subject: [PATCH 1/3] patch 8.0.0327: error message in cmdline window is not translated Problem: The E11 error message in the command line window is not translated. Solution: use _(). (Hirohito Higashi) --- src/ex_docmd.c | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 09102b5370..14ef2bd929 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -2490,7 +2490,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 diff --git a/src/version.c b/src/version.c index 381a6d5d4d..e95fed6ba2 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 */ +/**/ + 327, /**/ 326, /**/ From 23a5558cfd860401aa694f0302d621887440f031 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 12 Feb 2017 18:45:25 +0100 Subject: [PATCH 2/3] patch 8.0.0328: the "zero count" error doesn't have a number Problem: The "zero count" error doesn't have a number. (Hirohito Higashi) Solution: Give it a number and be more specific about the error. --- src/globals.h | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/globals.h b/src/globals.h index 0b6abb0e85..f3e5155e99 100644 --- a/src/globals.h +++ b/src/globals.h @@ -1581,7 +1581,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 not in a script context")); #endif diff --git a/src/version.c b/src/version.c index e95fed6ba2..08d377d0c2 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 */ +/**/ + 328, /**/ 327, /**/ From 10434674821939222bf552d15d93e0132d13badc Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 12 Feb 2017 19:59:08 +0100 Subject: [PATCH 3/3] patch 8.0.0329: xfontset and guifontwide are not tested Problem: Xfontset and guifontwide are not tested. Solution: Add tests. (Kazunobu Kuriyama) --- src/testdir/test_gui.vim | 142 +++++++++++++++++++++++++++++++++++++++ src/version.c | 2 + 2 files changed, 144 insertions(+) diff --git a/src/testdir/test_gui.vim b/src/testdir/test_gui.vim index 283b0ccb89..49bc02658f 100644 --- a/src/testdir/test_gui.vim +++ b/src/testdir/test_gui.vim @@ -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) diff --git a/src/version.c b/src/version.c index 08d377d0c2..9073c07dc8 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 */ +/**/ + 329, /**/ 328, /**/