|
Karsten Hopp |
dab478 |
To: vim-dev@vim.org
|
|
Karsten Hopp |
dab478 |
Subject: Patch 7.2.432
|
|
Karsten Hopp |
dab478 |
Fcc: outbox
|
|
Karsten Hopp |
dab478 |
From: Bram Moolenaar <Bram@moolenaar.net>
|
|
Karsten Hopp |
dab478 |
Mime-Version: 1.0
|
|
Karsten Hopp |
dab478 |
Content-Type: text/plain; charset=UTF-8
|
|
Karsten Hopp |
dab478 |
Content-Transfer-Encoding: 8bit
|
|
Karsten Hopp |
dab478 |
------------
|
|
Karsten Hopp |
dab478 |
|
|
Karsten Hopp |
dab478 |
Patch 7.2.432
|
|
Karsten Hopp |
dab478 |
Problem: When menus are translated they can only be found by the translated
|
|
Karsten Hopp |
dab478 |
name. That makes ":emenu" difficult to use.
|
|
Karsten Hopp |
dab478 |
Solution: Store the untranslated name and use it for completion and :emenu.
|
|
Karsten Hopp |
dab478 |
(Edward L. Fox / Liang Peng / Bezetek James)
|
|
Karsten Hopp |
dab478 |
Files: src/menu.c, src/structs.h
|
|
Karsten Hopp |
dab478 |
|
|
Karsten Hopp |
dab478 |
|
|
Karsten Hopp |
dab478 |
*** ../vim-7.2.431/src/menu.c 2010-05-14 21:19:16.000000000 +0200
|
|
Karsten Hopp |
dab478 |
--- src/menu.c 2010-05-14 21:52:58.000000000 +0200
|
|
Karsten Hopp |
dab478 |
***************
|
|
Karsten Hopp |
dab478 |
*** 58,63 ****
|
|
Karsten Hopp |
dab478 |
--- 58,66 ----
|
|
Karsten Hopp |
dab478 |
static char_u *menutrans_lookup __ARGS((char_u *name, int len));
|
|
Karsten Hopp |
dab478 |
#endif
|
|
Karsten Hopp |
dab478 |
|
|
Karsten Hopp |
dab478 |
+ static char_u *menu_translate_tab_and_shift __ARGS((char_u *arg_start));
|
|
Karsten Hopp |
dab478 |
+ static void menu_unescape_name __ARGS((char_u *p));
|
|
Karsten Hopp |
dab478 |
+
|
|
Karsten Hopp |
dab478 |
/* The character for each menu mode */
|
|
Karsten Hopp |
dab478 |
static char_u menu_mode_chars[] = {'n', 'v', 's', 'o', 'i', 'c', 't'};
|
|
Karsten Hopp |
dab478 |
|
|
Karsten Hopp |
dab478 |
***************
|
|
Karsten Hopp |
dab478 |
*** 106,115 ****
|
|
Karsten Hopp |
dab478 |
int pri_tab[MENUDEPTH + 1];
|
|
Karsten Hopp |
dab478 |
int enable = MAYBE; /* TRUE for "menu enable", FALSE for "menu
|
|
Karsten Hopp |
dab478 |
* disable */
|
|
Karsten Hopp |
dab478 |
- #ifdef FEAT_MULTI_LANG
|
|
Karsten Hopp |
dab478 |
- char_u *tofree = NULL;
|
|
Karsten Hopp |
dab478 |
- char_u *new_cmd;
|
|
Karsten Hopp |
dab478 |
- #endif
|
|
Karsten Hopp |
dab478 |
#ifdef FEAT_TOOLBAR
|
|
Karsten Hopp |
dab478 |
char_u *icon = NULL;
|
|
Karsten Hopp |
dab478 |
#endif
|
|
Karsten Hopp |
dab478 |
--- 109,114 ----
|
|
Karsten Hopp |
dab478 |
***************
|
|
Karsten Hopp |
dab478 |
*** 251,291 ****
|
|
Karsten Hopp |
dab478 |
}
|
|
Karsten Hopp |
dab478 |
#endif
|
|
Karsten Hopp |
dab478 |
|
|
Karsten Hopp |
dab478 |
- #ifdef FEAT_MULTI_LANG
|
|
Karsten Hopp |
dab478 |
- /*
|
|
Karsten Hopp |
dab478 |
- * Translate menu names as specified with ":menutrans" commands.
|
|
Karsten Hopp |
dab478 |
- */
|
|
Karsten Hopp |
dab478 |
- menu_path = arg;
|
|
Karsten Hopp |
dab478 |
- while (*menu_path)
|
|
Karsten Hopp |
dab478 |
- {
|
|
Karsten Hopp |
dab478 |
- /* find the end of one part and check if it should be translated */
|
|
Karsten Hopp |
dab478 |
- p = menu_skip_part(menu_path);
|
|
Karsten Hopp |
dab478 |
- map_to = menutrans_lookup(menu_path, (int)(p - menu_path));
|
|
Karsten Hopp |
dab478 |
- if (map_to != NULL)
|
|
Karsten Hopp |
dab478 |
- {
|
|
Karsten Hopp |
dab478 |
- /* found a match: replace with the translated part */
|
|
Karsten Hopp |
dab478 |
- i = (int)STRLEN(map_to);
|
|
Karsten Hopp |
dab478 |
- new_cmd = alloc((unsigned)STRLEN(arg) + i + 1);
|
|
Karsten Hopp |
dab478 |
- if (new_cmd == NULL)
|
|
Karsten Hopp |
dab478 |
- break;
|
|
Karsten Hopp |
dab478 |
- mch_memmove(new_cmd, arg, menu_path - arg);
|
|
Karsten Hopp |
dab478 |
- mch_memmove(new_cmd + (menu_path - arg), map_to, (size_t)i);
|
|
Karsten Hopp |
dab478 |
- STRCPY(new_cmd + (menu_path - arg) + i, p);
|
|
Karsten Hopp |
dab478 |
- p = new_cmd + (menu_path - arg) + i;
|
|
Karsten Hopp |
dab478 |
- vim_free(tofree);
|
|
Karsten Hopp |
dab478 |
- tofree = new_cmd;
|
|
Karsten Hopp |
dab478 |
- arg = new_cmd;
|
|
Karsten Hopp |
dab478 |
- }
|
|
Karsten Hopp |
dab478 |
- if (*p != '.')
|
|
Karsten Hopp |
dab478 |
- break;
|
|
Karsten Hopp |
dab478 |
- menu_path = p + 1;
|
|
Karsten Hopp |
dab478 |
- }
|
|
Karsten Hopp |
dab478 |
- #endif
|
|
Karsten Hopp |
dab478 |
-
|
|
Karsten Hopp |
dab478 |
- /*
|
|
Karsten Hopp |
dab478 |
- * Isolate the menu name.
|
|
Karsten Hopp |
dab478 |
- * Skip the menu name, and translate <Tab> into a real TAB.
|
|
Karsten Hopp |
dab478 |
- */
|
|
Karsten Hopp |
dab478 |
menu_path = arg;
|
|
Karsten Hopp |
dab478 |
if (*menu_path == '.')
|
|
Karsten Hopp |
dab478 |
{
|
|
Karsten Hopp |
dab478 |
--- 250,255 ----
|
|
Karsten Hopp |
dab478 |
***************
|
|
Karsten Hopp |
dab478 |
*** 293,313 ****
|
|
Karsten Hopp |
dab478 |
goto theend;
|
|
Karsten Hopp |
dab478 |
}
|
|
Karsten Hopp |
dab478 |
|
|
Karsten Hopp |
dab478 |
! while (*arg && !vim_iswhite(*arg))
|
|
Karsten Hopp |
dab478 |
! {
|
|
Karsten Hopp |
dab478 |
! if ((*arg == '\\' || *arg == Ctrl_V) && arg[1] != NUL)
|
|
Karsten Hopp |
dab478 |
! arg++;
|
|
Karsten Hopp |
dab478 |
! else if (STRNICMP(arg, "<TAB>", 5) == 0)
|
|
Karsten Hopp |
dab478 |
! {
|
|
Karsten Hopp |
dab478 |
! *arg = TAB;
|
|
Karsten Hopp |
dab478 |
! STRMOVE(arg + 1, arg + 5);
|
|
Karsten Hopp |
dab478 |
! }
|
|
Karsten Hopp |
dab478 |
! arg++;
|
|
Karsten Hopp |
dab478 |
! }
|
|
Karsten Hopp |
dab478 |
! if (*arg != NUL)
|
|
Karsten Hopp |
dab478 |
! *arg++ = NUL;
|
|
Karsten Hopp |
dab478 |
! arg = skipwhite(arg);
|
|
Karsten Hopp |
dab478 |
! map_to = arg;
|
|
Karsten Hopp |
dab478 |
|
|
Karsten Hopp |
dab478 |
/*
|
|
Karsten Hopp |
dab478 |
* If there is only a menu name, display menus with that name.
|
|
Karsten Hopp |
dab478 |
--- 257,263 ----
|
|
Karsten Hopp |
dab478 |
goto theend;
|
|
Karsten Hopp |
dab478 |
}
|
|
Karsten Hopp |
dab478 |
|
|
Karsten Hopp |
dab478 |
! map_to = menu_translate_tab_and_shift(arg);
|
|
Karsten Hopp |
dab478 |
|
|
Karsten Hopp |
dab478 |
/*
|
|
Karsten Hopp |
dab478 |
* If there is only a menu name, display menus with that name.
|
|
Karsten Hopp |
dab478 |
***************
|
|
Karsten Hopp |
dab478 |
*** 453,463 ****
|
|
Karsten Hopp |
dab478 |
#endif
|
|
Karsten Hopp |
dab478 |
|
|
Karsten Hopp |
dab478 |
theend:
|
|
Karsten Hopp |
dab478 |
- #ifdef FEAT_MULTI_LANG
|
|
Karsten Hopp |
dab478 |
- vim_free(tofree);
|
|
Karsten Hopp |
dab478 |
- #else
|
|
Karsten Hopp |
dab478 |
;
|
|
Karsten Hopp |
dab478 |
- #endif
|
|
Karsten Hopp |
dab478 |
}
|
|
Karsten Hopp |
dab478 |
|
|
Karsten Hopp |
dab478 |
/*
|
|
Karsten Hopp |
dab478 |
--- 403,409 ----
|
|
Karsten Hopp |
dab478 |
***************
|
|
Karsten Hopp |
dab478 |
*** 498,503 ****
|
|
Karsten Hopp |
dab478 |
--- 444,453 ----
|
|
Karsten Hopp |
dab478 |
int pri_idx = 0;
|
|
Karsten Hopp |
dab478 |
int old_modes = 0;
|
|
Karsten Hopp |
dab478 |
int amenu;
|
|
Karsten Hopp |
dab478 |
+ #ifdef FEAT_MULTI_LANG
|
|
Karsten Hopp |
dab478 |
+ char_u *en_name;
|
|
Karsten Hopp |
dab478 |
+ char_u *map_to = NULL;
|
|
Karsten Hopp |
dab478 |
+ #endif
|
|
Karsten Hopp |
dab478 |
|
|
Karsten Hopp |
dab478 |
/* Make a copy so we can stuff around with it, since it could be const */
|
|
Karsten Hopp |
dab478 |
path_name = vim_strsave(menu_path);
|
|
Karsten Hopp |
dab478 |
***************
|
|
Karsten Hopp |
dab478 |
*** 511,516 ****
|
|
Karsten Hopp |
dab478 |
--- 461,476 ----
|
|
Karsten Hopp |
dab478 |
/* Get name of this element in the menu hierarchy, and the simplified
|
|
Karsten Hopp |
dab478 |
* name (without mnemonic and accelerator text). */
|
|
Karsten Hopp |
dab478 |
next_name = menu_name_skip(name);
|
|
Karsten Hopp |
dab478 |
+ #ifdef FEAT_MULTI_LANG
|
|
Karsten Hopp |
dab478 |
+ map_to = menutrans_lookup(name,STRLEN(name));
|
|
Karsten Hopp |
dab478 |
+ if (map_to != NULL)
|
|
Karsten Hopp |
dab478 |
+ {
|
|
Karsten Hopp |
dab478 |
+ en_name = name;
|
|
Karsten Hopp |
dab478 |
+ name = map_to;
|
|
Karsten Hopp |
dab478 |
+ }
|
|
Karsten Hopp |
dab478 |
+ else
|
|
Karsten Hopp |
dab478 |
+ en_name = NULL;
|
|
Karsten Hopp |
dab478 |
+ #endif
|
|
Karsten Hopp |
dab478 |
dname = menu_text(name, NULL, NULL);
|
|
Karsten Hopp |
dab478 |
if (dname == NULL)
|
|
Karsten Hopp |
dab478 |
goto erret;
|
|
Karsten Hopp |
dab478 |
***************
|
|
Karsten Hopp |
dab478 |
*** 594,599 ****
|
|
Karsten Hopp |
dab478 |
--- 554,571 ----
|
|
Karsten Hopp |
dab478 |
menu->name = vim_strsave(name);
|
|
Karsten Hopp |
dab478 |
/* separate mnemonic and accelerator text from actual menu name */
|
|
Karsten Hopp |
dab478 |
menu->dname = menu_text(name, &menu->mnemonic, &menu->actext);
|
|
Karsten Hopp |
dab478 |
+ #ifdef FEAT_MULTI_LANG
|
|
Karsten Hopp |
dab478 |
+ if (en_name != NULL)
|
|
Karsten Hopp |
dab478 |
+ {
|
|
Karsten Hopp |
dab478 |
+ menu->en_name = vim_strsave(en_name);
|
|
Karsten Hopp |
dab478 |
+ menu->en_dname = menu_text(en_name, NULL, NULL);
|
|
Karsten Hopp |
dab478 |
+ }
|
|
Karsten Hopp |
dab478 |
+ else
|
|
Karsten Hopp |
dab478 |
+ {
|
|
Karsten Hopp |
dab478 |
+ menu->en_name = NULL;
|
|
Karsten Hopp |
dab478 |
+ menu->en_dname = NULL;
|
|
Karsten Hopp |
dab478 |
+ }
|
|
Karsten Hopp |
dab478 |
+ #endif
|
|
Karsten Hopp |
dab478 |
menu->priority = pri_tab[pri_idx];
|
|
Karsten Hopp |
dab478 |
menu->parent = parent;
|
|
Karsten Hopp |
dab478 |
#ifdef FEAT_GUI_MOTIF
|
|
Karsten Hopp |
dab478 |
***************
|
|
Karsten Hopp |
dab478 |
*** 1040,1045 ****
|
|
Karsten Hopp |
dab478 |
--- 1012,1021 ----
|
|
Karsten Hopp |
dab478 |
*menup = menu->next;
|
|
Karsten Hopp |
dab478 |
vim_free(menu->name);
|
|
Karsten Hopp |
dab478 |
vim_free(menu->dname);
|
|
Karsten Hopp |
dab478 |
+ #ifdef FEAT_MULTI_LANG
|
|
Karsten Hopp |
dab478 |
+ vim_free(menu->en_name);
|
|
Karsten Hopp |
dab478 |
+ vim_free(menu->en_dname);
|
|
Karsten Hopp |
dab478 |
+ #endif
|
|
Karsten Hopp |
dab478 |
vim_free(menu->actext);
|
|
Karsten Hopp |
dab478 |
#ifdef FEAT_TOOLBAR
|
|
Karsten Hopp |
dab478 |
vim_free(menu->iconfile);
|
|
Karsten Hopp |
dab478 |
***************
|
|
Karsten Hopp |
dab478 |
*** 1357,1365 ****
|
|
Karsten Hopp |
dab478 |
--- 1333,1347 ----
|
|
Karsten Hopp |
dab478 |
{
|
|
Karsten Hopp |
dab478 |
static vimmenu_T *menu = NULL;
|
|
Karsten Hopp |
dab478 |
char_u *str;
|
|
Karsten Hopp |
dab478 |
+ #ifdef FEAT_MULTI_LANG
|
|
Karsten Hopp |
dab478 |
+ static int should_advance = FALSE;
|
|
Karsten Hopp |
dab478 |
+ #endif
|
|
Karsten Hopp |
dab478 |
|
|
Karsten Hopp |
dab478 |
if (idx == 0) /* first call: start at first item */
|
|
Karsten Hopp |
dab478 |
+ {
|
|
Karsten Hopp |
dab478 |
menu = expand_menu;
|
|
Karsten Hopp |
dab478 |
+ should_advance = FALSE;
|
|
Karsten Hopp |
dab478 |
+ }
|
|
Karsten Hopp |
dab478 |
|
|
Karsten Hopp |
dab478 |
/* Skip PopUp[nvoci]. */
|
|
Karsten Hopp |
dab478 |
while (menu != NULL && (menu_is_hidden(menu->dname)
|
|
Karsten Hopp |
dab478 |
***************
|
|
Karsten Hopp |
dab478 |
*** 1372,1383 ****
|
|
Karsten Hopp |
dab478 |
return NULL;
|
|
Karsten Hopp |
dab478 |
|
|
Karsten Hopp |
dab478 |
if (menu->modes & expand_modes)
|
|
Karsten Hopp |
dab478 |
! str = menu->dname;
|
|
Karsten Hopp |
dab478 |
else
|
|
Karsten Hopp |
dab478 |
str = (char_u *)"";
|
|
Karsten Hopp |
dab478 |
|
|
Karsten Hopp |
dab478 |
! /* Advance to next menu entry. */
|
|
Karsten Hopp |
dab478 |
! menu = menu->next;
|
|
Karsten Hopp |
dab478 |
|
|
Karsten Hopp |
dab478 |
return str;
|
|
Karsten Hopp |
dab478 |
}
|
|
Karsten Hopp |
dab478 |
--- 1354,1383 ----
|
|
Karsten Hopp |
dab478 |
return NULL;
|
|
Karsten Hopp |
dab478 |
|
|
Karsten Hopp |
dab478 |
if (menu->modes & expand_modes)
|
|
Karsten Hopp |
dab478 |
! #ifdef FEAT_MULTI_LANG
|
|
Karsten Hopp |
dab478 |
! if (should_advance)
|
|
Karsten Hopp |
dab478 |
! str = menu->en_dname;
|
|
Karsten Hopp |
dab478 |
! else
|
|
Karsten Hopp |
dab478 |
! {
|
|
Karsten Hopp |
dab478 |
! #endif
|
|
Karsten Hopp |
dab478 |
! str = menu->dname;
|
|
Karsten Hopp |
dab478 |
! #ifdef FEAT_MULTI_LANG
|
|
Karsten Hopp |
dab478 |
! if (menu->en_dname == NULL)
|
|
Karsten Hopp |
dab478 |
! should_advance = TRUE;
|
|
Karsten Hopp |
dab478 |
! }
|
|
Karsten Hopp |
dab478 |
! #endif
|
|
Karsten Hopp |
dab478 |
else
|
|
Karsten Hopp |
dab478 |
str = (char_u *)"";
|
|
Karsten Hopp |
dab478 |
|
|
Karsten Hopp |
dab478 |
! #ifdef FEAT_MULTI_LANG
|
|
Karsten Hopp |
dab478 |
! if (should_advance)
|
|
Karsten Hopp |
dab478 |
! #endif
|
|
Karsten Hopp |
dab478 |
! /* Advance to next menu entry. */
|
|
Karsten Hopp |
dab478 |
! menu = menu->next;
|
|
Karsten Hopp |
dab478 |
!
|
|
Karsten Hopp |
dab478 |
! #ifdef FEAT_MULTI_LANG
|
|
Karsten Hopp |
dab478 |
! should_advance = !should_advance;
|
|
Karsten Hopp |
dab478 |
! #endif
|
|
Karsten Hopp |
dab478 |
|
|
Karsten Hopp |
dab478 |
return str;
|
|
Karsten Hopp |
dab478 |
}
|
|
Karsten Hopp |
dab478 |
***************
|
|
Karsten Hopp |
dab478 |
*** 1394,1402 ****
|
|
Karsten Hopp |
dab478 |
--- 1394,1408 ----
|
|
Karsten Hopp |
dab478 |
static vimmenu_T *menu = NULL;
|
|
Karsten Hopp |
dab478 |
static char_u tbuffer[256]; /*hack*/
|
|
Karsten Hopp |
dab478 |
char_u *str;
|
|
Karsten Hopp |
dab478 |
+ #ifdef FEAT_MULTI_LANG
|
|
Karsten Hopp |
dab478 |
+ static int should_advance = FALSE;
|
|
Karsten Hopp |
dab478 |
+ #endif
|
|
Karsten Hopp |
dab478 |
|
|
Karsten Hopp |
dab478 |
if (idx == 0) /* first call: start at first item */
|
|
Karsten Hopp |
dab478 |
+ {
|
|
Karsten Hopp |
dab478 |
menu = expand_menu;
|
|
Karsten Hopp |
dab478 |
+ should_advance = FALSE;
|
|
Karsten Hopp |
dab478 |
+ }
|
|
Karsten Hopp |
dab478 |
|
|
Karsten Hopp |
dab478 |
/* Skip Browse-style entries, popup menus and separators. */
|
|
Karsten Hopp |
dab478 |
while (menu != NULL
|
|
Karsten Hopp |
dab478 |
***************
|
|
Karsten Hopp |
dab478 |
*** 1416,1435 ****
|
|
Karsten Hopp |
dab478 |
{
|
|
Karsten Hopp |
dab478 |
if (menu->children != NULL)
|
|
Karsten Hopp |
dab478 |
{
|
|
Karsten Hopp |
dab478 |
! STRCPY(tbuffer, menu->dname);
|
|
Karsten Hopp |
dab478 |
/* hack on menu separators: use a 'magic' char for the separator
|
|
Karsten Hopp |
dab478 |
* so that '.' in names gets escaped properly */
|
|
Karsten Hopp |
dab478 |
STRCAT(tbuffer, "\001");
|
|
Karsten Hopp |
dab478 |
str = tbuffer;
|
|
Karsten Hopp |
dab478 |
}
|
|
Karsten Hopp |
dab478 |
else
|
|
Karsten Hopp |
dab478 |
! str = menu->dname;
|
|
Karsten Hopp |
dab478 |
}
|
|
Karsten Hopp |
dab478 |
else
|
|
Karsten Hopp |
dab478 |
str = (char_u *)"";
|
|
Karsten Hopp |
dab478 |
|
|
Karsten Hopp |
dab478 |
! /* Advance to next menu entry. */
|
|
Karsten Hopp |
dab478 |
! menu = menu->next;
|
|
Karsten Hopp |
dab478 |
|
|
Karsten Hopp |
dab478 |
return str;
|
|
Karsten Hopp |
dab478 |
}
|
|
Karsten Hopp |
dab478 |
--- 1422,1472 ----
|
|
Karsten Hopp |
dab478 |
{
|
|
Karsten Hopp |
dab478 |
if (menu->children != NULL)
|
|
Karsten Hopp |
dab478 |
{
|
|
Karsten Hopp |
dab478 |
! #ifdef FEAT_MULTI_LANG
|
|
Karsten Hopp |
dab478 |
! if (should_advance)
|
|
Karsten Hopp |
dab478 |
! STRCPY(tbuffer, menu->en_dname);
|
|
Karsten Hopp |
dab478 |
! else
|
|
Karsten Hopp |
dab478 |
! {
|
|
Karsten Hopp |
dab478 |
! #endif
|
|
Karsten Hopp |
dab478 |
! STRCPY(tbuffer, menu->dname);
|
|
Karsten Hopp |
dab478 |
! #ifdef FEAT_MULTI_LANG
|
|
Karsten Hopp |
dab478 |
! if (menu->en_dname == NULL)
|
|
Karsten Hopp |
dab478 |
! should_advance = TRUE;
|
|
Karsten Hopp |
dab478 |
! }
|
|
Karsten Hopp |
dab478 |
! #endif
|
|
Karsten Hopp |
dab478 |
/* hack on menu separators: use a 'magic' char for the separator
|
|
Karsten Hopp |
dab478 |
* so that '.' in names gets escaped properly */
|
|
Karsten Hopp |
dab478 |
STRCAT(tbuffer, "\001");
|
|
Karsten Hopp |
dab478 |
str = tbuffer;
|
|
Karsten Hopp |
dab478 |
}
|
|
Karsten Hopp |
dab478 |
else
|
|
Karsten Hopp |
dab478 |
! #ifdef FEAT_MULTI_LANG
|
|
Karsten Hopp |
dab478 |
! {
|
|
Karsten Hopp |
dab478 |
! if (should_advance)
|
|
Karsten Hopp |
dab478 |
! str = menu->en_dname;
|
|
Karsten Hopp |
dab478 |
! else
|
|
Karsten Hopp |
dab478 |
! {
|
|
Karsten Hopp |
dab478 |
! #endif
|
|
Karsten Hopp |
dab478 |
! str = menu->dname;
|
|
Karsten Hopp |
dab478 |
! #ifdef FEAT_MULTI_LANG
|
|
Karsten Hopp |
dab478 |
! if (menu->en_dname == NULL)
|
|
Karsten Hopp |
dab478 |
! should_advance = TRUE;
|
|
Karsten Hopp |
dab478 |
! }
|
|
Karsten Hopp |
dab478 |
! }
|
|
Karsten Hopp |
dab478 |
! #endif
|
|
Karsten Hopp |
dab478 |
}
|
|
Karsten Hopp |
dab478 |
else
|
|
Karsten Hopp |
dab478 |
str = (char_u *)"";
|
|
Karsten Hopp |
dab478 |
|
|
Karsten Hopp |
dab478 |
! #ifdef FEAT_MULTI_LANG
|
|
Karsten Hopp |
dab478 |
! if (should_advance)
|
|
Karsten Hopp |
dab478 |
! #endif
|
|
Karsten Hopp |
dab478 |
! /* Advance to next menu entry. */
|
|
Karsten Hopp |
dab478 |
! menu = menu->next;
|
|
Karsten Hopp |
dab478 |
!
|
|
Karsten Hopp |
dab478 |
! #ifdef FEAT_MULTI_LANG
|
|
Karsten Hopp |
dab478 |
! should_advance = !should_advance;
|
|
Karsten Hopp |
dab478 |
! #endif
|
|
Karsten Hopp |
dab478 |
|
|
Karsten Hopp |
dab478 |
return str;
|
|
Karsten Hopp |
dab478 |
}
|
|
Karsten Hopp |
dab478 |
***************
|
|
Karsten Hopp |
dab478 |
*** 1469,1475 ****
|
|
Karsten Hopp |
dab478 |
char_u *name;
|
|
Karsten Hopp |
dab478 |
vimmenu_T *menu;
|
|
Karsten Hopp |
dab478 |
{
|
|
Karsten Hopp |
dab478 |
! return (menu_namecmp(name, menu->name) || menu_namecmp(name, menu->dname));
|
|
Karsten Hopp |
dab478 |
}
|
|
Karsten Hopp |
dab478 |
|
|
Karsten Hopp |
dab478 |
static int
|
|
Karsten Hopp |
dab478 |
--- 1506,1516 ----
|
|
Karsten Hopp |
dab478 |
char_u *name;
|
|
Karsten Hopp |
dab478 |
vimmenu_T *menu;
|
|
Karsten Hopp |
dab478 |
{
|
|
Karsten Hopp |
dab478 |
! if (menu->en_name != NULL
|
|
Karsten Hopp |
dab478 |
! && (menu_namecmp(name,menu->en_name)
|
|
Karsten Hopp |
dab478 |
! || menu_namecmp(name,menu->en_dname)))
|
|
Karsten Hopp |
dab478 |
! return TRUE;
|
|
Karsten Hopp |
dab478 |
! return menu_namecmp(name, menu->name) || menu_namecmp(name, menu->dname);
|
|
Karsten Hopp |
dab478 |
}
|
|
Karsten Hopp |
dab478 |
|
|
Karsten Hopp |
dab478 |
static int
|
|
Karsten Hopp |
dab478 |
***************
|
|
Karsten Hopp |
dab478 |
*** 2402,2407 ****
|
|
Karsten Hopp |
dab478 |
--- 2443,2452 ----
|
|
Karsten Hopp |
dab478 |
to = vim_strnsave(to, (int)(arg - to));
|
|
Karsten Hopp |
dab478 |
if (from_noamp != NULL && to != NULL)
|
|
Karsten Hopp |
dab478 |
{
|
|
Karsten Hopp |
dab478 |
+ menu_translate_tab_and_shift(from);
|
|
Karsten Hopp |
dab478 |
+ menu_translate_tab_and_shift(to);
|
|
Karsten Hopp |
dab478 |
+ menu_unescape_name(from);
|
|
Karsten Hopp |
dab478 |
+ menu_unescape_name(to);
|
|
Karsten Hopp |
dab478 |
tp[menutrans_ga.ga_len].from = from;
|
|
Karsten Hopp |
dab478 |
tp[menutrans_ga.ga_len].from_noamp = from_noamp;
|
|
Karsten Hopp |
dab478 |
tp[menutrans_ga.ga_len].to = to;
|
|
Karsten Hopp |
dab478 |
***************
|
|
Karsten Hopp |
dab478 |
*** 2476,2479 ****
|
|
Karsten Hopp |
dab478 |
--- 2521,2566 ----
|
|
Karsten Hopp |
dab478 |
}
|
|
Karsten Hopp |
dab478 |
#endif /* FEAT_MULTI_LANG */
|
|
Karsten Hopp |
dab478 |
|
|
Karsten Hopp |
dab478 |
+ /*
|
|
Karsten Hopp |
dab478 |
+ * Unescape the name in the translate dictionary table.
|
|
Karsten Hopp |
dab478 |
+ */
|
|
Karsten Hopp |
dab478 |
+ static void
|
|
Karsten Hopp |
dab478 |
+ menu_unescape_name(name)
|
|
Karsten Hopp |
dab478 |
+ char_u *name;
|
|
Karsten Hopp |
dab478 |
+ {
|
|
Karsten Hopp |
dab478 |
+ char_u *p;
|
|
Karsten Hopp |
dab478 |
+
|
|
Karsten Hopp |
dab478 |
+ for (p = name; *p && *p != '.'; mb_ptr_adv(p))
|
|
Karsten Hopp |
dab478 |
+ if (*p == '\\')
|
|
Karsten Hopp |
dab478 |
+ STRMOVE(p, p + 1);
|
|
Karsten Hopp |
dab478 |
+ }
|
|
Karsten Hopp |
dab478 |
+
|
|
Karsten Hopp |
dab478 |
+ /*
|
|
Karsten Hopp |
dab478 |
+ * Isolate the menu name.
|
|
Karsten Hopp |
dab478 |
+ * Skip the menu name, and translate <Tab> into a real TAB.
|
|
Karsten Hopp |
dab478 |
+ */
|
|
Karsten Hopp |
dab478 |
+ static char_u *
|
|
Karsten Hopp |
dab478 |
+ menu_translate_tab_and_shift(arg_start)
|
|
Karsten Hopp |
dab478 |
+ char_u *arg_start;
|
|
Karsten Hopp |
dab478 |
+ {
|
|
Karsten Hopp |
dab478 |
+ char_u *arg = arg_start;
|
|
Karsten Hopp |
dab478 |
+
|
|
Karsten Hopp |
dab478 |
+ while (*arg && !vim_iswhite(*arg))
|
|
Karsten Hopp |
dab478 |
+ {
|
|
Karsten Hopp |
dab478 |
+ if ((*arg == '\\' || *arg == Ctrl_V) && arg[1] != NUL)
|
|
Karsten Hopp |
dab478 |
+ arg++;
|
|
Karsten Hopp |
dab478 |
+ else if (STRNICMP(arg, "<TAB>", 5) == 0)
|
|
Karsten Hopp |
dab478 |
+ {
|
|
Karsten Hopp |
dab478 |
+ *arg = TAB;
|
|
Karsten Hopp |
dab478 |
+ STRMOVE(arg + 1, arg + 5);
|
|
Karsten Hopp |
dab478 |
+ }
|
|
Karsten Hopp |
dab478 |
+ arg++;
|
|
Karsten Hopp |
dab478 |
+ }
|
|
Karsten Hopp |
dab478 |
+ if (*arg != NUL)
|
|
Karsten Hopp |
dab478 |
+ *arg++ = NUL;
|
|
Karsten Hopp |
dab478 |
+ arg = skipwhite(arg);
|
|
Karsten Hopp |
dab478 |
+
|
|
Karsten Hopp |
dab478 |
+ return arg;
|
|
Karsten Hopp |
dab478 |
+ }
|
|
Karsten Hopp |
dab478 |
+
|
|
Karsten Hopp |
dab478 |
#endif /* FEAT_MENU */
|
|
Karsten Hopp |
dab478 |
*** ../vim-7.2.431/src/structs.h 2009-09-18 17:24:54.000000000 +0200
|
|
Karsten Hopp |
dab478 |
--- src/structs.h 2010-05-14 22:21:50.000000000 +0200
|
|
Karsten Hopp |
dab478 |
***************
|
|
Karsten Hopp |
dab478 |
*** 232,238 ****
|
|
Karsten Hopp |
dab478 |
{
|
|
Karsten Hopp |
dab478 |
wininfo_T *wi_next; /* next entry or NULL for last entry */
|
|
Karsten Hopp |
dab478 |
wininfo_T *wi_prev; /* previous entry or NULL for first entry */
|
|
Karsten Hopp |
dab478 |
! win_T *wi_win; /* pointer to window that did set wi_lnum */
|
|
Karsten Hopp |
dab478 |
pos_T wi_fpos; /* last cursor position in the file */
|
|
Karsten Hopp |
dab478 |
int wi_optset; /* TRUE when wi_opt has useful values */
|
|
Karsten Hopp |
dab478 |
winopt_T wi_opt; /* local window options */
|
|
Karsten Hopp |
dab478 |
--- 232,238 ----
|
|
Karsten Hopp |
dab478 |
{
|
|
Karsten Hopp |
dab478 |
wininfo_T *wi_next; /* next entry or NULL for last entry */
|
|
Karsten Hopp |
dab478 |
wininfo_T *wi_prev; /* previous entry or NULL for first entry */
|
|
Karsten Hopp |
dab478 |
! win_T *wi_win; /* pointer to window that did set wi_fpos */
|
|
Karsten Hopp |
dab478 |
pos_T wi_fpos; /* last cursor position in the file */
|
|
Karsten Hopp |
dab478 |
int wi_optset; /* TRUE when wi_opt has useful values */
|
|
Karsten Hopp |
dab478 |
winopt_T wi_opt; /* local window options */
|
|
Karsten Hopp |
dab478 |
***************
|
|
Karsten Hopp |
dab478 |
*** 2207,2214 ****
|
|
Karsten Hopp |
dab478 |
{
|
|
Karsten Hopp |
dab478 |
int modes; /* Which modes is this menu visible for? */
|
|
Karsten Hopp |
dab478 |
int enabled; /* for which modes the menu is enabled */
|
|
Karsten Hopp |
dab478 |
! char_u *name; /* Name of menu */
|
|
Karsten Hopp |
dab478 |
! char_u *dname; /* Displayed Name (without '&') */
|
|
Karsten Hopp |
dab478 |
int mnemonic; /* mnemonic key (after '&') */
|
|
Karsten Hopp |
dab478 |
char_u *actext; /* accelerator text (after TAB) */
|
|
Karsten Hopp |
dab478 |
int priority; /* Menu order priority */
|
|
Karsten Hopp |
dab478 |
--- 2207,2220 ----
|
|
Karsten Hopp |
dab478 |
{
|
|
Karsten Hopp |
dab478 |
int modes; /* Which modes is this menu visible for? */
|
|
Karsten Hopp |
dab478 |
int enabled; /* for which modes the menu is enabled */
|
|
Karsten Hopp |
dab478 |
! char_u *name; /* Name of menu, possibly translated */
|
|
Karsten Hopp |
dab478 |
! char_u *dname; /* Displayed Name ("name" without '&') */
|
|
Karsten Hopp |
dab478 |
! #ifdef FEAT_MULTI_LANG
|
|
Karsten Hopp |
dab478 |
! char_u *en_name; /* "name" untranslated, NULL when "name"
|
|
Karsten Hopp |
dab478 |
! * was not translated */
|
|
Karsten Hopp |
dab478 |
! char_u *en_dname; /* "dname" untranslated, NULL when "dname"
|
|
Karsten Hopp |
dab478 |
! * was not translated */
|
|
Karsten Hopp |
dab478 |
! #endif
|
|
Karsten Hopp |
dab478 |
int mnemonic; /* mnemonic key (after '&') */
|
|
Karsten Hopp |
dab478 |
char_u *actext; /* accelerator text (after TAB) */
|
|
Karsten Hopp |
dab478 |
int priority; /* Menu order priority */
|
|
Karsten Hopp |
dab478 |
*** ../vim-7.2.431/src/version.c 2010-05-14 21:19:16.000000000 +0200
|
|
Karsten Hopp |
dab478 |
--- src/version.c 2010-05-14 22:19:39.000000000 +0200
|
|
Karsten Hopp |
dab478 |
***************
|
|
Karsten Hopp |
dab478 |
*** 683,684 ****
|
|
Karsten Hopp |
dab478 |
--- 683,686 ----
|
|
Karsten Hopp |
dab478 |
{ /* Add new patch number below this line */
|
|
Karsten Hopp |
dab478 |
+ /**/
|
|
Karsten Hopp |
dab478 |
+ 432,
|
|
Karsten Hopp |
dab478 |
/**/
|
|
Karsten Hopp |
dab478 |
|
|
Karsten Hopp |
dab478 |
--
|
|
Karsten Hopp |
dab478 |
It is hard to understand how a cemetery raised its burial
|
|
Karsten Hopp |
dab478 |
cost and blamed it on the cost of living.
|
|
Karsten Hopp |
dab478 |
|
|
Karsten Hopp |
dab478 |
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
|
Karsten Hopp |
dab478 |
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
|
Karsten Hopp |
dab478 |
\\\ download, build and distribute -- http://www.A-A-P.org ///
|
|
Karsten Hopp |
dab478 |
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|