Compare commits

...

5 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
14 changed files with 140 additions and 45 deletions

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

@@ -23205,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
@@ -23379,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)
@@ -23404,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

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

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

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

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

@@ -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));
@@ -2388,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;
@@ -2526,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. */
@@ -2537,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);
@@ -2544,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

@@ -5,9 +5,16 @@ STARTTEST
:" Also test a BOM is ignored.
:so mbyte.vim
:set encoding=utf-8
:/start of errorfile/,/end of errorfile/w! Xerrorfile
: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
@@ -17,6 +24,11 @@ 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
@@ -33,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,16 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
281,
/**/
280,
/**/
279,
/**/
278,
/**/
277,
/**/
276,
/**/