forked from aniani/vim
updated for version 7.0c01
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
*usr_44.txt* For Vim version 7.0c. Last change: 2005 Apr 01
|
*usr_44.txt* For Vim version 7.0c. Last change: 2006 Mar 27
|
||||||
|
|
||||||
VIM USER MANUAL - by Bram Moolenaar
|
VIM USER MANUAL - by Bram Moolenaar
|
||||||
|
|
||||||
@@ -689,26 +689,21 @@ Do not include anything that is a user preference. Don't set 'tabstop',
|
|||||||
Do not include mappings or abbreviations. Only include setting 'iskeyword' if
|
Do not include mappings or abbreviations. Only include setting 'iskeyword' if
|
||||||
it is really necessary for recognizing keywords.
|
it is really necessary for recognizing keywords.
|
||||||
|
|
||||||
Avoid using specific colors. Link to the standard highlight groups whenever
|
To allow users select their own preferred colors, make a different group name
|
||||||
possible. Don't forget that some people use a different background color, or
|
for every kind of highlighted item. Then link each of them to one of the
|
||||||
have only eight colors available.
|
standard highlight groups. That will make it work with every color scheme.
|
||||||
For backwards compatibility with Vim 5.8 this construction is used: >
|
If you select specific colors it will look bad with some color schemes. And
|
||||||
|
don't forget that some people use a different background color, or have only
|
||||||
|
eight colors available.
|
||||||
|
|
||||||
if version >= 508 || !exists("did_c_syn_inits")
|
For the linking use "hi def link", so that the user can select different
|
||||||
if version < 508
|
highlighting before your syntax file is loaded. Example: >
|
||||||
let did_c_syn_inits = 1
|
|
||||||
command -nargs=+ HiLink hi link <args>
|
|
||||||
else
|
|
||||||
command -nargs=+ HiLink hi def link <args>
|
|
||||||
endif
|
|
||||||
|
|
||||||
HiLink nameString String
|
hi def link nameString String
|
||||||
HiLink nameNumber Number
|
hi def link nameNumber Number
|
||||||
|
hi def link nameCommand Statement
|
||||||
... etc ...
|
... etc ...
|
||||||
|
|
||||||
delcommand HiLink
|
|
||||||
endif
|
|
||||||
|
|
||||||
Add the "display" argument to items that are not used when syncing, to speed
|
Add the "display" argument to items that are not used when syncing, to speed
|
||||||
up scrolling backwards and CTRL-L.
|
up scrolling backwards and CTRL-L.
|
||||||
|
|
||||||
|
@@ -754,7 +754,7 @@
|
|||||||
* GUI tabline
|
* GUI tabline
|
||||||
*/
|
*/
|
||||||
#if defined(FEAT_WINDOWS) && (defined(FEAT_GUI_GTK) \
|
#if defined(FEAT_WINDOWS) && (defined(FEAT_GUI_GTK) \
|
||||||
|| (defined(FEAT_GUI_MSWIN) && WINVER > 0x0400))
|
|| (defined(FEAT_GUI_MSWIN) && (!defined(_MSC_VER) || _MSC_VER > 1020)))
|
||||||
# define FEAT_GUI_TABLINE
|
# define FEAT_GUI_TABLINE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
56
src/gui.c
56
src/gui.c
@@ -521,7 +521,7 @@ gui_init()
|
|||||||
#ifndef FEAT_GUI_GTK
|
#ifndef FEAT_GUI_GTK
|
||||||
/* Set the shell size, adjusted for the screen size. For GTK this only
|
/* Set the shell size, adjusted for the screen size. For GTK this only
|
||||||
* works after the shell has been opened, thus it is further down. */
|
* works after the shell has been opened, thus it is further down. */
|
||||||
gui_set_shellsize(FALSE, TRUE);
|
gui_set_shellsize(FALSE, TRUE, RESIZE_BOTH);
|
||||||
#endif
|
#endif
|
||||||
#if defined(FEAT_GUI_MOTIF) && defined(FEAT_MENU)
|
#if defined(FEAT_GUI_MOTIF) && defined(FEAT_MENU)
|
||||||
/* Need to set the size of the menubar after all the menus have been
|
/* Need to set the size of the menubar after all the menus have been
|
||||||
@@ -547,7 +547,7 @@ gui_init()
|
|||||||
/* Give GTK+ a chance to put all widget's into place. */
|
/* Give GTK+ a chance to put all widget's into place. */
|
||||||
gui_mch_update();
|
gui_mch_update();
|
||||||
/* Now make sure the shell fits on the screen. */
|
/* Now make sure the shell fits on the screen. */
|
||||||
gui_set_shellsize(FALSE, TRUE);
|
gui_set_shellsize(FALSE, TRUE, RESIZE_BOTH);
|
||||||
#endif
|
#endif
|
||||||
/* When 'lines' was set while starting up the topframe may have to be
|
/* When 'lines' was set while starting up the topframe may have to be
|
||||||
* resized. */
|
* resized. */
|
||||||
@@ -741,7 +741,7 @@ gui_init_font(font_list, fontset)
|
|||||||
#else
|
#else
|
||||||
FALSE
|
FALSE
|
||||||
#endif
|
#endif
|
||||||
);
|
, RESIZE_BOTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@@ -1354,9 +1354,10 @@ gui_get_shellsize()
|
|||||||
*/
|
*/
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
void
|
void
|
||||||
gui_set_shellsize(mustset, fit_to_display)
|
gui_set_shellsize(mustset, fit_to_display, direction)
|
||||||
int mustset; /* set by the user */
|
int mustset; /* set by the user */
|
||||||
int fit_to_display;
|
int fit_to_display;
|
||||||
|
int direction; /* RESIZE_HOR, RESIZE_VER */
|
||||||
{
|
{
|
||||||
int base_width;
|
int base_width;
|
||||||
int base_height;
|
int base_height;
|
||||||
@@ -1399,14 +1400,14 @@ gui_set_shellsize(mustset, fit_to_display)
|
|||||||
if (fit_to_display)
|
if (fit_to_display)
|
||||||
{
|
{
|
||||||
gui_mch_get_screen_dimensions(&screen_w, &screen_h);
|
gui_mch_get_screen_dimensions(&screen_w, &screen_h);
|
||||||
if (width > screen_w)
|
if ((direction & RESIZE_HOR) && width > screen_w)
|
||||||
{
|
{
|
||||||
Columns = (screen_w - base_width) / gui.char_width;
|
Columns = (screen_w - base_width) / gui.char_width;
|
||||||
if (Columns < MIN_COLUMNS)
|
if (Columns < MIN_COLUMNS)
|
||||||
Columns = MIN_COLUMNS;
|
Columns = MIN_COLUMNS;
|
||||||
width = Columns * gui.char_width + base_width;
|
width = Columns * gui.char_width + base_width;
|
||||||
}
|
}
|
||||||
if (height > screen_h)
|
if ((direction & RESIZE_VERT) && height > screen_h)
|
||||||
{
|
{
|
||||||
Rows = (screen_h - base_height) / gui.char_height;
|
Rows = (screen_h - base_height) / gui.char_height;
|
||||||
check_shellsize();
|
check_shellsize();
|
||||||
@@ -1423,7 +1424,7 @@ gui_set_shellsize(mustset, fit_to_display)
|
|||||||
# endif
|
# endif
|
||||||
|
|
||||||
gui_mch_set_shellsize(width, height, min_width, min_height,
|
gui_mch_set_shellsize(width, height, min_width, min_height,
|
||||||
base_width, base_height);
|
base_width, base_height, direction);
|
||||||
if (fit_to_display)
|
if (fit_to_display)
|
||||||
{
|
{
|
||||||
int x, y;
|
int x, y;
|
||||||
@@ -3087,9 +3088,7 @@ gui_menu_cb(menu)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef FEAT_WINDOWS
|
|
||||||
static int prev_which_scrollbars[3];
|
static int prev_which_scrollbars[3];
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set which components are present.
|
* Set which components are present.
|
||||||
@@ -3203,7 +3202,7 @@ gui_init_which_components(oldval)
|
|||||||
|
|
||||||
if (gui.in_use)
|
if (gui.in_use)
|
||||||
{
|
{
|
||||||
need_set_size = FALSE;
|
need_set_size = 0;
|
||||||
fix_size = FALSE;
|
fix_size = FALSE;
|
||||||
|
|
||||||
#ifdef FEAT_GUI_TABLINE
|
#ifdef FEAT_GUI_TABLINE
|
||||||
@@ -3217,7 +3216,7 @@ gui_init_which_components(oldval)
|
|||||||
i = Rows;
|
i = Rows;
|
||||||
gui_update_tabline();
|
gui_update_tabline();
|
||||||
Rows = i;
|
Rows = i;
|
||||||
need_set_size = TRUE;
|
need_set_size = RESIZE_VERT;
|
||||||
if (using_tabline)
|
if (using_tabline)
|
||||||
fix_size = TRUE;
|
fix_size = TRUE;
|
||||||
if (!gui_use_tabline())
|
if (!gui_use_tabline())
|
||||||
@@ -3227,11 +3226,14 @@ gui_init_which_components(oldval)
|
|||||||
|
|
||||||
for (i = 0; i < 3; i++)
|
for (i = 0; i < 3; i++)
|
||||||
{
|
{
|
||||||
if (gui.which_scrollbars[i] !=
|
/* The scrollbar needs to be updated when it is shown/unshown and
|
||||||
|
* when switching tab pages. But the size only changes when it's
|
||||||
|
* shown/unshown. Thus we need two places to remember whether a
|
||||||
|
* scrollbar is there or not. */
|
||||||
|
if (gui.which_scrollbars[i] != prev_which_scrollbars[i]
|
||||||
#ifdef FEAT_WINDOWS
|
#ifdef FEAT_WINDOWS
|
||||||
curtab->tp_prev_which_scrollbars[i]
|
|| gui.which_scrollbars[i]
|
||||||
#else
|
!= curtab->tp_prev_which_scrollbars[i]
|
||||||
prev_which_scrollbars[i]
|
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -3245,16 +3247,20 @@ gui_init_which_components(oldval)
|
|||||||
gui_do_scrollbar(wp, i, gui.which_scrollbars[i]);
|
gui_do_scrollbar(wp, i, gui.which_scrollbars[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
need_set_size = TRUE;
|
if (gui.which_scrollbars[i] != prev_which_scrollbars[i])
|
||||||
|
{
|
||||||
|
if (i == SBAR_BOTTOM)
|
||||||
|
need_set_size = RESIZE_VERT;
|
||||||
|
else
|
||||||
|
need_set_size = RESIZE_HOR;
|
||||||
if (gui.which_scrollbars[i])
|
if (gui.which_scrollbars[i])
|
||||||
fix_size = TRUE;
|
fix_size = TRUE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#ifdef FEAT_WINDOWS
|
#ifdef FEAT_WINDOWS
|
||||||
curtab->tp_prev_which_scrollbars[i]
|
curtab->tp_prev_which_scrollbars[i] = gui.which_scrollbars[i];
|
||||||
#else
|
|
||||||
prev_which_scrollbars[i]
|
|
||||||
#endif
|
#endif
|
||||||
= gui.which_scrollbars[i];
|
prev_which_scrollbars[i] = gui.which_scrollbars[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEAT_MENU
|
#ifdef FEAT_MENU
|
||||||
@@ -3266,7 +3272,7 @@ gui_init_which_components(oldval)
|
|||||||
gui_mch_enable_menu(gui.menu_is_active);
|
gui_mch_enable_menu(gui.menu_is_active);
|
||||||
Rows = i;
|
Rows = i;
|
||||||
prev_menu_is_active = gui.menu_is_active;
|
prev_menu_is_active = gui.menu_is_active;
|
||||||
need_set_size = TRUE;
|
need_set_size = RESIZE_VERT;
|
||||||
if (gui.menu_is_active)
|
if (gui.menu_is_active)
|
||||||
fix_size = TRUE;
|
fix_size = TRUE;
|
||||||
}
|
}
|
||||||
@@ -3277,7 +3283,7 @@ gui_init_which_components(oldval)
|
|||||||
{
|
{
|
||||||
gui_mch_show_toolbar(using_toolbar);
|
gui_mch_show_toolbar(using_toolbar);
|
||||||
prev_toolbar = using_toolbar;
|
prev_toolbar = using_toolbar;
|
||||||
need_set_size = TRUE;
|
need_set_size = RESIZE_VERT;
|
||||||
if (using_toolbar)
|
if (using_toolbar)
|
||||||
fix_size = TRUE;
|
fix_size = TRUE;
|
||||||
}
|
}
|
||||||
@@ -3287,7 +3293,7 @@ gui_init_which_components(oldval)
|
|||||||
{
|
{
|
||||||
gui_mch_enable_footer(using_footer);
|
gui_mch_enable_footer(using_footer);
|
||||||
prev_footer = using_footer;
|
prev_footer = using_footer;
|
||||||
need_set_size = TRUE;
|
need_set_size = RESIZE_VERT;
|
||||||
if (using_footer)
|
if (using_footer)
|
||||||
fix_size = TRUE;
|
fix_size = TRUE;
|
||||||
}
|
}
|
||||||
@@ -3307,7 +3313,7 @@ gui_init_which_components(oldval)
|
|||||||
/* Adjust the size of the window to make the text area keep the
|
/* Adjust the size of the window to make the text area keep the
|
||||||
* same size and to avoid that part of our window is off-screen
|
* same size and to avoid that part of our window is off-screen
|
||||||
* and a scrollbar can't be used, for example. */
|
* and a scrollbar can't be used, for example. */
|
||||||
gui_set_shellsize(FALSE, fix_size);
|
gui_set_shellsize(FALSE, fix_size, need_set_size);
|
||||||
|
|
||||||
#ifdef FEAT_GUI_GTK
|
#ifdef FEAT_GUI_GTK
|
||||||
/* GTK has the annoying habit of sending us resize events when
|
/* GTK has the annoying habit of sending us resize events when
|
||||||
@@ -3379,7 +3385,7 @@ gui_update_tabline()
|
|||||||
/* When the tabs change from hidden to shown or from shown to
|
/* When the tabs change from hidden to shown or from shown to
|
||||||
* hidden the size of the text area should remain the same. */
|
* hidden the size of the text area should remain the same. */
|
||||||
if (!showit != !shown)
|
if (!showit != !shown)
|
||||||
gui_set_shellsize(FALSE, showit);
|
gui_set_shellsize(FALSE, showit, RESIZE_VERT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -159,7 +159,7 @@
|
|||||||
#define TOOLBAR_BORDER_HEIGHT 12 /* room above+below buttons for MSWindows */
|
#define TOOLBAR_BORDER_HEIGHT 12 /* room above+below buttons for MSWindows */
|
||||||
|
|
||||||
#ifdef FEAT_GUI_MSWIN
|
#ifdef FEAT_GUI_MSWIN
|
||||||
# define TABLINE_HEIGHT 24
|
# define TABLINE_HEIGHT 22
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(NO_CONSOLE) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11)
|
#if defined(NO_CONSOLE) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11)
|
||||||
|
@@ -1041,7 +1041,7 @@ gui_mch_new_menu_font()
|
|||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
gui_set_shellsize(FALSE, TRUE);
|
gui_set_shellsize(FALSE, TRUE, RESIZE_VERT);
|
||||||
ui_new_shellsize();
|
ui_new_shellsize();
|
||||||
if (oldpuller != None)
|
if (oldpuller != None)
|
||||||
XFreePixmap(gui.dpy, oldpuller);
|
XFreePixmap(gui.dpy, oldpuller);
|
||||||
@@ -1418,7 +1418,7 @@ gui_mch_show_toolbar(int showit)
|
|||||||
|
|
||||||
XtUnmanageChild(toolBar);
|
XtUnmanageChild(toolBar);
|
||||||
}
|
}
|
||||||
gui_set_shellsize(FALSE, FALSE);
|
gui_set_shellsize(FALSE, FALSE, RESIZE_VERT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1233,7 +1233,7 @@ gui_mch_new_menu_font()
|
|||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
gui_set_shellsize(FALSE, TRUE);
|
gui_set_shellsize(FALSE, TRUE, RESIZE_VERT);
|
||||||
ui_new_shellsize();
|
ui_new_shellsize();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2799,7 +2799,7 @@ gui_mch_show_toolbar(int showit)
|
|||||||
|
|
||||||
XtUnmanageChild(XtParent(toolBar));
|
XtUnmanageChild(XtParent(toolBar));
|
||||||
}
|
}
|
||||||
gui_set_shellsize(FALSE, FALSE);
|
gui_set_shellsize(FALSE, FALSE, RESIZE_VERT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -692,13 +692,14 @@ gui_mch_set_winpos(int x, int y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gui_mch_set_shellsize(width, height, min_width, min_height, base_width, base_height)
|
gui_mch_set_shellsize(width, height, min_width, min_height, base_width, base_height, direction)
|
||||||
int width; /* In OS units */
|
int width; /* In OS units */
|
||||||
int height;
|
int height;
|
||||||
int min_width; /* Smallest permissable window size (ignored) */
|
int min_width; /* Smallest permissable window size (ignored) */
|
||||||
int min_height;
|
int min_height;
|
||||||
int base_width; /* Space for scroll bars, etc */
|
int base_width; /* Space for scroll bars, etc */
|
||||||
int base_height;
|
int base_height;
|
||||||
|
int direction;
|
||||||
{
|
{
|
||||||
int s_width, s_height;
|
int s_width, s_height;
|
||||||
int block[] = {
|
int block[] = {
|
||||||
|
@@ -128,7 +128,7 @@ gui_mswin_get_menu_height(
|
|||||||
if (fix_window && menu_height != old_menu_height)
|
if (fix_window && menu_height != old_menu_height)
|
||||||
{
|
{
|
||||||
old_menu_height = menu_height;
|
old_menu_height = menu_height;
|
||||||
gui_set_shellsize(FALSE, FALSE);
|
gui_set_shellsize(FALSE, FALSE, RESIZE_VERT);
|
||||||
}
|
}
|
||||||
|
|
||||||
return menu_height;
|
return menu_height;
|
||||||
@@ -488,7 +488,8 @@ gui_mch_init(void)
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
gui_mch_set_shellsize(int width, int height,
|
gui_mch_set_shellsize(int width, int height,
|
||||||
int min_width, int min_height, int base_width, int base_height)
|
int min_width, int min_height, int base_width, int base_height,
|
||||||
|
int direction)
|
||||||
{
|
{
|
||||||
RECT workarea_rect;
|
RECT workarea_rect;
|
||||||
int win_width, win_height;
|
int win_width, win_height;
|
||||||
@@ -528,16 +529,17 @@ gui_mch_set_shellsize(int width, int height,
|
|||||||
;
|
;
|
||||||
|
|
||||||
/* if the window is going off the screen, move it on to the screen */
|
/* if the window is going off the screen, move it on to the screen */
|
||||||
if (win_xpos + win_width > workarea_rect.right)
|
if ((direction & RESIZE_HOR) && win_xpos + win_width > workarea_rect.right)
|
||||||
win_xpos = workarea_rect.right - win_width;
|
win_xpos = workarea_rect.right - win_width;
|
||||||
|
|
||||||
if (win_xpos < workarea_rect.left)
|
if ((direction & RESIZE_HOR) && win_xpos < workarea_rect.left)
|
||||||
win_xpos = workarea_rect.left;
|
win_xpos = workarea_rect.left;
|
||||||
|
|
||||||
if (win_ypos + win_height > workarea_rect.bottom)
|
if ((direction & RESIZE_VERT)
|
||||||
|
&& win_ypos + win_height > workarea_rect.bottom)
|
||||||
win_ypos = workarea_rect.bottom - win_height;
|
win_ypos = workarea_rect.bottom - win_height;
|
||||||
|
|
||||||
if (win_ypos < workarea_rect.top)
|
if ((direction & RESIZE_VERT) && win_ypos < workarea_rect.top)
|
||||||
win_ypos = workarea_rect.top;
|
win_ypos = workarea_rect.top;
|
||||||
|
|
||||||
/* set window position */
|
/* set window position */
|
||||||
|
@@ -1114,13 +1114,17 @@ gui_mch_set_text_area_pos(int x, int y, int w, int h)
|
|||||||
if (showing_tabline)
|
if (showing_tabline)
|
||||||
{
|
{
|
||||||
int top = 0;
|
int top = 0;
|
||||||
|
RECT rect;
|
||||||
|
|
||||||
#ifdef FEAT_TOOLBAR
|
#ifdef FEAT_TOOLBAR
|
||||||
if (vim_strchr(p_go, GO_TOOLBAR) != NULL)
|
if (vim_strchr(p_go, GO_TOOLBAR) != NULL)
|
||||||
top = TOOLBAR_BUTTON_HEIGHT + TOOLBAR_BORDER_HEIGHT;
|
top = TOOLBAR_BUTTON_HEIGHT + TOOLBAR_BORDER_HEIGHT;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
MoveWindow(s_tabhwnd, 0, top, w, TABLINE_HEIGHT, TRUE);
|
GetWindowRect(s_hwnd, &rect);
|
||||||
|
SetRect(&rect, 0, top, rect.right, TABLINE_HEIGHT);
|
||||||
|
TabCtrl_AdjustRect(s_tabhwnd, TRUE, &rect);
|
||||||
|
MoveWindow(s_tabhwnd, 0, top, rect.right, rect.bottom, TRUE);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -2176,6 +2180,68 @@ gui_mch_show_toolbar(int showit)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(FEAT_GUI_TABLINE) || defined(PROTO)
|
#if defined(FEAT_GUI_TABLINE) || defined(PROTO)
|
||||||
|
static void
|
||||||
|
show_tabline_popup_menu(void)
|
||||||
|
{
|
||||||
|
HMENU tab_pmenu;
|
||||||
|
MENUITEMINFO minfo;
|
||||||
|
long rval;
|
||||||
|
POINT pt;
|
||||||
|
char_u string[3];
|
||||||
|
|
||||||
|
tab_pmenu = CreatePopupMenu();
|
||||||
|
if (tab_pmenu == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
minfo.cbSize = sizeof(MENUITEMINFO);
|
||||||
|
minfo.fMask = MIIM_TYPE|MIIM_ID;
|
||||||
|
minfo.fType = MFT_STRING;
|
||||||
|
|
||||||
|
minfo.dwTypeData = _("Close tab");
|
||||||
|
minfo.wID = TABLINE_MENU_CLOSE;
|
||||||
|
InsertMenuItem(tab_pmenu, TABLINE_MENU_CLOSE, FALSE, &minfo);
|
||||||
|
|
||||||
|
minfo.dwTypeData = _("New tab");
|
||||||
|
minfo.wID = TABLINE_MENU_NEW;
|
||||||
|
InsertMenuItem(tab_pmenu, TABLINE_MENU_NEW, FALSE, &minfo);
|
||||||
|
|
||||||
|
minfo.dwTypeData = _("Open tab...");
|
||||||
|
minfo.wID = TABLINE_MENU_OPEN;
|
||||||
|
InsertMenuItem(tab_pmenu, TABLINE_MENU_OPEN, FALSE, &minfo);
|
||||||
|
|
||||||
|
GetCursorPos(&pt);
|
||||||
|
rval = TrackPopupMenuEx(tab_pmenu, TPM_RETURNCMD, pt.x, pt.y, s_tabhwnd,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
DestroyMenu(tab_pmenu);
|
||||||
|
|
||||||
|
/* Add the string cmd into input buffer */
|
||||||
|
if (rval > 0)
|
||||||
|
{
|
||||||
|
TCHITTESTINFO htinfo;
|
||||||
|
int idx;
|
||||||
|
|
||||||
|
if (ScreenToClient(s_tabhwnd, &pt) == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
htinfo.pt.x = pt.x;
|
||||||
|
htinfo.pt.y = pt.y;
|
||||||
|
idx = TabCtrl_HitTest(s_tabhwnd, &htinfo);
|
||||||
|
if (idx == -1)
|
||||||
|
idx = 0;
|
||||||
|
else
|
||||||
|
idx += 1;
|
||||||
|
|
||||||
|
string[0] = CSI;
|
||||||
|
string[1] = KS_TABMENU;
|
||||||
|
string[2] = KE_FILLER;
|
||||||
|
add_to_input_buf(string, 3);
|
||||||
|
string[0] = idx;
|
||||||
|
string[1] = (char_u)(long)rval;
|
||||||
|
add_to_input_buf_csi(string, 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Show or hide the tabline.
|
* Show or hide the tabline.
|
||||||
*/
|
*/
|
||||||
|
@@ -4899,7 +4899,7 @@ xim_instantiate_cb(display, client_data, call_data)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
xim_real_init(x11_window, x11_display);
|
xim_real_init(x11_window, x11_display);
|
||||||
gui_set_shellsize(FALSE, FALSE);
|
gui_set_shellsize(FALSE, FALSE, RESIZE_BOTH);
|
||||||
if (xic != NULL)
|
if (xic != NULL)
|
||||||
XUnregisterIMInstantiateCallback(x11_display, NULL, NULL, NULL,
|
XUnregisterIMInstantiateCallback(x11_display, NULL, NULL, NULL,
|
||||||
xim_instantiate_cb, NULL);
|
xim_instantiate_cb, NULL);
|
||||||
@@ -4923,7 +4923,7 @@ xim_destroy_cb(im, client_data, call_data)
|
|||||||
xic = NULL;
|
xic = NULL;
|
||||||
status_area_enabled = FALSE;
|
status_area_enabled = FALSE;
|
||||||
|
|
||||||
gui_set_shellsize(FALSE, FALSE);
|
gui_set_shellsize(FALSE, FALSE, RESIZE_BOTH);
|
||||||
|
|
||||||
XRegisterIMInstantiateCallback(x11_display, NULL, NULL, NULL,
|
XRegisterIMInstantiateCallback(x11_display, NULL, NULL, NULL,
|
||||||
xim_instantiate_cb, NULL);
|
xim_instantiate_cb, NULL);
|
||||||
@@ -4947,7 +4947,7 @@ xim_init()
|
|||||||
if (xim_real_init(x11_window, x11_display))
|
if (xim_real_init(x11_window, x11_display))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
gui_set_shellsize(FALSE, FALSE);
|
gui_set_shellsize(FALSE, FALSE, RESIZE_BOTH);
|
||||||
|
|
||||||
#ifdef USE_X11R6_XIM
|
#ifdef USE_X11R6_XIM
|
||||||
XRegisterIMInstantiateCallback(x11_display, NULL, NULL, NULL,
|
XRegisterIMInstantiateCallback(x11_display, NULL, NULL, NULL,
|
||||||
@@ -5162,7 +5162,7 @@ xim_real_init(x11_window, x11_display)
|
|||||||
status_area_enabled = TRUE;
|
status_area_enabled = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
gui_set_shellsize(FALSE, FALSE);
|
gui_set_shellsize(FALSE, FALSE, RESIZE_BOTH);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -15,7 +15,7 @@ extern int gui_get_base_height __ARGS((void));
|
|||||||
extern void gui_resize_shell __ARGS((int pixel_width, int pixel_height));
|
extern void gui_resize_shell __ARGS((int pixel_width, int pixel_height));
|
||||||
extern void gui_may_resize_shell __ARGS((void));
|
extern void gui_may_resize_shell __ARGS((void));
|
||||||
extern int gui_get_shellsize __ARGS((void));
|
extern int gui_get_shellsize __ARGS((void));
|
||||||
extern void gui_set_shellsize __ARGS((int mustset, int fit_to_display));
|
extern void gui_set_shellsize __ARGS((int mustset, int fit_to_display, int direction));
|
||||||
extern void gui_new_shellsize __ARGS((void));
|
extern void gui_new_shellsize __ARGS((void));
|
||||||
extern void gui_reset_scroll_region __ARGS((void));
|
extern void gui_reset_scroll_region __ARGS((void));
|
||||||
extern void gui_start_highlight __ARGS((int mask));
|
extern void gui_start_highlight __ARGS((int mask));
|
||||||
|
@@ -16,7 +16,7 @@ extern int gui_mch_open __ARGS((void));
|
|||||||
extern void gui_mch_exit __ARGS((int rc));
|
extern void gui_mch_exit __ARGS((int rc));
|
||||||
extern int gui_mch_get_winpos __ARGS((int *x, int *y));
|
extern int gui_mch_get_winpos __ARGS((int *x, int *y));
|
||||||
extern void gui_mch_set_winpos __ARGS((int x, int y));
|
extern void gui_mch_set_winpos __ARGS((int x, int y));
|
||||||
extern void gui_mch_set_shellsize __ARGS((int width, int height, int min_width, int min_height, int base_width, int base_height));
|
extern void gui_mch_set_shellsize __ARGS((int width, int height, int min_width, int min_height, int base_width, int base_height, int direction));
|
||||||
extern void gui_mch_get_screen_dimensions __ARGS((int *screen_w, int *screen_h));
|
extern void gui_mch_get_screen_dimensions __ARGS((int *screen_w, int *screen_h));
|
||||||
extern void gui_mch_settitle __ARGS((char_u *title, char_u *icon));
|
extern void gui_mch_settitle __ARGS((char_u *title, char_u *icon));
|
||||||
extern void gui_mch_enable_menu __ARGS((int showit));
|
extern void gui_mch_enable_menu __ARGS((int showit));
|
||||||
|
@@ -11,7 +11,7 @@ extern char_u *gui_mch_browse __ARGS((int saving, char_u *title, char_u *default
|
|||||||
extern int gui_mch_dialog __ARGS((int type, char_u *title, char_u *message, char_u *buttons, int default_button, char_u *textfield));
|
extern int gui_mch_dialog __ARGS((int type, char_u *title, char_u *message, char_u *buttons, int default_button, char_u *textfield));
|
||||||
extern int gui_mch_get_winpos __ARGS((int *x, int *y));
|
extern int gui_mch_get_winpos __ARGS((int *x, int *y));
|
||||||
extern void gui_mch_set_winpos __ARGS((int x, int y));
|
extern void gui_mch_set_winpos __ARGS((int x, int y));
|
||||||
extern void gui_mch_set_shellsize __ARGS((int width, int height, int min_width, int min_height, int base_width, int base_height));
|
extern void gui_mch_set_shellsize __ARGS((int width, int height, int min_width, int min_height, int base_width, int base_height, int direction));
|
||||||
extern void gui_mch_get_screen_dimensions __ARGS((int *screen_w, int *screen_h));
|
extern void gui_mch_get_screen_dimensions __ARGS((int *screen_w, int *screen_h));
|
||||||
extern void gui_mch_iconify __ARGS((void));
|
extern void gui_mch_iconify __ARGS((void));
|
||||||
extern void gui_mch_set_foreground __ARGS((void));
|
extern void gui_mch_set_foreground __ARGS((void));
|
||||||
|
@@ -59,7 +59,7 @@ extern char_u *gui_mch_browse __ARGS((int saving, char_u *title, char_u *dflt, c
|
|||||||
extern int get_cmd_args __ARGS((char *prog, char *cmdline, char ***argvp, char **tofree));
|
extern int get_cmd_args __ARGS((char *prog, char *cmdline, char ***argvp, char **tofree));
|
||||||
extern void gui_mch_prepare __ARGS((int *argc, char **argv));
|
extern void gui_mch_prepare __ARGS((int *argc, char **argv));
|
||||||
extern int gui_mch_init __ARGS((void));
|
extern int gui_mch_init __ARGS((void));
|
||||||
extern void gui_mch_set_shellsize __ARGS((int width, int height, int min_width, int min_height, int base_width, int base_height));
|
extern void gui_mch_set_shellsize __ARGS((int width, int height, int min_width, int min_height, int base_width, int base_height, int direction));
|
||||||
extern void gui_mch_set_scrollbar_thumb __ARGS((scrollbar_T *sb, long val, long size, long max));
|
extern void gui_mch_set_scrollbar_thumb __ARGS((scrollbar_T *sb, long val, long size, long max));
|
||||||
extern void gui_mch_set_font __ARGS((GuiFont font));
|
extern void gui_mch_set_font __ARGS((GuiFont font));
|
||||||
extern void gui_mch_set_fg_color __ARGS((guicolor_T color));
|
extern void gui_mch_set_fg_color __ARGS((guicolor_T color));
|
||||||
|
@@ -61,7 +61,7 @@ extern int gui_is_win32s __ARGS((void));
|
|||||||
extern void gui_mch_set_parent __ARGS((char *title));
|
extern void gui_mch_set_parent __ARGS((char *title));
|
||||||
extern void gui_mch_prepare __ARGS((int *argc, char **argv));
|
extern void gui_mch_prepare __ARGS((int *argc, char **argv));
|
||||||
extern int gui_mch_init __ARGS((void));
|
extern int gui_mch_init __ARGS((void));
|
||||||
extern void gui_mch_set_shellsize __ARGS((int width, int height, int min_width, int min_height, int base_width, int base_height));
|
extern void gui_mch_set_shellsize __ARGS((int width, int height, int min_width, int min_height, int base_width, int base_height, int direction));
|
||||||
extern void gui_mch_set_scrollbar_thumb __ARGS((scrollbar_T *sb, long val, long size, long max));
|
extern void gui_mch_set_scrollbar_thumb __ARGS((scrollbar_T *sb, long val, long size, long max));
|
||||||
extern void gui_mch_set_font __ARGS((GuiFont font));
|
extern void gui_mch_set_font __ARGS((GuiFont font));
|
||||||
extern void gui_mch_set_fg_color __ARGS((guicolor_T color));
|
extern void gui_mch_set_fg_color __ARGS((guicolor_T color));
|
||||||
|
@@ -1013,6 +1013,13 @@ extern char *(*dyn_libintl_textdomain)(const char *domainname);
|
|||||||
#define WSP_BELOW 32 /* put new window below/right */
|
#define WSP_BELOW 32 /* put new window below/right */
|
||||||
#define WSP_ABOVE 64 /* put new window above/left */
|
#define WSP_ABOVE 64 /* put new window above/left */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* arguments for gui_set_shellsize()
|
||||||
|
*/
|
||||||
|
#define RESIZE_VERT 1 /* resize vertically */
|
||||||
|
#define RESIZE_HOR 2 /* resize horizontally */
|
||||||
|
#define RESIZE_BOTH 15 /* resize in both directions */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* "flags" values for option-setting functions.
|
* "flags" values for option-setting functions.
|
||||||
* When OPT_GLOBAL and OPT_LOCAL are both missing, set both local and global
|
* When OPT_GLOBAL and OPT_LOCAL are both missing, set both local and global
|
||||||
|
Reference in New Issue
Block a user