Merge branch 'vim'

Conflicts:
	src/auto/configure
	src/if_ruby.c
	src/os_unix.c
This commit is contained in:
Bjorn Winckler
2011-09-11 10:39:17 +02:00
46 changed files with 875 additions and 412 deletions
+43
View File
@@ -1595,3 +1595,46 @@ c296c225736e4489706c62c95752a0c4788be1d3 v7-3-256
bdc3335bd72eea207b28fcf8af90a73c855c8847 v7-3-258
59130cd78dfc73bd04f22d201b8f7c0772d98e79 v7-3-259
cb4682b959098e486977eb4b5969c9eb07d2798e v7-3-260
410d42e3d4da09284394456186143d595e9b2efc v7-3-261
847733973bfdd716bfafc364a4102e76f88e7fe8 v7-3-262
a56259157c935b4e78e9f5f4dfb1436e3461eefb v7-3-263
aa40bddeea9a44c6c6b4ffa32c1ef373df437a16 v7-3-264
eff686fb8de66a26367f5e6430d34729f1a0e336 v7-3-265
25be7c9dda549e4cfa1eb57937dc2b38b3d1e997 v7-3-266
ad404f2a4bfa5374e97f29335f41b7ef34cd6bfa v7-3-267
ee17ee712512451a54046d6bcd3ddb9f70cb5cdf v7-3-268
7f4f5ca70dbde4e31c2de494b982bfb9bd71ed75 v7-3-269
b9182da84c7eeda221e5219ef4361cca201b3b41 v7-3-270
32a52f06f33b9e2d4817330099b410c1fcf64db2 v7-3-271
02f5abca10aee570d5a9cf00928ffaa663daba66 v7-3-272
7d4e5e31d8c10c767cdf774a2b13aedd2f95f096 v7-3-273
1bb6776fa8c445e0b3f9dd2ed14fdf2a56f5873e v7-3-274
125c7bf52271461dfbf46cc33317eadc67aaf742 v7-3-275
37a54a85413eae68932233e64a0ab88c99c9d811 v7-3-276
e5b17a5f651696ad4c523a21822692115d371250 v7-3-277
6622f28b7e87a93de6f1520945d1c5d2a1fc0dab v7-3-278
342b176089678e86cde3e1afac4aaaa1e5153f99 v7-3-279
58bba69b3371d9ff02b27fe24f044e229c8aa99a v7-3-280
45ead8a0bedeade57c320d72e9f710a703e61cf0 v7-3-281
92167bb91c95410a0550ff8c94370307bb7d9d80 v7-3-282
47b6d37b60122f45eb147106b8da1322c1cdbc60 v7-3-283
27d43855b72312500e6fc2122e167a579a1f35f2 v7-3-284
6018c815e1205e7db9328fe6ed91b26b514465f3 v7-3-285
3f822e54765c54a1112a953e3c37bb60185fd51c v7-3-286
07bc2ccfe5559035e785f22851365b3a31dec67e v7-3-287
e4f3fa1a474e677dce486ea07ee31270f92b2b4a v7-3-288
44ffd0a8abcdba441216514cb711649eb1169876 v7-3-289
df33dba4e553f8fa27ba467042f16315c613a00d v7-3-290
e8ee4b4ebf41abb199ea9a9e9cc38f9b0c2f7192 v7-3-291
b6af1c5dd22f08db2b9e52ae763f193ba82965ad v7-3-292
6cd0d6413a2e03687aca8138b2843f1f2aac5b84 v7-3-293
dbd73fe939cf772a8b07c19230e5ee60aa0cfcc7 v7-3-294
0d8494c051131b6470fe8af67646e235bc63fcf7 v7-3-295
c19c15a9e9bf2914b25748c0544936e84a5c77c0 v7-3-296
22550986c713ce5f37f069f0c8f99a54dc4a421b v7-3-297
43b1d031e3028248abcbd5099841d3aafda7f68d v7-3-298
eb4972982bfea006ead5b461f319744d5ecd58f5 v7-3-299
2665b456ee59652c7b590dff0fa522ce337e0f16 v7-3-300
4a70971530899e32058207cae683a69e7b8f85dc v7-3-301
61b2f26623104f75850b1568bf61663597fe7fb0 v7-3-302
d832d642f520d426f111b35102450617922547d3 v7-3-303
+14 -6
View File
@@ -142,6 +142,7 @@ static char *null_libintl_bindtextdomain(const char *, const char *);
static int dyn_libintl_init(char *dir);
static void dyn_libintl_end(void);
static wchar_t *oldenv = NULL;
static HINSTANCE hLibintlDLL = 0;
static char *(*dyn_libintl_gettext)(const char *) = null_libintl_gettext;
static char *(*dyn_libintl_textdomain)(const char *) = null_libintl_textdomain;
@@ -339,8 +340,10 @@ DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /* lpReserved */)
inc_cRefThisDLL()
{
#ifdef FEAT_GETTEXT
if (g_cRefThisDll == 0)
if (g_cRefThisDll == 0) {
dyn_gettext_load();
oldenv = GetEnvironmentStringsW();
}
#endif
InterlockedIncrement((LPLONG)&g_cRefThisDll);
}
@@ -349,8 +352,13 @@ inc_cRefThisDLL()
dec_cRefThisDLL()
{
#ifdef FEAT_GETTEXT
if (InterlockedDecrement((LPLONG)&g_cRefThisDll) == 0)
if (InterlockedDecrement((LPLONG)&g_cRefThisDll) == 0) {
dyn_gettext_free();
if (oldenv != NULL) {
FreeEnvironmentStringsW(oldenv);
oldenv = NULL;
}
}
#else
InterlockedDecrement((LPLONG)&g_cRefThisDll);
#endif
@@ -905,8 +913,8 @@ STDMETHODIMP CShellExt::InvokeGvim(HWND hParent,
NULL, // Process handle not inheritable.
NULL, // Thread handle not inheritable.
FALSE, // Set handle inheritance to FALSE.
0, // No creation flags.
NULL, // Use parent's environment block.
oldenv == NULL ? 0 : CREATE_UNICODE_ENVIRONMENT,
oldenv, // Use unmodified environment block.
NULL, // Use parent's starting directory.
&si, // Pointer to STARTUPINFO structure.
&pi) // Pointer to PROCESS_INFORMATION structure.
@@ -987,8 +995,8 @@ STDMETHODIMP CShellExt::InvokeSingleGvim(HWND hParent,
NULL, // Process handle not inheritable.
NULL, // Thread handle not inheritable.
FALSE, // Set handle inheritance to FALSE.
0, // No creation flags.
NULL, // Use parent's environment block.
oldenv == NULL ? 0 : CREATE_UNICODE_ENVIRONMENT,
oldenv, // Use unmodified environment block.
NULL, // Use parent's starting directory.
&si, // Pointer to STARTUPINFO structure.
&pi) // Pointer to PROCESS_INFORMATION structure.
+2 -3
View File
@@ -549,7 +549,7 @@ static BOOL VimOpenFile(BSTR& FileName, long LineNr)
if (g_bNewTabs)
{
sprintf(VimCmd, ":tab drop ");
s = VimCmd + 11;
s = VimCmd + 10;
}
else
{
@@ -557,8 +557,7 @@ static BOOL VimOpenFile(BSTR& FileName, long LineNr)
s = VimCmd + 6;
}
sprintf(FileNameTmp, "%S", (char *)FileName);
for (p = FileNameTmp; *p != '\0' && s < FileNameTmp + MAX_OLE_STR - 4;
++p)
for (p = FileNameTmp; *p != '\0' && s < VimCmd + MAX_OLE_STR - 4; ++p)
if (*p == '\\')
*s++ = '/';
else
+1 -1
View File
@@ -123,7 +123,7 @@
#define DCS 0x90 /* Device Control String */
#define STERM 0x9c /* String Terminator */
#define POUND '£'
#define POUND '\xA3'
#define CTRL_F_STR "\056"
#define CTRL_H_STR "\026"
+3 -3
View File
@@ -5992,7 +5992,7 @@ echo $ECHO_N "checking whether we can do without RTLD_GLOBAL for Python... $ECHO
cflags_save=$CFLAGS
CFLAGS="$CFLAGS $PYTHON_CFLAGS"
ldflags_save=$LDFLAGS
LDFLAGS="$LDFLAGS -ldl"
LDFLAGS="-ldl $LDFLAGS"
if test "$cross_compiling" = yes; then
{ { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
See \`config.log' for more details." >&5
@@ -6083,7 +6083,7 @@ echo $ECHO_N "checking whether we can do without RTLD_GLOBAL for Python3... $ECH
cflags_save=$CFLAGS
CFLAGS="$CFLAGS $PYTHON3_CFLAGS"
ldflags_save=$LDFLAGS
LDFLAGS="$LDFLAGS -ldl"
LDFLAGS="-ldl $LDFLAGS"
if test "$cross_compiling" = yes; then
{ { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
See \`config.log' for more details." >&5
@@ -20625,7 +20625,7 @@ do
cat >>$CONFIG_STATUS <<_ACEOF
# First, check the format of the line:
cat >"\$tmp/defines.sed" <<\\CEOF
/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def
/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*/b def
/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def
b
:def
+3
View File
@@ -346,6 +346,9 @@
/* Define if dynamic python does not require RTLD_GLOBAL */
#undef PY_NO_RTLD_GLOBAL
/* Define if dynamic python3 does not require RTLD_GLOBAL */
#undef PY3_NO_RTLD_GLOBAL
/* Define if you want to include the Ruby interpreter. */
#undef FEAT_RUBY
+4 -2
View File
@@ -1193,7 +1193,8 @@ if test "$python_ok" = yes && test "$python3_ok" = yes; then
cflags_save=$CFLAGS
CFLAGS="$CFLAGS $PYTHON_CFLAGS"
ldflags_save=$LDFLAGS
LDFLAGS="$LDFLAGS -ldl"
dnl -ldl must go first to make this work on Archlinux (Roland Puntaier)
LDFLAGS="-ldl $LDFLAGS"
AC_RUN_IFELSE([
#include <dlfcn.h>
/* If this program fails, then RTLD_GLOBAL is needed.
@@ -1237,7 +1238,8 @@ if test "$python_ok" = yes && test "$python3_ok" = yes; then
cflags_save=$CFLAGS
CFLAGS="$CFLAGS $PYTHON3_CFLAGS"
ldflags_save=$LDFLAGS
LDFLAGS="$LDFLAGS -ldl"
dnl -ldl must go first to make this work on Archlinux (Roland Puntaier)
LDFLAGS="-ldl $LDFLAGS"
AC_RUN_IFELSE([
#include <dlfcn.h>
#include <wchar.h>
+16 -12
View File
@@ -1357,7 +1357,11 @@ eval_to_string(arg, nextcmd, convert)
{
ga_init2(&ga, (int)sizeof(char), 80);
if (tv.vval.v_list != NULL)
{
list_join(&ga, tv.vval.v_list, (char_u *)"\n", TRUE, 0);
if (tv.vval.v_list->lv_len > 0)
ga_append(&ga, NL);
}
ga_append(&ga, NUL);
retval = (char_u *)ga.ga_data;
}
@@ -23229,6 +23233,7 @@ modify_fname(src, usedlen, fnamep, bufp, fnamelen)
int c;
int has_fullname = 0;
#ifdef WIN3264
char_u *fname_start = *fnamep;
int has_shortname = 0;
#endif
@@ -23403,24 +23408,25 @@ repeat:
}
#ifdef WIN3264
/* Check shortname after we have done 'heads' and before we do 'tails'
/*
* Handle ":8" after we have done 'heads' and before we do 'tails'.
*/
if (has_shortname)
{
pbuf = NULL;
/* Copy the string if it is shortened by :h */
if (*fnamelen < (int)STRLEN(*fnamep))
/* Copy the string if it is shortened by :h and when it wasn't copied
* yet, because we are going to change it in place. Avoids changing
* the buffer name for "%:8". */
if (*fnamelen < (int)STRLEN(*fnamep) || *fnamep == fname_start)
{
p = vim_strnsave(*fnamep, *fnamelen);
if (p == 0)
if (p == NULL)
return -1;
vim_free(*bufp);
*bufp = *fnamep = p;
}
/* Split into two implementations - makes it easier. First is where
* there isn't a full name already, second is where there is.
*/
* there isn't a full name already, second is where there is. */
if (!has_fullname && !vim_isAbsName(*fnamep))
{
if (shortpath_for_partial(fnamep, bufp, fnamelen) == FAIL)
@@ -23428,18 +23434,16 @@ repeat:
}
else
{
int l;
int l = *fnamelen;
/* Simple case, already have the full-name
/* Simple case, already have the full-name.
* Nearly always shorter, so try first time. */
l = *fnamelen;
if (get_short_pathname(fnamep, bufp, &l) == FAIL)
return -1;
if (l == 0)
{
/* Couldn't find the filename.. search the paths.
*/
/* Couldn't find the filename, search the paths. */
l = *fnamelen;
if (shortpath_for_invalid_fname(fnamep, bufp, &l) == FAIL)
return -1;
+18 -7
View File
@@ -67,7 +67,7 @@ static int hislen = 0; /* actual length of history tables */
static int hist_char2type __ARGS((int c));
static int in_history __ARGS((int, char_u *, int));
static int in_history __ARGS((int, char_u *, int, int));
# ifdef FEAT_EVAL
static int calc_hist_idx __ARGS((int histype, int num));
# endif
@@ -1977,8 +1977,12 @@ getcmdline_prompt(firstc, prompt, attr, xp_context, xp_arg)
# endif
s = getcmdline(firstc, 1L, 0);
restore_cmdline(&save_ccline);
/* Restore msg_col, the prompt from input() may have changed it. */
msg_col = msg_col_save;
/* Restore msg_col, the prompt from input() may have changed it.
* But only if called recursively and the commandline is therefore being
* restored to an old one; if not, the input() prompt stays on the screen,
* so we need its modified msg_col left intact. */
if (ccline.cmdbuff != NULL)
msg_col = msg_col_save;
return s;
}
@@ -5303,13 +5307,15 @@ init_history()
* If 'move_to_front' is TRUE, matching entry is moved to end of history.
*/
static int
in_history(type, str, move_to_front)
in_history(type, str, move_to_front, sep)
int type;
char_u *str;
int move_to_front; /* Move the entry to the front if it exists */
int sep;
{
int i;
int last_i = -1;
char_u *p;
if (hisidx[type] < 0)
return FALSE;
@@ -5318,7 +5324,12 @@ in_history(type, str, move_to_front)
{
if (history[type][i].hisstr == NULL)
return FALSE;
if (STRCMP(str, history[type][i].hisstr) == 0)
/* For search history, check that the separator character matches as
* well. */
p = history[type][i].hisstr;
if (STRCMP(str, p) == 0
&& (type != HIST_SEARCH || sep == p[STRLEN(p) + 1]))
{
if (!move_to_front)
return TRUE;
@@ -5412,7 +5423,7 @@ add_to_history(histype, new_entry, in_map, sep)
}
last_maptick = -1;
}
if (!in_history(histype, new_entry, TRUE))
if (!in_history(histype, new_entry, TRUE, sep))
{
if (++hisidx[histype] == hislen)
hisidx[histype] = 0;
@@ -5991,7 +6002,7 @@ read_viminfo_history(virp)
if (val != NULL && *val != NUL)
{
if (!in_history(type, val + (type == HIST_SEARCH),
viminfo_add_at_front))
viminfo_add_at_front, *val))
{
/* Need to re-allocate to append the separator byte. */
len = STRLEN(val);
+16 -2
View File
@@ -3342,8 +3342,22 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
}
else if (reset_changed && whole)
{
if (!(did_cmd = apply_autocmds_exarg(EVENT_BUFWRITECMD,
sfname, sfname, FALSE, curbuf, eap)))
int was_changed = curbufIsChanged();
did_cmd = apply_autocmds_exarg(EVENT_BUFWRITECMD,
sfname, sfname, FALSE, curbuf, eap);
if (did_cmd)
{
if (was_changed && !curbufIsChanged())
{
/* Written everything correctly and BufWriteCmd has reset
* 'modified': Correct the undo information so that an
* undo now sets 'modified'. */
u_unchanged(curbuf);
u_update_save_nr(curbuf);
}
}
else
{
#ifdef FEAT_QUICKFIX
if (overwriting && bt_nofile(curbuf))
+6 -3
View File
@@ -1469,11 +1469,14 @@ deleteFoldEntry(gap, idx, recursive)
}
else
{
/* move nested folds one level up, to overwrite the fold that is
/* Move nested folds one level up, to overwrite the fold that is
* deleted. */
moved = fp->fd_nested.ga_len;
if (ga_grow(gap, (int)(moved - 1)) == OK)
{
/* Get "fp" again, the array may have been reallocated. */
fp = (fold_T *)gap->ga_data + idx;
/* adjust fd_top and fd_flags for the moved folds */
nfp = (fold_T *)fp->fd_nested.ga_data;
for (i = 0; i < moved; ++i)
@@ -1486,9 +1489,9 @@ deleteFoldEntry(gap, idx, recursive)
}
/* move the existing folds down to make room */
if (idx < gap->ga_len)
if (idx + 1 < gap->ga_len)
mch_memmove(fp + moved, fp + 1,
sizeof(fold_T) * (gap->ga_len - idx));
sizeof(fold_T) * (gap->ga_len - (idx + 1)));
/* move the contained folds one level up */
mch_memmove(fp, nfp, (size_t)(sizeof(fold_T) * moved));
vim_free(nfp);
+28 -4
View File
@@ -3262,9 +3262,9 @@ do_map(maptype, arg, mode, abbrev)
validate_maphash();
/*
* find end of keys and skip CTRL-Vs (and backslashes) in it
* Find end of keys and skip CTRL-Vs (and backslashes) in it.
* Accept backslash like CTRL-V when 'cpoptions' does not contain 'B'.
* with :unmap white space is included in the keys, no argument possible
* with :unmap white space is included in the keys, no argument possible.
*/
p = keys;
do_backslash = (vim_strchr(p_cpo, CPO_BSLASH) == NULL);
@@ -3964,7 +3964,17 @@ showmap(mp, local)
if (*mp->m_str == NUL)
msg_puts_attr((char_u *)"<Nop>", hl_attr(HLF_8));
else
msg_outtrans_special(mp->m_str, FALSE);
{
/* Remove escaping of CSI, because "m_str" is in a format to be used
* as typeahead. */
char_u *s = vim_strsave(mp->m_str);
if (s != NULL)
{
vim_unescape_csi(s);
msg_outtrans_special(s, FALSE);
vim_free(s);
}
}
#ifdef FEAT_EVAL
if (p_verbose > 0)
last_set_msg(mp->m_script_ID);
@@ -4506,12 +4516,23 @@ eval_map_expr(str, c)
{
char_u *res;
char_u *p;
char_u *expr;
char_u *save_cmd;
pos_T save_cursor;
/* Remove escaping of CSI, because "str" is in a format to be used as
* typeahead. */
expr = vim_strsave(str);
if (expr == NULL)
return NULL;
vim_unescape_csi(expr);
save_cmd = save_cmdline_alloc();
if (save_cmd == NULL)
{
vim_free(expr);
return NULL;
}
/* Forbid changing text or using ":normal" to avoid most of the bad side
* effects. Also restore the cursor position. */
@@ -4521,7 +4542,7 @@ eval_map_expr(str, c)
#endif
set_vim_var_char(c); /* set v:char to the typed character */
save_cursor = curwin->w_cursor;
p = eval_to_string(str, NULL, FALSE);
p = eval_to_string(expr, NULL, FALSE);
--textlock;
#ifdef FEAT_EX_EXTRA
--ex_normal_lock;
@@ -4529,8 +4550,11 @@ eval_map_expr(str, c)
curwin->w_cursor = save_cursor;
restore_cmdline_alloc(save_cmd);
vim_free(expr);
if (p == NULL)
return NULL;
/* Escape CSI in the result to be able to use the string as typeahead. */
res = vim_strsave_escape_csi(p);
vim_free(p);
+1 -1
View File
@@ -1428,7 +1428,7 @@ gui_set_shellsize(mustset, fit_to_display, direction)
if (!gui.shell_created)
return;
#ifdef MSWIN
#if defined(MSWIN) || defined(FEAT_GUI_GTK)
/* If not setting to a user specified size and maximized, calculate the
* number of characters that fit in the maximized window. */
if (!mustset && gui_mch_maximized())
+16 -6
View File
@@ -3899,6 +3899,21 @@ gui_mch_unmaximize()
gtk_window_unmaximize(GTK_WINDOW(gui.mainwin));
}
/*
* Called when the font changed while the window is maximized. Compute the
* new Rows and Columns. This is like resizing the window.
*/
void
gui_mch_newfont()
{
int w, h;
gtk_window_get_size(GTK_WINDOW(gui.mainwin), &w, &h);
w -= get_menu_tool_width();
h -= get_menu_tool_height();
gui_resize_shell(w, h);
}
/*
* Set the windows size.
*/
@@ -4409,14 +4424,9 @@ gui_mch_init_font(char_u *font_name, int fontset UNUSED)
if (gui_mch_maximized())
{
int w, h;
/* Update lines and columns in accordance with the new font, keep the
* window maximized. */
gtk_window_get_size(GTK_WINDOW(gui.mainwin), &w, &h);
w -= get_menu_tool_width();
h -= get_menu_tool_height();
gui_resize_shell(w, h);
gui_mch_newfont();
}
else
{
+227 -227
View File
File diff suppressed because it is too large Load Diff
+23 -2
View File
@@ -1270,6 +1270,25 @@ gui_mch_prepare(int *argc, char **argv)
pGetMonitorInfo = (TGetMonitorInfo)GetProcAddress(user32_lib,
"GetMonitorInfoA");
}
#ifdef FEAT_MBYTE
/* If the OS is Windows NT, use wide functions;
* this enables common dialogs input unicode from IME. */
if (os_version.dwPlatformId == VER_PLATFORM_WIN32_NT)
{
pDispatchMessage = DispatchMessageW;
pGetMessage = GetMessageW;
pIsDialogMessage = IsDialogMessageW;
pPeekMessage = PeekMessageW;
}
else
{
pDispatchMessage = DispatchMessageA;
pGetMessage = GetMessageA;
pIsDialogMessage = IsDialogMessageA;
pPeekMessage = PeekMessageA;
}
#endif
}
/*
@@ -1379,7 +1398,8 @@ gui_mch_init(void)
s_hwnd = CreateWindowEx(
WS_EX_MDICHILD,
szVimWndClass, "Vim MSWindows GUI",
WS_OVERLAPPEDWINDOW | WS_CHILD | WS_CLIPSIBLINGS | 0xC000,
WS_OVERLAPPEDWINDOW | WS_CHILD
| WS_CLIPSIBLINGS | WS_CLIPCHILDREN | 0xC000,
gui_win_x == -1 ? CW_USEDEFAULT : gui_win_x,
gui_win_y == -1 ? CW_USEDEFAULT : gui_win_y,
100, /* Any value will do */
@@ -1410,7 +1430,8 @@ gui_mch_init(void)
* titlebar, it will be reparented below. */
s_hwnd = CreateWindow(
szVimWndClass, "Vim MSWindows GUI",
win_socket_id == 0 ? WS_OVERLAPPEDWINDOW : WS_POPUP,
(win_socket_id == 0 ? WS_OVERLAPPEDWINDOW : WS_POPUP)
| WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
gui_win_x == -1 ? CW_USEDEFAULT : gui_win_x,
gui_win_y == -1 ? CW_USEDEFAULT : gui_win_y,
100, /* Any value will do */
+18 -18
View File
@@ -390,7 +390,7 @@ _OnBlinkTimer(
KillTimer(NULL, idEvent);
/* Eat spurious WM_TIMER messages */
while (PeekMessage(&msg, hwnd, WM_TIMER, WM_TIMER, PM_REMOVE))
while (pPeekMessage(&msg, hwnd, WM_TIMER, WM_TIMER, PM_REMOVE))
;
if (blink_state == BLINK_ON)
@@ -418,7 +418,7 @@ gui_mswin_rm_blink_timer(void)
{
KillTimer(NULL, blink_timer);
/* Eat spurious WM_TIMER messages */
while (PeekMessage(&msg, s_hwnd, WM_TIMER, WM_TIMER, PM_REMOVE))
while (pPeekMessage(&msg, s_hwnd, WM_TIMER, WM_TIMER, PM_REMOVE))
;
blink_timer = 0;
}
@@ -476,7 +476,7 @@ _OnTimer(
s_timed_out = TRUE;
/* Eat spurious WM_TIMER messages */
while (PeekMessage(&msg, hwnd, WM_TIMER, WM_TIMER, PM_REMOVE))
while (pPeekMessage(&msg, hwnd, WM_TIMER, WM_TIMER, PM_REMOVE))
;
if (idEvent == s_wait_timer)
s_wait_timer = 0;
@@ -1411,12 +1411,12 @@ gui_mch_get_color(char_u *name)
static guicolor_tTable table[] =
{
{"Black", RGB(0x00, 0x00, 0x00)},
{"DarkGray", RGB(0x80, 0x80, 0x80)},
{"DarkGrey", RGB(0x80, 0x80, 0x80)},
{"DarkGray", RGB(0xA9, 0xA9, 0xA9)},
{"DarkGrey", RGB(0xA9, 0xA9, 0xA9)},
{"Gray", RGB(0xC0, 0xC0, 0xC0)},
{"Grey", RGB(0xC0, 0xC0, 0xC0)},
{"LightGray", RGB(0xE0, 0xE0, 0xE0)},
{"LightGrey", RGB(0xE0, 0xE0, 0xE0)},
{"LightGray", RGB(0xD3, 0xD3, 0xD3)},
{"LightGrey", RGB(0xD3, 0xD3, 0xD3)},
{"Gray10", RGB(0x1A, 0x1A, 0x1A)},
{"Grey10", RGB(0x1A, 0x1A, 0x1A)},
{"Gray20", RGB(0x33, 0x33, 0x33)},
@@ -1441,19 +1441,19 @@ gui_mch_get_color(char_u *name)
{"LightRed", RGB(0xFF, 0xA0, 0xA0)},
{"DarkBlue", RGB(0x00, 0x00, 0x80)},
{"Blue", RGB(0x00, 0x00, 0xFF)},
{"LightBlue", RGB(0xA0, 0xA0, 0xFF)},
{"LightBlue", RGB(0xAD, 0xD8, 0xE6)},
{"DarkGreen", RGB(0x00, 0x80, 0x00)},
{"Green", RGB(0x00, 0xFF, 0x00)},
{"LightGreen", RGB(0xA0, 0xFF, 0xA0)},
{"LightGreen", RGB(0x90, 0xEE, 0x90)},
{"DarkCyan", RGB(0x00, 0x80, 0x80)},
{"Cyan", RGB(0x00, 0xFF, 0xFF)},
{"LightCyan", RGB(0xA0, 0xFF, 0xFF)},
{"LightCyan", RGB(0xE0, 0xFF, 0xFF)},
{"DarkMagenta", RGB(0x80, 0x00, 0x80)},
{"Magenta", RGB(0xFF, 0x00, 0xFF)},
{"LightMagenta", RGB(0xFF, 0xA0, 0xFF)},
{"Brown", RGB(0x80, 0x40, 0x40)},
{"Yellow", RGB(0xFF, 0xFF, 0x00)},
{"LightYellow", RGB(0xFF, 0xFF, 0xA0)},
{"LightYellow", RGB(0xFF, 0xFF, 0xE0)},
{"DarkYellow", RGB(0xBB, 0xBB, 0x00)},
{"SeaGreen", RGB(0x2E, 0x8B, 0x57)},
{"Orange", RGB(0xFF, 0xA5, 0x00)},
@@ -1707,7 +1707,7 @@ process_message(void)
static char_u k10[] = {K_SPECIAL, 'k', ';', 0};
#endif
GetMessage(&msg, NULL, 0, 0);
pGetMessage(&msg, NULL, 0, 0);
#ifdef FEAT_OLE
/* Look after OLE Automation commands */
@@ -1718,7 +1718,7 @@ process_message(void)
{
/* Message can't be ours, forward it. Fixes problem with Ultramon
* 3.0.4 */
DispatchMessage(&msg);
pDispatchMessage(&msg);
}
else
{
@@ -1749,14 +1749,14 @@ process_message(void)
if (msg.message == WM_USER)
{
MyTranslateMessage(&msg);
DispatchMessage(&msg);
pDispatchMessage(&msg);
return;
}
#endif
#ifdef MSWIN_FIND_REPLACE
/* Don't process messages used by the dialog */
if (s_findrep_hwnd != NULL && IsDialogMessage(s_findrep_hwnd, &msg))
if (s_findrep_hwnd != NULL && pIsDialogMessage(s_findrep_hwnd, &msg))
{
HandleMouseHide(msg.message, msg.lParam);
return;
@@ -1928,7 +1928,7 @@ process_message(void)
if (vk != VK_F10 || check_map(k10, State, FALSE, TRUE, FALSE,
NULL, NULL) == NULL)
#endif
DispatchMessage(&msg);
pDispatchMessage(&msg);
}
/*
@@ -1943,7 +1943,7 @@ gui_mch_update(void)
MSG msg;
if (!s_busy_processing)
while (PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)
while (pPeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)
&& !vim_is_input_buf_full())
process_message();
}
@@ -2019,7 +2019,7 @@ gui_mch_wait_for_chars(int wtime)
KillTimer(NULL, s_wait_timer);
/* Eat spurious WM_TIMER messages */
while (PeekMessage(&msg, s_hwnd, WM_TIMER, WM_TIMER, PM_REMOVE))
while (pPeekMessage(&msg, s_hwnd, WM_TIMER, WM_TIMER, PM_REMOVE))
;
s_wait_timer = 0;
}
+28 -7
View File
@@ -147,7 +147,12 @@ typedef int perl_key;
# define Perl_save_int dll_Perl_save_int
# define Perl_stack_grow dll_Perl_stack_grow
# define Perl_set_context dll_Perl_set_context
# if (PERL_REVISION == 5) && (PERL_VERSION >= 14)
# define Perl_sv_2bool_flags dll_Perl_sv_2bool_flags
# define Perl_xs_apiversion_bootcheck dll_Perl_xs_apiversion_bootcheck
# else
# define Perl_sv_2bool dll_Perl_sv_2bool
# endif
# define Perl_sv_2iv dll_Perl_sv_2iv
# define Perl_sv_2mortal dll_Perl_sv_2mortal
# if (PERL_REVISION == 5) && (PERL_VERSION >= 8)
@@ -252,7 +257,12 @@ static void (*Perl_push_scope)(pTHX);
static void (*Perl_save_int)(pTHX_ int*);
static SV** (*Perl_stack_grow)(pTHX_ SV**, SV**p, int);
static SV** (*Perl_set_context)(void*);
#if (PERL_REVISION == 5) && (PERL_VERSION >= 14)
static bool (*Perl_sv_2bool_flags)(pTHX_ SV*, I32);
static void (*Perl_xs_apiversion_bootcheck)(pTHX_ SV *module, const char *api_p, STRLEN api_len);
#else
static bool (*Perl_sv_2bool)(pTHX_ SV*);
#endif
static IV (*Perl_sv_2iv)(pTHX_ SV*);
static SV* (*Perl_sv_2mortal)(pTHX_ SV*);
#if (PERL_REVISION == 5) && (PERL_VERSION >= 8)
@@ -360,7 +370,12 @@ static struct {
{"Perl_save_int", (PERL_PROC*)&Perl_save_int},
{"Perl_stack_grow", (PERL_PROC*)&Perl_stack_grow},
{"Perl_set_context", (PERL_PROC*)&Perl_set_context},
#if (PERL_REVISION == 5) && (PERL_VERSION >= 14)
{"Perl_sv_2bool_flags", (PERL_PROC*)&Perl_sv_2bool_flags},
{"Perl_xs_apiversion_bootcheck",(PERL_PROC*)&Perl_xs_apiversion_bootcheck},
#else
{"Perl_sv_2bool", (PERL_PROC*)&Perl_sv_2bool},
#endif
{"Perl_sv_2iv", (PERL_PROC*)&Perl_sv_2iv},
{"Perl_sv_2mortal", (PERL_PROC*)&Perl_sv_2mortal},
#if (PERL_REVISION == 5) && (PERL_VERSION >= 8)
@@ -407,6 +422,9 @@ static struct {
{"Perl_sv_free2", (PERL_PROC*)&Perl_sv_free2},
{"Perl_sys_init", (PERL_PROC*)&Perl_sys_init},
{"Perl_sys_term", (PERL_PROC*)&Perl_sys_term},
{"Perl_call_list", (PERL_PROC*)&Perl_call_list},
# if (PERL_REVISION == 5) && (PERL_VERSION >= 14)
# else
{"Perl_ISv_ptr", (PERL_PROC*)&Perl_ISv_ptr},
{"Perl_Istack_max_ptr", (PERL_PROC*)&Perl_Istack_max_ptr},
{"Perl_Istack_base_ptr", (PERL_PROC*)&Perl_Istack_base_ptr},
@@ -418,15 +436,18 @@ static struct {
{"Perl_Imarkstack_max_ptr", (PERL_PROC*)&Perl_Imarkstack_max_ptr},
{"Perl_Istack_sp_ptr", (PERL_PROC*)&Perl_Istack_sp_ptr},
{"Perl_Iop_ptr", (PERL_PROC*)&Perl_Iop_ptr},
{"Perl_call_list", (PERL_PROC*)&Perl_call_list},
{"Perl_Iscopestack_ix_ptr", (PERL_PROC*)&Perl_Iscopestack_ix_ptr},
{"Perl_Iunitcheckav_ptr", (PERL_PROC*)&Perl_Iunitcheckav_ptr},
# endif
#endif
#if (PERL_REVISION == 5) && (PERL_VERSION >= 14)
#else
{"Perl_Idefgv_ptr", (PERL_PROC*)&Perl_Idefgv_ptr},
{"Perl_Ierrgv_ptr", (PERL_PROC*)&Perl_Ierrgv_ptr},
{"Perl_Isv_yes_ptr", (PERL_PROC*)&Perl_Isv_yes_ptr},
{"boot_DynaLoader", (PERL_PROC*)&boot_DynaLoader},
{"Perl_Gthr_key_ptr", (PERL_PROC*)&Perl_Gthr_key_ptr},
#endif
{"boot_DynaLoader", (PERL_PROC*)&boot_DynaLoader},
{"", NULL},
};
@@ -755,7 +776,7 @@ ex_perl(eap)
#ifdef HAVE_SANDBOX
if (sandbox)
{
safe = perl_get_sv( "VIM::safe", FALSE );
safe = perl_get_sv("VIM::safe", FALSE);
# ifndef MAKE_TEST /* avoid a warning for unreachable code */
if (safe == NULL || !SvTRUE(safe))
EMSG(_("E299: Perl evaluation forbidden in sandbox without the Safe module"));
@@ -1108,7 +1129,7 @@ Cursor(win, ...)
VIWIN win
PPCODE:
if(items == 1)
if (items == 1)
{
EXTEND(sp, 2);
if (!win_valid(win))
@@ -1116,7 +1137,7 @@ Cursor(win, ...)
PUSHs(sv_2mortal(newSViv(win->w_cursor.lnum)));
PUSHs(sv_2mortal(newSViv(win->w_cursor.col)));
}
else if(items == 3)
else if (items == 3)
{
int lnum, col;
@@ -1249,9 +1270,9 @@ Delete(vimbuf, ...)
{
lnum = SvIV(ST(1));
count = 1 + SvIV(ST(2)) - lnum;
if(count == 0)
if (count == 0)
count = 1;
if(count < 0)
if (count < 0)
{
lnum -= count;
count = -count;
+2 -2
View File
@@ -74,7 +74,7 @@ OutputWrite(PyObject *self, PyObject *args)
char *str = NULL;
int error = ((OutputObject *)(self))->error;
if (!PyArg_ParseTuple(args, "es#", ENC_OPT, &str, &len))
if (!PyArg_ParseTuple(args, "et#", ENC_OPT, &str, &len))
return NULL;
Py_BEGIN_ALLOW_THREADS
@@ -114,7 +114,7 @@ OutputWritelines(PyObject *self, PyObject *args)
char *str = NULL;
PyInt len;
if (!PyArg_Parse(line, "es#", ENC_OPT, &str, &len)) {
if (!PyArg_Parse(line, "et#", ENC_OPT, &str, &len)) {
PyErr_SetString(PyExc_TypeError, _("writelines() requires list of strings"));
Py_DECREF(list);
return NULL;
+2 -1
View File
@@ -373,7 +373,8 @@ python_runtime_link_init(char *libname, int verbose)
* standard C extension libraries of one or both python versions. */
if (python3_loaded())
{
EMSG(_("E836: This Vim cannot execute :python after using :py3"));
if (verbose)
EMSG(_("E836: This Vim cannot execute :python after using :py3"));
return FAIL;
}
#endif
+2 -1
View File
@@ -367,7 +367,8 @@ py3_runtime_link_init(char *libname, int verbose)
* standard C extension libraries of one or both python versions. */
if (python_loaded())
{
EMSG(_("E837: This Vim cannot execute :py3 after using :python"));
if (verbose)
EMSG(_("E837: This Vim cannot execute :py3 after using :python"));
return FAIL;
}
# endif
+1
View File
@@ -767,6 +767,7 @@ static VALUE vim_message(VALUE self UNUSED, VALUE str)
str = rb_obj_as_string(str);
if (RSTRING_LEN(str) > 0)
{
/* Only do this when the string isn't empty, alloc(0) causes trouble. */
buff = ALLOCA_N(char, RSTRING_LEN(str));
strcpy(buff, RSTRING_PTR(str));
p = strchr(buff, '\n');
+3 -3
View File
@@ -1884,14 +1884,14 @@ tclexit(error)
{
int newerr = OK;
if (error == TCL_EXIT )
if (error == TCL_EXIT)
{
int retval;
char buf[50];
Tcl_Obj *robj;
robj = Tcl_GetObjResult(tclinfo.interp);
if( Tcl_GetIntFromObj(tclinfo.interp, robj, &retval) != TCL_OK )
if (Tcl_GetIntFromObj(tclinfo.interp, robj, &retval) != TCL_OK)
{
EMSG(_("E281: TCL ERROR: exit code is not int!? Please report this to vim-dev@vim.org"));
newerr = FAIL;
@@ -1900,7 +1900,7 @@ tclexit(error)
{
sprintf(buf, _("E572: exit code %d"), retval);
tclerrmsg(buf);
if (retval == 0 )
if (retval == 0)
{
did_emsg = 0;
newerr = OK;
+25
View File
@@ -837,6 +837,27 @@ bomb_size()
return n;
}
/*
* Remove all BOM from "s" by moving remaining text.
*/
void
remove_bom(s)
char_u *s;
{
if (enc_utf8)
{
char_u *p = s;
while ((p = vim_strbyte(p, 0xef)) != NULL)
{
if (p[1] == 0xbb && p[2] == 0xbf)
STRMOVE(p, p + 3);
else
++p;
}
}
}
/*
* Get class of pointer:
* 0 for blank or NUL
@@ -5239,6 +5260,10 @@ xim_queue_key_press_event(GdkEventKey *event, int down)
/* We had a keypad key, and XIM tried to thieve it */
return FALSE;
/* This is supposed to fix a problem with iBus, that space
* characters don't work in input mode. */
xim_expected_char = NUL;
/* Normal processing */
return imresult;
}
+16 -5
View File
@@ -1551,16 +1551,27 @@ str2special(sp, from)
if (IS_SPECIAL(c) || modifiers) /* special key */
special = TRUE;
}
*sp = str + 1;
#ifdef FEAT_MBYTE
/* For multi-byte characters check for an illegal byte. */
if (has_mbyte && MB_BYTE2LEN(*str) > (*mb_ptr2len)(str))
if (has_mbyte && !IS_SPECIAL(c))
{
transchar_nonprint(buf, c);
return buf;
int len = (*mb_ptr2len)(str);
/* For multi-byte characters check for an illegal byte. */
if (has_mbyte && MB_BYTE2LEN(*str) > len)
{
transchar_nonprint(buf, c);
*sp = str + 1;
return buf;
}
/* Since 'special' is TRUE the multi-byte character 'c' will be
* processed by get_special_key_name() */
c = (*mb_ptr2char)(str);
*sp = str + len;
}
else
#endif
*sp = str + 1;
/* Make unprintable characters in <> form, also <M-Space> and <Tab>.
* Use <Space> only for lhs of a mapping. */
+9 -5
View File
@@ -363,7 +363,7 @@ copy_indent(size, src)
/* Fill to next tabstop with a tab, if possible */
tab_pad = (int)curbuf->b_p_ts - (ind_done % (int)curbuf->b_p_ts);
if (todo >= tab_pad)
if (todo >= tab_pad && !curbuf->b_p_et)
{
todo -= tab_pad;
++ind_len;
@@ -372,7 +372,7 @@ copy_indent(size, src)
}
/* Add tabs required for indent */
while (todo >= (int)curbuf->b_p_ts)
while (todo >= (int)curbuf->b_p_ts && !curbuf->b_p_et)
{
todo -= (int)curbuf->b_p_ts;
++ind_len;
@@ -9125,7 +9125,9 @@ dos_expandpath(
* all entries found with "matchname". */
if ((p[0] != '.' || starts_with_dot)
&& (matchname == NULL
|| vim_regexec(&regmatch, p, (colnr_T)0)))
|| vim_regexec(&regmatch, p, (colnr_T)0)
|| ((flags & EW_NOTWILD)
&& fnamencmp(path + (s - buf), p, e - s) == 0)))
{
#ifdef WIN3264
STRCPY(s, p);
@@ -9329,7 +9331,7 @@ unix_expandpath(gap, path, wildoff, flags, didstar)
e = p;
*e = NUL;
/* now we have one wildcard component between "s" and "e" */
/* Now we have one wildcard component between "s" and "e". */
/* Remove backslashes between "wildoff" and the start of the wildcard
* component. */
for (p = buf + wildoff; p < s; ++p)
@@ -9396,7 +9398,9 @@ unix_expandpath(gap, path, wildoff, flags, didstar)
if (dp == NULL)
break;
if ((dp->d_name[0] != '.' || starts_with_dot)
&& vim_regexec(&regmatch, (char_u *)dp->d_name, (colnr_T)0))
&& (vim_regexec(&regmatch, (char_u *)dp->d_name, (colnr_T)0)
|| ((flags & EW_NOTWILD)
&& fnamencmp(path + (s - buf), dp->d_name, e - s) == 0)))
{
STRCPY(s, dp->d_name);
len = STRLEN(buf);
+48 -23
View File
@@ -2760,6 +2760,7 @@ find_special_key(srcp, modp, keycode, keep_x_key)
int bit;
int key;
unsigned long n;
int l;
src = *srcp;
if (src[0] != '<')
@@ -2772,26 +2773,32 @@ find_special_key(srcp, modp, keycode, keep_x_key)
if (*bp == '-')
{
last_dash = bp;
if (bp[1] != NUL && bp[2] == '>')
++bp; /* anything accepted, like <C-?> */
if (bp[1] != NUL)
{
#ifdef FEAT_MBYTE
if (has_mbyte)
l = mb_ptr2len(bp + 1);
else
#endif
l = 1;
if (bp[l + 1] == '>')
bp += l; /* anything accepted, like <C-?> */
}
}
if (bp[0] == 't' && bp[1] == '_' && bp[2] && bp[3])
bp += 3; /* skip t_xx, xx may be '-' or '>' */
else if (STRNICMP(bp, "char-", 5) == 0)
{
vim_str2nr(bp + 5, NULL, &l, TRUE, TRUE, NULL, NULL);
bp += l + 5;
break;
}
}
if (*bp == '>') /* found matching '>' */
{
end_of_name = bp + 1;
if (STRNICMP(src + 1, "char-", 5) == 0 && VIM_ISDIGIT(src[6]))
{
/* <Char-123> or <Char-033> or <Char-0x33> */
vim_str2nr(src + 6, NULL, NULL, TRUE, TRUE, NULL, &n);
*modp = 0;
*srcp = end_of_name;
return (int)n;
}
/* Which modifiers are given? */
modifiers = 0x0;
for (bp = src + 1; bp < last_dash; bp++)
@@ -2810,16 +2817,32 @@ find_special_key(srcp, modp, keycode, keep_x_key)
*/
if (bp >= last_dash)
{
/*
* Modifier with single letter, or special key name.
*/
if (modifiers != 0 && last_dash[2] == '>')
key = last_dash[1];
if (STRNICMP(last_dash + 1, "char-", 5) == 0
&& VIM_ISDIGIT(last_dash[6]))
{
/* <Char-123> or <Char-033> or <Char-0x33> */
vim_str2nr(last_dash + 6, NULL, NULL, TRUE, TRUE, NULL, &n);
key = (int)n;
}
else
{
key = get_special_key_code(last_dash + 1);
if (!keep_x_key)
key = handle_x_keys(key);
/*
* Modifier with single letter, or special key name.
*/
#ifdef FEAT_MBYTE
if (has_mbyte)
l = mb_ptr2len(last_dash + 1);
else
#endif
l = 1;
if (modifiers != 0 && last_dash[l + 1] == '>')
key = PTR2CHAR(last_dash + 1);
else
{
key = get_special_key_code(last_dash + 1);
if (!keep_x_key)
key = handle_x_keys(key);
}
}
/*
@@ -4659,9 +4682,8 @@ vim_findfile_stopdir(buf)
{
if (r_ptr[0] == '\\' && r_ptr[1] == ';')
{
/* overwrite the escape char,
* use STRLEN(r_ptr) to move the trailing '\0'
*/
/* Overwrite the escape char,
* use STRLEN(r_ptr) to move the trailing '\0'. */
STRMOVE(r_ptr, r_ptr + 1);
r_ptr++;
}
@@ -4920,10 +4942,13 @@ vim_findfile(search_ctx_arg)
stackp->ffs_filearray_size = 0;
}
else
/* Add EW_NOTWILD because the expanded path may contain
* wildcard characters that are to be taken literally.
* This is a bit of a hack. */
expand_wildcards((dirptrs[1] == NULL) ? 1 : 2, dirptrs,
&stackp->ffs_filearray_size,
&stackp->ffs_filearray,
EW_DIR|EW_ADDSLASH|EW_SILENT);
EW_DIR|EW_ADDSLASH|EW_SILENT|EW_NOTWILD);
stackp->ffs_filearray_cur = 0;
stackp->ffs_stage = 0;
+1 -1
View File
@@ -6311,7 +6311,7 @@ line_count_info(line, wc, cc, limit, eol_size)
*wc += words;
/* Add eol_size if the end of line was reached before hitting limit. */
if (line[i] == NUL && i < limit)
if (i < limit && line[i] == NUL)
{
i += eol_size;
chars += eol_size;
+1 -1
View File
@@ -33,7 +33,7 @@
# ifdef EBCDIC
#define DFLT_EFM "%*[^ ] %*[^ ] %f:%l%*[ ]%m,%*[^\"]\"%f\"%*\\D%l: %m,\"%f\"%*\\D%l: %m,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,\"%f\"\\, line %l%*\\D%c%*[^ ] %m,%D%*\\a[%*\\d]: Entering directory `%f',%X%*\\a[%*\\d]: Leaving directory `%f',%DMaking %*\\a in %f,%f|%l| %m"
# else
#define DFLT_EFM "%*[^\"]\"%f\"%*\\D%l: %m,\"%f\"%*\\D%l: %m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%-GIn file included from %f:%l:%c,%-GIn file included from %f:%l,%-Gfrom %f:%l:%c,%-Gfrom %f:%l,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,\"%f\"\\, line %l%*\\D%c%*[^ ] %m,%D%*\\a[%*\\d]: Entering directory `%f',%X%*\\a[%*\\d]: Leaving directory `%f',%D%*\\a: Entering directory `%f',%X%*\\a: Leaving directory `%f',%DMaking %*\\a in %f,%f|%l| %m"
#define DFLT_EFM "%*[^\"]\"%f\"%*\\D%l: %m,\"%f\"%*\\D%l: %m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%-GIn file included from %f:%l:%c:,%-GIn file included from %f:%l:%c,%-GIn file included from %f:%l,%-Gfrom %f:%l:%c,%-Gfrom %f:%l,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,\"%f\"\\, line %l%*\\D%c%*[^ ] %m,%D%*\\a[%*\\d]: Entering directory `%f',%X%*\\a[%*\\d]: Leaving directory `%f',%D%*\\a: Entering directory `%f',%X%*\\a: Leaving directory `%f',%DMaking %*\\a in %f,%f|%l| %m"
# endif
# endif
# endif
+5 -5
View File
@@ -1856,12 +1856,12 @@ AbortProc(HDC hdcPrn, int iCode)
{
MSG msg;
while (!*bUserAbort && PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
while (!*bUserAbort && pPeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
if (!hDlgPrint || !IsDialogMessage(hDlgPrint, &msg))
if (!hDlgPrint || !pIsDialogMessage(hDlgPrint, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
pDispatchMessage(&msg);
}
}
return !*bUserAbort;
@@ -3132,10 +3132,10 @@ serverProcessPendingMessages(void)
{
MSG msg;
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
while (pPeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
pDispatchMessage(&msg);
}
}
+108 -40
View File
@@ -154,6 +154,13 @@ static int did_set_icon = FALSE;
static void may_core_dump __ARGS((void));
#ifdef HAVE_UNION_WAIT
typedef union wait waitstatus;
#else
typedef int waitstatus;
#endif
static pid_t wait4pid __ARGS((pid_t, waitstatus *));
static int WaitForChar __ARGS((long));
#if defined(__BEOS__)
int RealWaitForChar __ARGS((int, long, int *));
@@ -3666,6 +3673,47 @@ mch_new_shellsize()
/* Nothing to do. */
}
/*
* Wait for process "child" to end.
* Return "child" if it exited properly, <= 0 on error.
*/
static pid_t
wait4pid(child, status)
pid_t child;
waitstatus *status;
{
pid_t wait_pid = 0;
while (wait_pid != child)
{
# ifdef _THREAD_SAFE
/* Ugly hack: when compiled with Python threads are probably
* used, in which case wait() sometimes hangs for no obvious
* reason. Use waitpid() instead and loop (like the GUI). */
# ifdef __NeXT__
wait_pid = wait4(child, status, WNOHANG, (struct rusage *)0);
# else
wait_pid = waitpid(child, status, WNOHANG);
# endif
if (wait_pid == 0)
{
/* Wait for 1/100 sec before trying again. */
mch_delay(10L, TRUE);
continue;
}
# else
wait_pid = wait(status);
# endif
if (wait_pid <= 0
# ifdef ECHILD
&& errno == ECHILD
# endif
)
break;
}
return wait_pid;
}
int
mch_call_shell(cmd, options)
char_u *cmd;
@@ -3807,8 +3855,10 @@ mch_call_shell(cmd, options)
int retval = -1;
char **argv = NULL;
int argc;
char_u *p_shcf_copy = NULL;
int i;
char_u *p;
char_u *s;
int inquote;
int pty_master_fd = -1; /* for pty's */
# ifdef FEAT_GUI
@@ -3873,6 +3923,19 @@ mch_call_shell(cmd, options)
}
if (argv == NULL)
{
/*
* Account for possible multiple args in p_shcf.
*/
p = p_shcf;
for (;;)
{
p = skiptowhite(p);
if (*p == NUL)
break;
++argc;
p = skipwhite(p);
}
argv = (char **)alloc((unsigned)((argc + 4) * sizeof(char *)));
if (argv == NULL) /* out of memory */
goto error;
@@ -3882,7 +3945,23 @@ mch_call_shell(cmd, options)
{
if (extra_shell_arg != NULL)
argv[argc++] = (char *)extra_shell_arg;
argv[argc++] = (char *)p_shcf;
/* Break 'shellcmdflag' into white separated parts. This doesn't
* handle quoted strings, they are very unlikely to appear. */
p_shcf_copy = alloc((unsigned)STRLEN(p_shcf) + 1);
if (p_shcf_copy == NULL) /* out of memory */
goto error;
s = p_shcf_copy;
p = p_shcf;
while (*p != NUL)
{
argv[argc++] = (char *)s;
while (*p && *p != ' ' && *p != TAB)
*s++ = *p++;
*s++ = NUL;
p = skipwhite(p);
}
argv[argc++] = (char *)cmd;
}
argv[argc] = NULL;
@@ -3909,12 +3988,13 @@ mch_call_shell(cmd, options)
pty_master_fd = OpenPTY(&tty_name); /* open pty */
if (pty_master_fd >= 0)
{
#if !defined(MACOS) || defined(USE_CARBONIZED)
pty_slave_fd = open(tty_name, O_RDWR | O_EXTRA, 0);
#else
/* Leaving out O_NOCTTY may lead to waitpid() always returning
* 0 on Mac OS X 10.7 thereby causing freezes. */
pty_slave_fd = open(tty_name, O_RDWR | O_NOCTTY | O_EXTRA);
* 0 on Mac OS X 10.7 thereby causing freezes. Let's assume
* adding O_NOCTTY always works when defined. */
#ifdef O_NOCTTY
pty_slave_fd = open(tty_name, O_RDWR | O_NOCTTY | O_EXTRA, 0);
#else
pty_slave_fd = open(tty_name, O_RDWR | O_EXTRA, 0);
#endif
if (pty_slave_fd < 0)
{
@@ -4220,7 +4300,7 @@ mch_call_shell(cmd, options)
{
MSG_PUTS(_("\nCannot fork\n"));
}
else if (wpid == 0)
else if (wpid == 0) /* child */
{
linenr_T lnum = curbuf->b_op_start.lnum;
int written = 0;
@@ -4228,7 +4308,6 @@ mch_call_shell(cmd, options)
char_u *s;
size_t l;
/* child */
close(fromshell_fd);
for (;;)
{
@@ -4273,7 +4352,7 @@ mch_call_shell(cmd, options)
}
_exit(0);
}
else
else /* parent */
{
close(toshell_fd);
toshell_fd = -1;
@@ -4574,7 +4653,7 @@ mch_call_shell(cmd, options)
* typed characters (otherwise we would lose typeahead).
*/
# ifdef __NeXT__
wait_pid = wait4(pid, &status, WNOHANG, (struct rusage *) 0);
wait_pid = wait4(pid, &status, WNOHANG, (struct rusage *)0);
# else
wait_pid = waitpid(pid, &status, WNOHANG);
# endif
@@ -4623,33 +4702,8 @@ finished:
* Don't wait if wait_pid was already set above, indicating the
* child already exited.
*/
while (wait_pid != pid)
{
# ifdef _THREAD_SAFE
/* Ugly hack: when compiled with Python threads are probably
* used, in which case wait() sometimes hangs for no obvious
* reason. Use waitpid() instead and loop (like the GUI). */
# ifdef __NeXT__
wait_pid = wait4(pid, &status, WNOHANG, (struct rusage *)0);
# else
wait_pid = waitpid(pid, &status, WNOHANG);
# endif
if (wait_pid == 0)
{
/* Wait for 1/100 sec before trying again. */
mch_delay(10L, TRUE);
continue;
}
# else
wait_pid = wait(&status);
# endif
if (wait_pid <= 0
# ifdef ECHILD
&& errno == ECHILD
# endif
)
break;
}
if (wait_pid != pid)
wait_pid = wait4pid(pid, &status);
# ifdef FEAT_GUI
/* Close slave side of pty. Only do this after the child has
@@ -4662,7 +4716,10 @@ finished:
/* Make sure the child that writes to the external program is
* dead. */
if (wpid > 0)
{
kill(wpid, SIGKILL);
wait4pid(wpid, NULL);
}
/*
* Set to raw mode right now, otherwise a CTRL-C after
@@ -4698,6 +4755,7 @@ finished:
}
}
vim_free(argv);
vim_free(p_shcf_copy);
error:
if (!did_settmode)
@@ -4808,7 +4866,8 @@ WaitForChar(msec)
/*
* Wait "msec" msec until a character is available from file descriptor "fd".
* Time == -1 will block forever.
* "msec" == 0 will check for characters once.
* "msec" == -1 will block until a character is available.
* When a GUI is being used, this will not be used for input -- webb
* Returns also, when a request from Sniff is waiting -- toni.
* Or when a Linux GPM mouse event is waiting.
@@ -5046,7 +5105,8 @@ RealWaitForChar(fd, msec, check_for_gpm)
/*
* Select on ready for reading and exceptional condition (end of file).
*/
FD_ZERO(&rfds); /* calls bzero() on a sun */
select_eintr:
FD_ZERO(&rfds);
FD_ZERO(&efds);
FD_SET(fd, &rfds);
# if !defined(__QNX__) && !defined(__CYGWIN32__)
@@ -5106,6 +5166,14 @@ RealWaitForChar(fd, msec, check_for_gpm)
# else
ret = select(maxfd + 1, &rfds, NULL, &efds, tvp);
# endif
# ifdef EINTR
if (ret == -1 && errno == EINTR)
/* Interrupted by a signal, need to try again. We ignore msec
* here, because we do want to check even after a timeout if
* characters are available. Needed for reading output of an
* external command after the process has finished. */
goto select_eintr;
# endif
# ifdef __TANDEM
if (ret == -1 && errno == ENOTSUP)
{
@@ -5113,7 +5181,7 @@ RealWaitForChar(fd, msec, check_for_gpm)
FD_ZERO(&efds);
ret = 0;
}
#endif
# endif
# ifdef FEAT_MZSCHEME
if (ret == 0 && mzquantum_used)
/* loop if MzThreads must be scheduled and timeout occurred */
+14 -10
View File
@@ -152,6 +152,14 @@ static PFNGCKLN s_pfnGetConsoleKeyboardLayoutName = NULL;
# define wcsicmp(a, b) wcscmpi((a), (b))
#endif
/* Enable common dialogs input unicode from IME if posible. */
#ifdef FEAT_MBYTE
LRESULT (WINAPI *pDispatchMessage)(LPMSG) = DispatchMessage;
BOOL (WINAPI *pGetMessage)(LPMSG, HWND, UINT, UINT) = GetMessage;
BOOL (WINAPI *pIsDialogMessage)(HWND, LPMSG) = IsDialogMessage;
BOOL (WINAPI *pPeekMessage)(LPMSG, HWND, UINT, UINT, UINT) = PeekMessage;
#endif
#ifndef FEAT_GUI_W32
/* Win32 Console handles for input and output */
static HANDLE g_hConIn = INVALID_HANDLE_VALUE;
@@ -3284,10 +3292,10 @@ mch_system_classic(char *cmd, int options)
{
MSG msg;
if (PeekMessage(&msg, (HWND)NULL, 0, 0, PM_REMOVE))
if (pPeekMessage(&msg, (HWND)NULL, 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
pDispatchMessage(&msg);
}
if (WaitForSingleObject(pi.hProcess, delay) != WAIT_TIMEOUT)
break;
@@ -3411,8 +3419,6 @@ dump_pipe(int options,
{
DWORD availableBytes = 0;
DWORD i;
int c;
char_u *p;
int ret;
DWORD len;
DWORD toRead;
@@ -3471,6 +3477,8 @@ dump_pipe(int options,
else if (has_mbyte)
{
int l;
int c;
char_u *p;
len += *buffer_off;
buffer[len] = NUL;
@@ -3550,9 +3558,7 @@ mch_system_piped(char *cmd, int options)
int noread_cnt = 0;
garray_T ga;
int delay = 1;
# ifdef FEAT_MBYTE
DWORD buffer_off = 0; /* valid bytes in buffer[] */
# endif
SECURITY_ATTRIBUTES saAttr;
@@ -3769,14 +3775,12 @@ mch_system_piped(char *cmd, int options)
if (WaitForSingleObject(pi.hProcess, delay) != WAIT_TIMEOUT)
{
dump_pipe(options, g_hChildStd_OUT_Rd,
&ga, buffer, &buffer_off);
dump_pipe(options, g_hChildStd_OUT_Rd, &ga, buffer, &buffer_off);
break;
}
++noread_cnt;
dump_pipe(options, g_hChildStd_OUT_Rd,
&ga, buffer, &buffer_off);
dump_pipe(options, g_hChildStd_OUT_Rd, &ga, buffer, &buffer_off);
/* We start waiting for a very short time and then increase it, so
* that we respond quickly when the process is quick, and don't
+14
View File
@@ -193,3 +193,17 @@ Trace(char *pszFormat, ...);
#else
# define vim_mkdir(x, y) mch_mkdir(x)
#endif
/* Enable common dialogs input unicode from IME if posible. */
#ifdef FEAT_MBYTE
/* The variables are defined in os_win32.c. */
extern LRESULT (WINAPI *pDispatchMessage)(LPMSG);
extern BOOL (WINAPI *pGetMessage)(LPMSG, HWND, UINT, UINT);
extern BOOL (WINAPI *pIsDialogMessage)(HWND, LPMSG);
extern BOOL (WINAPI *pPeekMessage)(LPMSG, HWND, UINT, UINT, UINT);
#else
# define pDispatchMessage DispatchMessage
# define pGetMessage GetMessage
# define pIsDialogMessage IsDialogMessage
# define pPeekMessage PeekMessage
#endif
+1
View File
@@ -20,6 +20,7 @@ int gui_mch_get_winpos __ARGS((int *x, int *y));
void gui_mch_set_winpos __ARGS((int x, int y));
int gui_mch_maximized __ARGS((void));
void gui_mch_unmaximize __ARGS((void));
void gui_mch_newfont __ARGS((void));
void gui_mch_set_shellsize __ARGS((int width, int height, int min_width, int min_height, int base_width, int base_height, int direction));
void gui_mch_get_screen_dimensions __ARGS((int *screen_w, int *screen_h));
void gui_mch_settitle __ARGS((char_u *title, char_u *icon));
+1
View File
@@ -2,6 +2,7 @@
int enc_canon_props __ARGS((char_u *name));
char_u *mb_init __ARGS((void));
int bomb_size __ARGS((void));
void remove_bom __ARGS((char_u *s));
int mb_get_class __ARGS((char_u *p));
int dbcs_class __ARGS((unsigned lead, unsigned trail));
int latin_char2len __ARGS((int c));
+26 -2
View File
@@ -126,6 +126,7 @@ static int is_qf_win __ARGS((win_T *win, qf_info_T *qi));
static win_T *qf_find_win __ARGS((qf_info_T *qi));
static buf_T *qf_find_buf __ARGS((qf_info_T *qi));
static void qf_update_buffer __ARGS((qf_info_T *qi));
static void qf_set_title __ARGS((qf_info_T *qi));
static void qf_fill_buffer __ARGS((qf_info_T *qi));
#endif
static char_u *get_mef_name __ARGS((void));
@@ -561,6 +562,10 @@ qf_init_ext(qi, efile, buf, tv, errorformat, newlist, lnumfirst, lnumlast,
break;
IObuff[CMDBUFFSIZE - 2] = NUL; /* for very long lines */
#ifdef FEAT_MBYTE
remove_bom(IObuff);
#endif
if ((efmp = vim_strrchr(IObuff, '\n')) != NULL)
*efmp = NUL;
#ifdef USE_CRNL
@@ -2384,8 +2389,7 @@ ex_copen(eap)
qf_fill_buffer(qi);
if (qi->qf_lists[qi->qf_curlist].qf_title != NULL)
set_internal_string_var((char_u *)"w:quickfix_title",
qi->qf_lists[qi->qf_curlist].qf_title);
qf_set_title(qi);
curwin->w_cursor.lnum = qi->qf_lists[qi->qf_curlist].qf_index;
curwin->w_cursor.col = 0;
@@ -2522,6 +2526,8 @@ qf_update_buffer(qi)
qf_info_T *qi;
{
buf_T *buf;
win_T *win;
win_T *curwin_save;
aco_save_T aco;
/* Check if a buffer for the quickfix list exists. Update it. */
@@ -2533,6 +2539,16 @@ qf_update_buffer(qi)
qf_fill_buffer(qi);
if (qi->qf_lists[qi->qf_curlist].qf_title != NULL
&& (win = qf_find_win(qi)) != NULL)
{
curwin_save = curwin;
curwin = win;
qf_set_title(qi);
curwin = curwin_save;
}
/* restore curwin/curbuf and a few other things */
aucmd_restbuf(&aco);
@@ -2540,6 +2556,14 @@ qf_update_buffer(qi)
}
}
static void
qf_set_title(qi)
qf_info_T *qi;
{
set_internal_string_var((char_u *)"w:quickfix_title",
qi->qf_lists[qi->qf_curlist].qf_title);
}
/*
* Fill current buffer with quickfix errors, replacing any previous contents.
* curbuf must be the quickfix buffer!
+4 -2
View File
@@ -2531,7 +2531,9 @@ fold_line(wp, fold_count, foldinfo, lnum, row)
/* Visual block mode: highlight the chars part of the block */
if (wp->w_old_cursor_fcol + txtcol < (colnr_T)W_WIDTH(wp))
{
if (wp->w_old_cursor_lcol + txtcol < (colnr_T)W_WIDTH(wp))
if (wp->w_old_cursor_lcol != MAXCOL
&& wp->w_old_cursor_lcol + txtcol
< (colnr_T)W_WIDTH(wp))
len = wp->w_old_cursor_lcol;
else
len = W_WIDTH(wp) - txtcol;
@@ -4252,7 +4254,7 @@ win_line(wp, lnum, startrow, endrow, nochange)
{
/* tab amount depends on current column */
n_extra = (int)wp->w_buffer->b_p_ts
- vcol % (int)wp->w_buffer->b_p_ts - 1;
- VCOL_HLC % (int)wp->w_buffer->b_p_ts - 1;
#ifdef FEAT_MBYTE
mb_utf8 = FALSE; /* don't draw as UTF-8 */
#endif
+1 -1
View File
@@ -11197,7 +11197,7 @@ allcap_copy(word, wcopy)
c = *s++;
#ifdef FEAT_MBYTE
/* We only change ß to SS when we are certain latin1 is used. It
/* We only change 0xdf to SS when we are certain latin1 is used. It
* would cause weird errors in other 8-bit encodings. */
if (enc_latin1like && c == 0xdf)
{
+20 -3
View File
@@ -2,9 +2,19 @@ Test for 'errorformat'. This will fail if the quickfix feature was disabled.
STARTTEST
:so small.vim
:/start of errorfile/,/end of errorfile/w! Xerrorfile
:" Also test a BOM is ignored.
:so mbyte.vim
:set encoding=utf-8
:7/start of errorfile/,/end of errorfile/w! Xerrorfile1
:7/start of errorfile/,/end of errorfile/-1w! Xerrorfile2
:/start of testfile/,/end of testfile/w! Xtestfile
:cf Xerrorfile
:cf Xerrorfile2
:clast
:copen
:let a=w:quickfix_title
:wincmd p
gR=a 
:cf Xerrorfile1
rA
:cn
rB
@@ -14,13 +24,18 @@ rC
rD
:cn
rE
:cn
:wincmd w
:let a=w:quickfix_title
:wincmd p
gR=a 
:w! test.out " Write contents of this file
:qa!
ENDTEST
start of errorfile
"Xtestfile", line 4.12: 1506-045 (S) Undeclared identifier fd_set.
"Xtestfile", line 7 col 19; this is an error
"Xtestfile", line 7 col 19; this is an error
gcc -c -DHAVE_CONFIsing-prototypes -I/usr/X11R6/include version.c
Xtestfile:13: parse error before `asd'
make: *** [vim] Error 1
@@ -30,6 +45,8 @@ in file "Xtestfile" linenr 16: there is an error
"Xtestfile", linenr 19: yet another problem
Does anyone know what is the problem and how to correction it?
"Xtestfile", line 21 col 9: What is the title of the quickfix window?
"Xtestfile", line 22 col 9: What is the title of the quickfix window?
end of errorfile
start of testfile
+2 -2
View File
@@ -18,6 +18,6 @@ line 17 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
line 18 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Eine 19 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
line 20 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
line 21 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
line 22 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
line 21 :cf Xerrorfile1xxxxxxxxxxxxxxx
line 22 :cf Xerrorfile2xxxxxxxxxxxxxxx
end of testfile
+5 -1
View File
@@ -1,6 +1,7 @@
Tests for "r<Tab>" with 'smarttab' and 'expandtab' set/not set.
STARTTEST
:so small.vim
:set smarttab expandtab ts=8 sw=4
:" make sure that backspace works, no matter what termcap is used
:set t_kD=x7f t_kb=x08
@@ -12,7 +13,10 @@ r
0wR 
:" Test replacing with Tabs
0wR 
:?^start?,$w! test.out
:" Test that copyindent works with expandtab set
:set expandtab smartindent copyindent ts=8 sw=8 sts=8
o{
x:?^start?,$w! test.out
:qa!
ENDTEST
+2
View File
@@ -5,3 +5,5 @@ test text
a cde
hi
test text
{
x
+6
View File
@@ -2,6 +2,7 @@
STARTTEST
:so small.vim
:set cpo-=<
:" Test maparg() with a string result
:map foo<C-V> is<F4>foo
:vnoremap <script> <buffer> <expr> <silent> bar isbar
@@ -9,6 +10,11 @@ STARTTEST
:call append('$', string(maparg('foo<C-V>', '', 0, 1)))
:call append('$', string(maparg('bar', '', 0, 1)))
:"
:map abc x<char-114>x
:call append('$', maparg('abc'))
:map abc y<S-char-114>y
:call append('$', maparg('abc'))
:"
:/^eof/+1,$w! test.out
:qa!
ENDTEST
+2
View File
@@ -1,3 +1,5 @@
is<F4>foo
{'silent': 0, 'noremap': 0, 'lhs': 'foo<C-V>', 'mode': ' ', 'expr': 0, 'sid': 0, 'rhs': 'is<F4>foo', 'buffer': 0}
{'silent': 1, 'noremap': 1, 'lhs': 'bar', 'mode': 'v', 'expr': 1, 'sid': 0, 'rhs': 'isbar', 'buffer': 1}
xrx
yRy
+86
View File
@@ -724,6 +724,92 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
303,
/**/
302,
/**/
301,
/**/
300,
/**/
299,
/**/
298,
/**/
297,
/**/
296,
/**/
295,
/**/
294,
/**/
293,
/**/
292,
/**/
291,
/**/
290,
/**/
289,
/**/
288,
/**/
287,
/**/
286,
/**/
285,
/**/
284,
/**/
283,
/**/
282,
/**/
281,
/**/
280,
/**/
279,
/**/
278,
/**/
277,
/**/
276,
/**/
275,
/**/
274,
/**/
273,
/**/
272,
/**/
271,
/**/
270,
/**/
269,
/**/
268,
/**/
267,
/**/
266,
/**/
265,
/**/
264,
/**/
263,
/**/
262,
/**/
261,
/**/
260,
/**/
+1
View File
@@ -819,6 +819,7 @@ extern char *(*dyn_libintl_textdomain)(const char *domainname);
#define EW_PATH 0x80 /* search in 'path' too */
#define EW_ICASE 0x100 /* ignore case */
#define EW_NOERROR 0x200 /* no error for bad regexp */
#define EW_NOTWILD 0x400 /* add match with literal name if exists */
/* Note: mostly EW_NOTFOUND and EW_SILENT are mutually exclusive: EW_NOTFOUND
* is used when executing commands and EW_SILENT for interactive expanding. */