Compare commits

...

15 Commits

Author SHA1 Message Date
Bram Moolenaar
dc93555c0f updated for version 7.3.281
Problem:    After using "expand('%:8')" the buffer name is changed.
Solution:   Make a copy of the file name before shortening it.
2011-08-17 15:23:23 +02:00
Bram Moolenaar
c95e32635c updated for version 7.3.280
Problem:    ":lmake" does not update the quickfix window title.
Solution:   Update the title. (Lech Lorens)
2011-08-10 18:36:54 +02:00
Bram Moolenaar
12bc1b5c9f updated for version 7.3.279
Problem:    With GTK, when gvim is full-screen and a tab is opened and using a
            specific monitor configuration the window is too big.
Solution:   Adjust the window size like on MS-Windows. (Yukihiro Nakadaira)
2011-08-10 17:44:45 +02:00
Bram Moolenaar
17fb0e891a updated for version 7.3.278
Problem:    Passing the file name to open in VisVim doesn't work.
Solution:   Adjust the index and check for end of buffer. (Jiri Sedlak)
2011-08-10 17:25:51 +02:00
Bram Moolenaar
8c85fa3b26 updated for version 7.3.277
Problem:    MS-Windows: some characters do not show in dialogs.
Solution:   Use the wide methods when available. (Yanwei Jia)
2011-08-10 17:08:03 +02:00
Bram Moolenaar
cf83973211 updated for version 7.3.276
Problem:    GvimExt sets $LANG in the wrong way.
Solution:   Save the environment and use it for gvim. (Yasuhiro Matsumoto)
2011-08-10 16:31:23 +02:00
Bram Moolenaar
e78c206856 updated for version 7.3.275
Problem:    MS-Windows: When using a black background some screen updates
            cause the window to flicker.
Solution:   Add WS_CLIPCHILDREN to CreateWindow().  (René Aguirre)
2011-08-10 15:56:27 +02:00
Bram Moolenaar
8a20b0f25e updated for version 7.3.274
Problem:    With concealed characters tabs do not have the right size.
Solution:   Use VCOL_HLC instead of vcol. (Eiichi Sato)
2011-08-10 14:32:39 +02:00
Bram Moolenaar
836082d398 updated for version 7.3.273
Problem:    A BOM in an error file is seen as text. (Aleksey Baibarin)
Solution:   Remove the BOM from the text before evaluating. (idea by Christian
            Brabandt)
2011-08-10 13:21:46 +02:00
Bram Moolenaar
213b10a57e updated for version 7.3.272
Problem:    ":put =list" does not add an empty line for a trailing empty
            item.
Solution:   Add a trailing NL when turning a list into a string.
2011-08-10 12:38:08 +02:00
Bram Moolenaar
d0988c50f3 updated for version 7.3.271
Problem:    Code not following Vim coding style.
Solution:   Fix the style. (Elias Diem)
2011-08-10 12:19:04 +02:00
Bram Moolenaar
1cb7e0976d updated for version 7.3.270
Problem:    Illegal memory access.
Solution:   Swap conditions. (Dominique Pelle)
2011-08-10 12:11:01 +02:00
Bram Moolenaar
ea35ef6888 updated for version 7.3.269
Problem:    'shellcmdflag' only works with one flag.
Solution:   Split into multiple arguments. (Gary Johnson)
2011-08-04 22:59:28 +02:00
Bram Moolenaar
e70172e1fc updated for version 7.3.268
Problem:    Vim freezes when executing an external command with zsh.
Solution:   Use O_NOCTTY both in the master and slave. (Bjorn Winckler)
2011-08-04 19:36:52 +02:00
Bram Moolenaar
3f5f795f76 updated for version 7.3.267
Problem:    Ruby on Mac OS X 10.7 may crash.
Solution:   Avoid alloc(0). (Bjorn Winckler)
2011-08-04 19:34:59 +02:00
22 changed files with 332 additions and 124 deletions

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.

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

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;
}
@@ -23201,6 +23205,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
@@ -23375,24 +23380,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)
@@ -23400,18 +23406,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;

View File

@@ -1407,7 +1407,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())

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
{

View File

@@ -358,21 +358,21 @@ gui_ph_handle_timer_timeout(PtWidget_t *widget, void *data, PtCallbackInfo_t *in
}
static int
gui_ph_handle_window_cb( PtWidget_t *widget, void *data, PtCallbackInfo_t *info )
gui_ph_handle_window_cb(PtWidget_t *widget, void *data, PtCallbackInfo_t *info)
{
PhWindowEvent_t *we = info->cbdata;
ushort_t *width, *height;
switch( we->event_f ) {
switch (we->event_f) {
case Ph_WM_CLOSE:
gui_shell_closed();
break;
case Ph_WM_FOCUS:
/* Just in case it's hidden and needs to be shown */
gui_mch_mousehide( MOUSE_SHOW );
gui_mch_mousehide(MOUSE_SHOW);
if( we->event_state == Ph_WM_EVSTATE_FOCUS )
if (we->event_state == Ph_WM_EVSTATE_FOCUS)
{
gui_focus_change(TRUE);
gui_mch_start_blink();
@@ -385,17 +385,17 @@ gui_ph_handle_window_cb( PtWidget_t *widget, void *data, PtCallbackInfo_t *info
break;
case Ph_WM_RESIZE:
PtGetResource( gui.vimWindow, Pt_ARG_WIDTH, &width, 0 );
PtGetResource( gui.vimWindow, Pt_ARG_HEIGHT, &height, 0 );
PtGetResource(gui.vimWindow, Pt_ARG_WIDTH, &width, 0);
PtGetResource(gui.vimWindow, Pt_ARG_HEIGHT, &height, 0);
#ifdef USE_PANEL_GROUP
width -= (pg_margin_left + pg_margin_right);
height -= (pg_margin_top + pg_margin_bottom);
#endif
gui_resize_shell( *width, *height );
gui_set_shellsize( FALSE, FALSE, RESIZE_BOTH );
gui_resize_shell(*width, *height);
gui_set_shellsize(FALSE, FALSE, RESIZE_BOTH);
is_ignore_draw = FALSE;
PtEndFlux( gui.vimContainer );
PtContainerRelease( gui.vimContainer );
PtEndFlux(gui.vimContainer);
PtContainerRelease(gui.vimContainer);
break;
default:
@@ -406,7 +406,7 @@ gui_ph_handle_window_cb( PtWidget_t *widget, void *data, PtCallbackInfo_t *info
}
static int
gui_ph_handle_scrollbar( PtWidget_t *widget, void *data, PtCallbackInfo_t *info )
gui_ph_handle_scrollbar(PtWidget_t *widget, void *data, PtCallbackInfo_t *info)
{
PtScrollbarCallback_t *scroll;
scrollbar_T *sb;
@@ -415,10 +415,10 @@ gui_ph_handle_scrollbar( PtWidget_t *widget, void *data, PtCallbackInfo_t *info
scroll = info->cbdata;
sb = (scrollbar_T *) data;
if( sb != NULL )
if (sb != NULL)
{
value = scroll->position;
switch( scroll->action )
switch (scroll->action)
{
case Pt_SCROLL_DRAGGED:
dragging = TRUE;
@@ -436,97 +436,97 @@ gui_ph_handle_scrollbar( PtWidget_t *widget, void *data, PtCallbackInfo_t *info
}
static int
gui_ph_handle_keyboard( PtWidget_t *widget, void *data, PtCallbackInfo_t *info )
gui_ph_handle_keyboard(PtWidget_t *widget, void *data, PtCallbackInfo_t *info)
{
PhKeyEvent_t *key;
unsigned char string[6];
int len, i;
int ch, modifiers;
key = PhGetData( info->event );
key = PhGetData(info->event);
ch = modifiers = len = 0;
if( p_mh )
gui_mch_mousehide( MOUSE_HIDE );
if (p_mh)
gui_mch_mousehide(MOUSE_HIDE);
/* We're a good lil photon program, aren't we? yes we are, yeess wee arrr */
if( key->key_flags & Pk_KF_Compose )
if (key->key_flags & Pk_KF_Compose)
{
return Pt_CONTINUE;
}
if( (key->key_flags & Pk_KF_Cap_Valid) &&
PkIsKeyDown( key->key_flags ) )
if ((key->key_flags & Pk_KF_Cap_Valid) &&
PkIsKeyDown(key->key_flags))
{
#ifdef FEAT_MENU
/*
* Only show the menu if the Alt key is down, and the Shift & Ctrl
* keys aren't down, as well as the other conditions
*/
if( ( ( key->key_mods & Pk_KM_Alt ) &&
!( key->key_mods & Pk_KM_Shift ) &&
!( key->key_mods & Pk_KM_Ctrl ) ) &&
if (((key->key_mods & Pk_KM_Alt) &&
!(key->key_mods & Pk_KM_Shift) &&
!(key->key_mods & Pk_KM_Ctrl)) &&
gui.menu_is_active &&
( *p_wak == 'y' ||
( *p_wak == 'm' &&
gui_is_menu_shortcut( key->key_cap ) ) ) )
(*p_wak == 'y' ||
(*p_wak == 'm' &&
gui_is_menu_shortcut(key->key_cap))))
{
/* Fallthrough and let photon look for the hotkey */
return Pt_CONTINUE;
}
#endif
for( i = 0; special_keys[i].key_sym != 0; i++ )
for(i = 0; special_keys[i].key_sym != 0; i++)
{
if( special_keys[i].key_sym == key->key_cap )
if (special_keys[i].key_sym == key->key_cap)
{
len = 0;
if( special_keys[i].vim_code1 == NUL )
if (special_keys[i].vim_code1 == NUL)
ch = special_keys[i].vim_code0;
else
{
/* Detect if a keypad number key has been pressed
* and change the key if Num Lock is on */
if( key->key_cap >= Pk_KP_Enter && key->key_cap <= Pk_KP_9
&& ( key->key_mods & Pk_KM_Num_Lock ) )
if (key->key_cap >= Pk_KP_Enter && key->key_cap <= Pk_KP_9
&& (key->key_mods & Pk_KM_Num_Lock))
{
/* FIXME: For now, just map the key to a ascii value
* (see <photon/PkKeyDef.h>) */
ch = key->key_cap - 0xf080;
}
else
ch = TO_SPECIAL( special_keys[i].vim_code0,
special_keys[i].vim_code1 );
ch = TO_SPECIAL(special_keys[i].vim_code0,
special_keys[i].vim_code1);
}
break;
}
}
if( key->key_mods & Pk_KM_Ctrl )
if (key->key_mods & Pk_KM_Ctrl)
modifiers |= MOD_MASK_CTRL;
if( key->key_mods & Pk_KM_Alt )
if (key->key_mods & Pk_KM_Alt)
modifiers |= MOD_MASK_ALT;
if( key->key_mods & Pk_KM_Shift )
if (key->key_mods & Pk_KM_Shift)
modifiers |= MOD_MASK_SHIFT;
/* Is this not a special key? */
if( special_keys[i].key_sym == 0 )
if (special_keys[i].key_sym == 0)
{
ch = PhTo8859_1( key );
if( ch == -1
ch = PhTo8859_1(key);
if (ch == -1
#ifdef FEAT_MBYTE
|| ( enc_utf8 && ch > 127 )
|| (enc_utf8 && ch > 127)
#endif
)
{
#ifdef FEAT_MBYTE
len = PhKeyToMb( string, key );
if( len > 0 )
len = PhKeyToMb(string, key);
if (len > 0)
{
static char buf[6];
int src_taken, dst_made;
if( enc_utf8 != TRUE )
if (enc_utf8 != TRUE)
{
PxTranslateFromUTF(
charset_translate,
@@ -2931,13 +2931,13 @@ gui_ph_parse_font_name(
name_len = (int_u) ( mark - vim_font );
*font_name = vim_strnsave( vim_font, name_len );
if( *font_name != NULL )
if (*font_name != NULL)
{
if( mark != NULL )
if (mark != NULL)
{
while( *mark != NUL && *mark++ == ':')
while (*mark != NUL && *mark++ == ':')
{
switch( tolower( *mark++ ) )
switch (tolower(*mark++))
{
case 'a': *font_flags |= PF_STYLE_ANTIALIAS; break;
case 'b': *font_flags |= PF_STYLE_BOLD; break;
@@ -2946,7 +2946,7 @@ gui_ph_parse_font_name(
case 's':
size = getdigits( &mark );
/* Restrict the size to some vague limits */
if( size < 1 || size > 100 )
if (size < 1 || size > 100)
size = 8;
*font_size = size;
@@ -2973,18 +2973,18 @@ gui_mch_init_font(char_u *vim_font_name, int fontset)
FontQueryInfo info;
PhRect_t extent;
if( vim_font_name == NULL )
if (vim_font_name == NULL)
{
/* Default font */
vim_font_name = "PC Terminal";
}
if( STRCMP( vim_font_name, "*" ) == 0 )
if (STRCMP( vim_font_name, "*" ) == 0)
{
font_tag = PtFontSelection( gui.vimWindow, NULL, NULL,
"pcterm12", -1, PHFONT_FIXED, NULL );
if( font_tag == NULL )
if (font_tag == NULL)
return FAIL;
gui_mch_free_font( gui.norm_font );
@@ -2995,12 +2995,12 @@ gui_mch_init_font(char_u *vim_font_name, int fontset)
}
else
{
if( gui_ph_parse_font_name( vim_font_name, &font_name, &font_flags,
&font_size ) == FALSE )
if (gui_ph_parse_font_name( vim_font_name, &font_name, &font_flags,
&font_size ) == FALSE)
return FAIL;
font_tag = gui_ph_get_font( font_name, font_flags, font_size, 0 );
if( font_tag == NULL )
if (font_tag == NULL)
{
vim_free( font_name );
return FAIL;
@@ -3053,17 +3053,17 @@ gui_mch_get_font(char_u *vim_font_name, int report_error)
int_u font_size = 12;
int_u font_flags = 0;
if( gui_ph_parse_font_name( vim_font_name, &font_name, &font_flags,
&font_size ) != FALSE )
if (gui_ph_parse_font_name( vim_font_name, &font_name, &font_flags,
&font_size ) != FALSE)
{
font_tag = gui_ph_get_font( font_name, font_flags, font_size, -1 );
vim_free( font_name );
if( font_tag != NULL )
if (font_tag != NULL)
return (GuiFont)font_tag;
}
if( report_error )
if (report_error)
EMSG2(e_font, vim_font_name );
return FAIL;

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 */

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;
@@ -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;
}

View File

@@ -761,11 +761,19 @@ static VALUE vim_message(VALUE self UNUSED, VALUE str)
char *buff, *p;
str = rb_obj_as_string(str);
buff = ALLOCA_N(char, RSTRING_LEN(str));
strcpy(buff, RSTRING_PTR(str));
p = strchr(buff, '\n');
if (p) *p = '\0';
MSG(buff);
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');
if (p) *p = '\0';
MSG(buff);
}
else
{
MSG("");
}
return Qnil;
}

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

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;

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);
}
}

View File

@@ -3795,8 +3795,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
@@ -3855,6 +3857,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;
@@ -3864,7 +3879,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;
@@ -3889,11 +3920,21 @@ mch_call_shell(cmd, options)
if (p_guipty && !(options & (SHELL_READ|SHELL_WRITE)))
{
pty_master_fd = OpenPTY(&tty_name); /* open pty */
if (pty_master_fd >= 0 && ((pty_slave_fd =
open(tty_name, O_RDWR | O_EXTRA, 0)) < 0))
if (pty_master_fd >= 0)
{
close(pty_master_fd);
pty_master_fd = -1;
/* Leaving out O_NOCTTY may lead to waitpid() always returning
* 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)
{
close(pty_master_fd);
pty_master_fd = -1;
}
}
}
/*
@@ -4667,6 +4708,7 @@ finished:
}
}
vim_free(argv);
vim_free(p_shcf_copy);
error:
if (!did_settmode)

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;

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

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));

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));

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!

View File

@@ -4252,7 +4252,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

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
@@ -14,13 +24,18 @@ rC
:cn
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
"Xtestfile", line 7 col 19; this is an error
start of errorfile
"Xtestfile", line 4.12: 1506-045 (S) Undeclared identifier fd_set.
"Xtestfile", line 7 col 19; this is an error
gcc -c -DHAVE_CONFIsing-prototypes -I/usr/X11R6/include version.c
@@ -30,6 +45,8 @@ in file "Xtestfile" linenr 16: there is an error
2 returned
"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

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

View File

@@ -709,6 +709,36 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
281,
/**/
280,
/**/
279,
/**/
278,
/**/
277,
/**/
276,
/**/
275,
/**/
274,
/**/
273,
/**/
272,
/**/
271,
/**/
270,
/**/
269,
/**/
268,
/**/
267,
/**/
266,
/**/