mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge #2609 'Macro cleanup'
This commit is contained in:
commit
14ae3c0cbd
@ -3576,7 +3576,7 @@ void fname_expand(buf_T *buf, char_u **ffname, char_u **sfname)
|
||||
*sfname = *ffname;
|
||||
*ffname = (char_u *)fix_fname((char *)*ffname); /* expand to full path */
|
||||
|
||||
#ifdef FEAT_SHORTCUT
|
||||
#ifdef WIN32
|
||||
if (!buf->b_p_bin) {
|
||||
char_u *rfname;
|
||||
|
||||
|
@ -9936,9 +9936,7 @@ static void f_has(typval_T *argvars, typval_T *rettv)
|
||||
#endif
|
||||
"arabic",
|
||||
"autocmd",
|
||||
#if defined(FEAT_BROWSE) && (defined(USE_FILE_CHOOSER) \
|
||||
|| defined(FEAT_GUI_W32) \
|
||||
|| defined(FEAT_GUI_MOTIF))
|
||||
#ifdef FEAT_BROWSE
|
||||
"browsefilter",
|
||||
#endif
|
||||
"byte_offset",
|
||||
@ -12429,7 +12427,7 @@ static void f_resolve(typval_T *argvars, typval_T *rettv)
|
||||
#endif
|
||||
|
||||
p = get_tv_string(&argvars[0]);
|
||||
#ifdef FEAT_SHORTCUT
|
||||
#ifdef WIN32
|
||||
{
|
||||
char_u *v = NULL;
|
||||
|
||||
|
@ -460,12 +460,6 @@ add_menu_path (
|
||||
menu->silent[i] = menuarg->silent[0];
|
||||
}
|
||||
}
|
||||
#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32) \
|
||||
&& (defined(FEAT_BEVAL) || defined(FEAT_GUI_GTK))
|
||||
/* Need to update the menu tip. */
|
||||
if (modes & MENU_TIP_MODE)
|
||||
gui_mch_menu_set_tip(menu);
|
||||
#endif
|
||||
}
|
||||
return OK;
|
||||
|
||||
@ -613,12 +607,6 @@ remove_menu (
|
||||
menu->modes |= child->modes;
|
||||
if (modes & MENU_TIP_MODE) {
|
||||
free_menu_string(menu, MENU_INDEX_TIP);
|
||||
#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32) \
|
||||
&& (defined(FEAT_BEVAL) || defined(FEAT_GUI_GTK))
|
||||
/* Need to update the menu tip. */
|
||||
if (gui.in_use)
|
||||
gui_mch_menu_set_tip(menu);
|
||||
#endif
|
||||
}
|
||||
if ((menu->modes & MENU_ALL_MODES) == 0) {
|
||||
/* The menu item is no longer valid in ANY mode, so delete it */
|
||||
@ -1332,61 +1320,6 @@ void ex_emenu(exarg_T *eap)
|
||||
EMSG2(_("E335: Menu not defined for %s mode"), mode);
|
||||
}
|
||||
|
||||
#if defined(FEAT_GUI_MSWIN) \
|
||||
|| defined(FEAT_GUI_GTK) \
|
||||
|| defined(FEAT_BEVAL_TIP)
|
||||
/*
|
||||
* Given a menu descriptor, e.g. "File.New", find it in the menu hierarchy.
|
||||
*/
|
||||
vimmenu_T *gui_find_menu(char_u *path_name)
|
||||
{
|
||||
vimmenu_T *menu = NULL;
|
||||
char_u *name;
|
||||
char_u *saved_name;
|
||||
char_u *p;
|
||||
|
||||
menu = root_menu;
|
||||
|
||||
saved_name = vim_strsave(path_name);
|
||||
|
||||
name = saved_name;
|
||||
while (*name) {
|
||||
/* find the end of one dot-separated name and put a NUL at the dot */
|
||||
p = menu_name_skip(name);
|
||||
|
||||
while (menu != NULL) {
|
||||
if (menu_name_equal(name, menu)) {
|
||||
if (menu->children == NULL) {
|
||||
/* found a menu item instead of a sub-menu */
|
||||
if (*p == NUL)
|
||||
EMSG(_("E336: Menu path must lead to a sub-menu"));
|
||||
else
|
||||
EMSG(_(e_notsubmenu));
|
||||
menu = NULL;
|
||||
goto theend;
|
||||
}
|
||||
if (*p == NUL) /* found a full match */
|
||||
goto theend;
|
||||
break;
|
||||
}
|
||||
menu = menu->next;
|
||||
}
|
||||
if (menu == NULL) /* didn't find it */
|
||||
break;
|
||||
|
||||
/* Found a match, search the sub-menu. */
|
||||
menu = menu->children;
|
||||
name = p;
|
||||
}
|
||||
|
||||
if (menu == NULL)
|
||||
EMSG(_("E337: Menu not found - check menu names"));
|
||||
theend:
|
||||
xfree(saved_name);
|
||||
return menu;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Translation of menu names. Just a simple lookup table.
|
||||
*/
|
||||
|
@ -2234,15 +2234,11 @@ void mch_errmsg(char *str)
|
||||
{
|
||||
int len;
|
||||
|
||||
#if (defined(UNIX) || defined(FEAT_GUI)) && !defined(ALWAYS_USE_GUI)
|
||||
#ifdef UNIX
|
||||
/* On Unix use stderr if it's a tty.
|
||||
* When not going to start the GUI also use stderr.
|
||||
* On Mac, when started from Finder, stderr is the console. */
|
||||
if (
|
||||
# ifdef UNIX
|
||||
isatty(2)
|
||||
# endif
|
||||
) {
|
||||
if (os_isatty(2)) {
|
||||
fprintf(stderr, "%s", str);
|
||||
return;
|
||||
}
|
||||
@ -2284,16 +2280,12 @@ void mch_errmsg(char *str)
|
||||
*/
|
||||
void mch_msg(char *str)
|
||||
{
|
||||
#if (defined(UNIX) || defined(FEAT_GUI)) && !defined(ALWAYS_USE_GUI)
|
||||
#ifdef UNIX
|
||||
/* On Unix use stdout if we have a tty. This allows "vim -h | more" and
|
||||
* uses mch_errmsg() when started from the desktop.
|
||||
* When not going to start the GUI also use stdout.
|
||||
* On Mac, when started from Finder, stderr is the console. */
|
||||
if (
|
||||
# ifdef UNIX
|
||||
isatty(2)
|
||||
# endif
|
||||
) {
|
||||
if (os_isatty(2)) {
|
||||
printf("%s", str);
|
||||
return;
|
||||
}
|
||||
|
@ -2105,11 +2105,6 @@ do_mouse (
|
||||
* NOTE: Ignore right button down and drag mouse events.
|
||||
* Windows only shows the popup menu on the button up event.
|
||||
*/
|
||||
#if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_GTK) \
|
||||
|| defined(FEAT_GUI_MAC)
|
||||
if (!is_click)
|
||||
return false;
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
if (which_button == MOUSE_LEFT
|
||||
|
@ -332,20 +332,15 @@ enum {
|
||||
/* Maximum number of bytes in a multi-byte character. It can be one 32-bit
|
||||
* character of up to 6 bytes, or one 16-bit character of up to three bytes
|
||||
* plus six following composing characters of three bytes each. */
|
||||
# define MB_MAXBYTES 21
|
||||
#define MB_MAXBYTES 21
|
||||
|
||||
/* This has to go after the include of proto.h, as proto/gui.pro declares
|
||||
* functions of these names. The declarations would break if the defines had
|
||||
* been seen at that stage. But it must be before globals.h, where error_ga
|
||||
* is declared. */
|
||||
#if !defined(FEAT_GUI_W32) && !defined(FEAT_GUI_X11) \
|
||||
&& !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_MAC)
|
||||
# define mch_errmsg(str) fprintf(stderr, "%s", (str))
|
||||
# define display_errors() fflush(stderr)
|
||||
# define mch_msg(str) printf("%s", (str))
|
||||
#else
|
||||
# define USE_MCH_ERRMSG
|
||||
#endif
|
||||
#define mch_errmsg(str) fprintf(stderr, "%s", (str))
|
||||
#define display_errors() fflush(stderr)
|
||||
#define mch_msg(str) printf("%s", (str))
|
||||
|
||||
#include "nvim/globals.h" /* global variables and messages */
|
||||
#include "nvim/buffer_defs.h" /* buffer and windows */
|
||||
|
Loading…
Reference in New Issue
Block a user