Skip to content

Commit 1fcce8d

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 9abccb9 + 1043467 commit 1fcce8d

File tree

4 files changed

+150
-2
lines changed

4 files changed

+150
-2
lines changed

src/ex_docmd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2497,7 +2497,7 @@ do_one_cmd(
24972497
&& !IS_USER_CMDIDX(ea.cmdidx))
24982498
{
24992499
/* Command not allowed when editing the command line. */
2500-
errormsg = get_text_locked_msg();
2500+
errormsg = (char_u *)_(get_text_locked_msg());
25012501
goto doend;
25022502
}
25032503
#ifdef FEAT_AUTOCMD

src/globals.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1585,7 +1585,7 @@ EXTERN char_u e_winheight[] INIT(= N_("E591: 'winheight' cannot be smaller than
15851585
EXTERN char_u e_winwidth[] INIT(= N_("E592: 'winwidth' cannot be smaller than 'winminwidth'"));
15861586
#endif
15871587
EXTERN char_u e_write[] INIT(= N_("E80: Error while writing"));
1588-
EXTERN char_u e_zerocount[] INIT(= N_("Zero count"));
1588+
EXTERN char_u e_zerocount[] INIT(= N_("E939: Positive count required"));
15891589
#ifdef FEAT_EVAL
15901590
EXTERN char_u e_usingsid[] INIT(= N_("E81: Using <SID> not in a script context"));
15911591
#endif

src/testdir/test_gui.vim

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,148 @@ func Test_set_guifont()
131131
endif
132132
endfunc
133133

134+
func Test_set_guifontset()
135+
let skipped = 0
136+
137+
if has('xfontset')
138+
let l:ctype_saved = v:ctype
139+
140+
" For UTF-8 locales, XCreateFontSet(3) is likely to fail in constructing a
141+
" fontset automatically from one or two simple XLFDs because it requires
142+
" the host system to have a fairly comprehensive collection of fixed-width
143+
" fonts with various sizes and registries/encodings in order to get the
144+
" job done. To make the test meaningful for a wide variety of hosts, we
145+
" confine ourselves to the following locale for which X11 historically has
146+
" the fonts to use with.
147+
language ctype ja_JP.eucJP
148+
149+
" Since XCreateFontSet(3) is very sensitive to locale, fonts must be
150+
" chosen meticulously.
151+
let l:font_head = '-misc-fixed-medium-r-normal--14'
152+
153+
let l:font_aw70 = l:font_head . '-130-75-75-c-70'
154+
let l:font_aw140 = l:font_head . '-130-75-75-c-140'
155+
156+
let l:font_jisx0201 = l:font_aw70 . '-jisx0201.1976-0'
157+
let l:font_jisx0208 = l:font_aw140 . '-jisx0208.1983-0'
158+
159+
" Full XLFDs
160+
let l:fontset_name = join([ l:font_jisx0208, l:font_jisx0201 ], ',')
161+
exec 'set guifontset=' . l:fontset_name
162+
call assert_equal(l:fontset_name, &guifontset)
163+
164+
" XLFDs w/o CharSetRegistry and CharSetEncoding
165+
let l:fontset_name = join([ l:font_aw140, l:font_aw70 ], ',')
166+
exec 'set guifontset=' . l:fontset_name
167+
call assert_equal(l:fontset_name, &guifontset)
168+
169+
" Singleton
170+
let l:fontset_name = l:font_head . '-*'
171+
exec 'set guifontset=' . l:fontset_name
172+
call assert_equal(l:fontset_name, &guifontset)
173+
174+
" Aliases
175+
let l:fontset_name = 'k14,r14'
176+
exec 'set guifontset=' . l:fontset_name
177+
call assert_equal(l:fontset_name, &guifontset)
178+
179+
exec 'language ctype' l:ctype_saved
180+
181+
else
182+
let skipped = 1
183+
endif
184+
185+
if skipped
186+
throw "Skipped: Not supported by this GUI"
187+
endif
188+
endfunc
189+
190+
func Test_set_guifontwide()
191+
let skipped = 0
192+
193+
if has('gui_gtk')
194+
let l:guifont_saved = &guifont
195+
let l:guifontwide_saved = &guifontwide
196+
197+
let l:fc_match = exepath('fc-match')
198+
if l:fc_match != ''
199+
let &guifont = system('fc-match -f "%{family[0]} %{size}" monospace:size=10')
200+
let l:wide = system('fc-match -f "%{family[0]} %{size}" monospace:size=10:lang=ja')
201+
exec 'set guifontwide=' . fnameescape(l:wide)
202+
call assert_equal(l:wide, &guifontwide)
203+
else
204+
let skipped = 3
205+
endif
206+
207+
let &guifontwide = l:guifontwide_saved
208+
let &guifont = l:guifont_saved
209+
210+
elseif has('gui_athena') || has('gui_motif')
211+
" guifontwide is premised upon the xfontset feature.
212+
if has('xfontset')
213+
let l:encoding_saved = &encoding
214+
let l:guifont_saved = &guifont
215+
let l:guifontset_saved = &guifontset
216+
let l:guifontwide_saved = &guifontwide
217+
218+
let l:nfont = '-misc-fixed-medium-r-normal-*-18-120-100-100-c-90-iso10646-1'
219+
let l:wfont = '-misc-fixed-medium-r-normal-*-18-120-100-100-c-180-iso10646-1'
220+
221+
set encoding=utf-8
222+
223+
" Case 1: guifontset is empty
224+
set guifontset=
225+
226+
" Case 1-1: Automatic selection
227+
set guifontwide=
228+
exec 'set guifont=' . l:nfont
229+
call assert_equal(l:wfont, &guifontwide)
230+
231+
" Case 1-2: Manual selection
232+
exec 'set guifontwide=' . l:wfont
233+
exec 'set guifont=' . l:nfont
234+
call assert_equal(l:wfont, &guifontwide)
235+
236+
" Case 2: guifontset is invalid
237+
try
238+
set guifontset=-*-notexist-*
239+
call assert_false(1, "'set guifontset=notexist' should have failed")
240+
catch
241+
call assert_exception('E598')
242+
endtry
243+
" Set it to an invalid value brutally for preparation.
244+
let &guifontset = '-*-notexist-*'
245+
246+
" Case 2-1: Automatic selection
247+
set guifontwide=
248+
exec 'set guifont=' . l:nfont
249+
call assert_equal(l:wfont, &guifontwide)
250+
251+
" Case 2-2: Manual selection
252+
exec 'set guifontwide=' . l:wfont
253+
exec 'set guifont=' . l:nfont
254+
call assert_equal(l:wfont, &guifontwide)
255+
256+
let &guifontwide = l:guifontwide_saved
257+
let &guifontset = l:guifontset_saved
258+
let &guifont = l:guifont_saved
259+
let &encoding = l:encoding_saved
260+
else
261+
let skipped = 2
262+
endif
263+
else
264+
let skipped = 1
265+
endif
266+
267+
if skipped == 1
268+
throw "Skipped: Test not implemented yet for this GUI"
269+
elseif skipped == 2
270+
throw "Skipped: Not supported by this GUI"
271+
elseif skipped == 3
272+
throw "Skipped: Test not supported by the environment"
273+
endif
274+
endfunc
275+
134276
func Test_getwinpos()
135277
call assert_match('Window position: X \d\+, Y \d\+', execute('winpos'))
136278
call assert_true(getwinposx() >= 0)

src/version.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,12 @@ static char *(features[]) =
779779

780780
static int included_patches[] =
781781
{ /* Add new patch number below this line */
782+
/**/
783+
329,
784+
/**/
785+
328,
786+
/**/
787+
327,
782788
/**/
783789
326,
784790
/**/

0 commit comments

Comments
 (0)