Compare commits

...

6 Commits

Author SHA1 Message Date
f38c86eb6b patch 8.0.1352: dead URLs in the help go unnoticed
Problem:    Dead URLs in the help go unnoticed.
Solution:   Add a script to check URLs in the help files. (Christian Brabandt)
2017-11-28 14:19:07 +01:00
bdb8139098 patch 8.0.1351: warning for unused variables building with MinGW
Problem:    Warning for unused variables building with MinGW.
Solution:   Change a few #ifdefs (suggested by John Marriott). Remove
            superfluous checks of FEAT_MBYTE.
2017-11-27 23:24:08 +01:00
1355aad2b9 patch 8.0.1350: cannot build with +eval and -multi_byte
Problem:    Cannot build with +eval and -multi_byte.
Solution:   Adjust #ifdefs. (John Marriott)  Always include the multi_byte
            feature when an input method feature is enabled.
2017-11-27 22:49:01 +01:00
17471e84a7 patch 8.0.1349: options test fails when using Motif or GTK GUI
Problem:    Options test fails when using Motif or GTK GUI.
Solution:   Use "fixed" instead of "fixedsys" for Unix. Don't try "xxx" for
            guifonteset.  Don't set 'termencoding' to anything but "utf-8" for
            GTK.  Give an error if 'termencoding' can't be converted.
2017-11-26 23:47:18 +01:00
c8c75796a6 patch 8.0.1348: make testclean deletes script file on MS-Windows
Problem:    Make testclean deletes script file on MS-Windows.
Solution:   Rename file to avoid it starting with an "x".
2017-11-26 17:18:06 +01:00
e0aa23f7e3 patch 8.0.1347: MS-Windows: build broken by misplaced curly
Problem:    MS-Windows: build broken by misplaced curly.
Solution:   Move curly after #endif
2017-11-26 17:08:03 +01:00
10 changed files with 123 additions and 24 deletions

View File

@ -119,7 +119,6 @@ SRC_ALL = \
src/testdir/test[0-9]*a.ok \
src/testdir/test_[a-z]*.ok \
src/testdir/test49.vim \
src/testdir/test60.vim \
src/testdir/test83-tags? \
src/testdir/test77a.com \
src/testdir/test_*.vim \
@ -138,7 +137,7 @@ SRC_ALL = \
src/testdir/samples/*.txt \
src/testdir/samples/test000 \
src/testdir/if_ver*.vim \
src/testdir/xterm_ramp.vim \
src/testdir/color_ramp.vim \
src/proto.h \
src/proto/arabic.pro \
src/proto/beval.pro \
@ -585,6 +584,7 @@ RT_ALL = \
runtime/doc/*.txt \
runtime/doc/Makefile \
runtime/doc/doctags.c \
runtime/doc/test_urls.vim \
runtime/doc/vim.1 \
runtime/doc/evim.1 \
runtime/doc/vimdiff.1 \

68
runtime/doc/test_urls.vim Normal file
View File

@ -0,0 +1,68 @@
" Test for URLs in help documents.
"
" Opens a new window with all found URLS followed by return code from curl
" (anything other than 0 means unreachable)
"
" Written by Christian Brabandt.
func Test_check_URLs()
if has("win32")
echoerr "Doesn't work on MS-Windows"
return
endif
if executable('curl')
" Note: does not follow redirects!
let s:command = 'curl --silent --fail --output /dev/null --head '
elseif executable('wget')
" Note: only allow a couple of redirects
let s:command = 'wget --quiet -S --spider --max-redirect=2 --timeout=5 --tries=2 -O /dev/null '
else
echoerr 'Only works when "curl" or "wget" is available'
return
endif
let pat='\(https\?\|ftp\)://[^\t* ]\+'
exe 'helpgrep' pat
helpclose
let urls = map(getqflist(), 'v:val.text')
" do not use submatch(1)!
let urls = map(urls, {key, val -> matchstr(val, pat)})
" remove examples like user@host (invalid urls)
let urls = filter(urls, 'v:val !~ "@"')
" Remove example URLs which are invalid
let urls = filter(urls, {key, val -> val !~ '\<\(\(my\|some\)\?host\|machine\|hostname\|file\)\>'})
new
put =urls
" remove some more invalid items
" empty lines
v/./d
" remove # anchors
%s/#.*$//e
" remove trailing stuff (parenthesis, dot, comma, quotes), but only for HTTP
" links
g/^h/s#[.,)'"/>][:.]\?$##
g#^[hf]t\?tp:/\(/\?\.*\)$#d
silent! g/ftp://,$/d
silent! g/=$/d
let a = getline(1,'$')
let a = uniq(sort(a))
%d
call setline(1, a)
" Do the testing.
set nomore
%s/.*/\=TestURL(submatch(0))/
" highlight the failures
/.* \([0-9]*[1-9]\|[0-9]\{2,}\)$
endfunc
func TestURL(url)
" Relies on the return code to determine whether a page is valid
echom printf("Testing URL: %d/%d %s", line('.'), line('$'), a:url)
call system(s:command . shellescape(a:url))
return printf("%s %d", a:url, v:shell_error)
endfunc
call Test_check_URLs()

View File

@ -2052,8 +2052,8 @@ write_viminfo(char_u *file, int forceit)
/* can't stat the file, set conservative permissions */
(void)mch_setperm(tempname, 0600);
}
}
#endif
}
/*
* Check if the new viminfo file can be written to.

View File

@ -635,7 +635,8 @@
/* #define FEAT_MBYTE_IME */
# endif
#if defined(FEAT_MBYTE_IME) && !defined(FEAT_MBYTE)
/* Input methods are only useful with +multi_byte. */
#if (defined(FEAT_MBYTE_IME) || defined(FEAT_XIM)) && !defined(FEAT_MBYTE)
# define FEAT_MBYTE
#endif

View File

@ -498,9 +498,11 @@ static void TrackUserActivity(UINT uMsg);
*
* These LOGFONT used for IME.
*/
#ifdef FEAT_MBYTE
#if defined(FEAT_MBYTE_IME) || defined(GLOBAL_IME)
/* holds LOGFONT for 'guifontwide' if available, otherwise 'guifont' */
static LOGFONT norm_logfont;
#endif
#ifdef FEAT_MBYTE_IME
/* holds LOGFONT for 'guifont' always. */
static LOGFONT sub_logfont;
#endif
@ -3361,6 +3363,8 @@ gui_mch_init_font(char_u *font_name, int fontset UNUSED)
font_name = (char_u *)lf.lfFaceName;
#if defined(FEAT_MBYTE_IME) || defined(GLOBAL_IME)
norm_logfont = lf;
#endif
#ifdef FEAT_MBYTE_IME
sub_logfont = lf;
#endif
#ifdef FEAT_MBYTE_IME
@ -5794,15 +5798,15 @@ gui_mch_set_sp_color(guicolor_T color)
gui.currSpColor = color;
}
#if defined(FEAT_MBYTE) && defined(FEAT_MBYTE_IME)
#ifdef FEAT_MBYTE_IME
/*
* Multi-byte handling, originally by Sung-Hoon Baek.
* First static functions (no prototypes generated).
*/
#ifdef _MSC_VER
# include <ime.h> /* Apparently not needed for Cygwin, MingW or Borland. */
#endif
#include <imm.h>
# ifdef _MSC_VER
# include <ime.h> /* Apparently not needed for Cygwin, MingW or Borland. */
# endif
# include <imm.h>
/*
* handle WM_IME_NOTIFY message
@ -5954,7 +5958,7 @@ GetResultStr(HWND hwnd, int GCS, int *lenp)
#endif
/* For global functions we need prototypes. */
#if (defined(FEAT_MBYTE) && defined(FEAT_MBYTE_IME)) || defined(PROTO)
#if defined(FEAT_MBYTE_IME) || defined(PROTO)
/*
* set font to IM.
@ -6079,7 +6083,7 @@ im_get_status(void)
return status;
}
#endif /* FEAT_MBYTE && FEAT_MBYTE_IME */
#endif /* FEAT_MBYTE_IME */
#if defined(FEAT_MBYTE) && !defined(FEAT_MBYTE_IME) && defined(GLOBAL_IME)
/* Win32 with GLOBAL IME */

View File

@ -4790,7 +4790,7 @@ iconv_end(void)
# define USE_IMSTATUSFUNC (*p_imsf != NUL)
#endif
#ifdef FEAT_EVAL
#if defined(FEAT_EVAL) && defined(FEAT_MBYTE)
static void
call_imactivatefunc(int active)
{
@ -6486,7 +6486,7 @@ static int im_was_set_active = FALSE;
int
im_get_status()
{
# ifdef FEAT_EVAL
# if defined(FEAT_MBYTE) && defined(FEAT_EVAL)
if (USE_IMSTATUSFUNC)
return call_imstatusfunc();
# endif

View File

@ -6369,8 +6369,13 @@ did_set_string_option(
* display output conversion. */
if (((varp == &p_enc && *p_tenc != NUL) || varp == &p_tenc))
{
convert_setup(&input_conv, p_tenc, p_enc);
convert_setup(&output_conv, p_enc, p_tenc);
if (convert_setup(&input_conv, p_tenc, p_enc) == FAIL
|| convert_setup(&output_conv, p_enc, p_tenc) == FAIL)
{
EMSG3(_("E950: Cannot convert between %s and %s"),
p_tenc, p_enc);
errmsg = e_invarg;
}
}
# if defined(WIN3264) && defined(FEAT_MBYTE)

View File

@ -11,7 +11,8 @@ endfor
for nr in range(8, 15)
let s .= "\033[10" . (nr - 8) . "m "
endfor
let s .= "\033[107m|"
" Add | in original color pair to see white background.
let s .= "\033[m|"
call setline(2, s)
" 6 x 6 x 6 color cube
@ -22,7 +23,7 @@ for high in range(0, 5)
let nr = low + high * 36
let s .= "\033[48;5;" . (nr + 16) . "m "
endfor
let s .= "\033[107m|"
let s .= "\033[m|"
call setline(high + 4, s)
endfor
@ -32,9 +33,9 @@ let s = ''
for nr in range(0, 23)
let s .= "\033[48;5;" . (nr + 232) . "m "
endfor
let s .= "\033[107m|"
let s .= "\033[m|"
call setline(11, s)
set binary
write! <sfile>:h/xterm_ramp.txt
write! <sfile>:h/color_ramp.txt
quit

View File

@ -19,6 +19,9 @@ let script = [
/#define p_term
let end = line('.')
" font name that works everywhere (hopefully)
let fontname = has('win32') ? 'fixedsys' : 'fixed'
" Two lists with values: values that work and values that fail.
" When not listed, "othernum" or "otherstring" is used.
let test_values = {
@ -93,8 +96,9 @@ let test_values = {
\ 'foldmarker': [['((,))'], ['', 'xxx']],
\ 'formatoptions': [['', 'vt', 'v,t'], ['xxx']],
\ 'guicursor': [['', 'n:block-Cursor'], ['xxx']],
\ 'guifont': [['', 'fixedsys'], []],
\ 'guifontwide': [['', 'fixedsys'], []],
\ 'guifont': [['', fontname], []],
\ 'guifontwide': [['', fontname], []],
\ 'guifontset': [['', fontname], []],
\ 'helplang': [['', 'de', 'de,it'], ['xxx']],
\ 'highlight': [['', 'e:Error'], ['xxx']],
\ 'imactivatekey': [['', 'S-space'], ['xxx']],
@ -126,6 +130,7 @@ let test_values = {
\ 'tagcase': [['smart', 'match'], ['', 'xxx', 'smart,match']],
\ 'term': [[], []],
\ 'termsize': [['', '24x80', '0x80', '32x0', '0x0'], ['xxx', '80', '8ax9', '24x80b']],
\ 'termencoding': [has('gui_gtk') ? [] : ['', 'utf-8'], ['xxx']],
\ 'toolbar': [['', 'icons', 'text'], ['xxx']],
\ 'toolbariconsize': [['', 'tiny', 'huge'], ['xxx']],
\ 'ttymouse': [['', 'xterm'], ['xxx']],
@ -189,8 +194,11 @@ while 1
call add(script, "endif")
endif
call add(script, 'set ' . name . '&')
call add(script, 'set ' . shortname . '&')
" cannot change 'termencoding' in GTK
if name != 'termencoding' || !has('gui_gtk')
call add(script, 'set ' . name . '&')
call add(script, 'set ' . shortname . '&')
endif
if name == 'verbosefile'
call add(script, 'call delete("xxx")')
endif

View File

@ -771,6 +771,18 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1352,
/**/
1351,
/**/
1350,
/**/
1349,
/**/
1348,
/**/
1347,
/**/
1346,
/**/