Fix for 106305: unable to ctrl+c out of save when exiting
Add new YESNO menu for calls to do_yesno_prompt, to enable cancel. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4237 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Этот коммит содержится в:
родитель
1fb25fd2aa
Коммит
cc593839aa
@ -648,7 +648,7 @@ void shortcut_init(bool unjustify)
|
||||
#endif
|
||||
|
||||
add_to_funcs((void *) cancel_msg,
|
||||
(MWHEREIS|MREPLACE|MREPLACE2|MGOTOLINE|MWRITEFILE|MINSERTFILE|MEXTCMD|MSPELL|MWHEREISFILE|MGOTODIR),
|
||||
(MWHEREIS|MREPLACE|MREPLACE2|MGOTOLINE|MWRITEFILE|MINSERTFILE|MEXTCMD|MSPELL|MWHEREISFILE|MGOTODIR|MYESNO),
|
||||
cancel_msg, IFSCHELP(nano_cancel_msg), FALSE, VIEW);
|
||||
|
||||
add_to_funcs(do_exit, MMAIN,
|
||||
@ -1140,7 +1140,7 @@ void shortcut_init(bool unjustify)
|
||||
#endif
|
||||
add_to_sclist(MGOTOLINE, "^T", (void *) gototext_msg, 0, FALSE);
|
||||
add_to_sclist(MINSERTFILE|MEXTCMD, "M-F", (void *) new_buffer_msg, 0, FALSE);
|
||||
add_to_sclist((MWHEREIS|MREPLACE|MREPLACE2|MGOTOLINE|MWRITEFILE|MINSERTFILE|MEXTCMD|MSPELL|MWHEREISFILE|MGOTODIR),
|
||||
add_to_sclist((MWHEREIS|MREPLACE|MREPLACE2|MGOTOLINE|MWRITEFILE|MINSERTFILE|MEXTCMD|MSPELL|MWHEREISFILE|MGOTODIR|MYESNO),
|
||||
"^C", (void *) cancel_msg, 0, FALSE);
|
||||
add_to_sclist(MHELP, "^X", do_exit, 0, TRUE);
|
||||
add_to_sclist(MHELP, "F2", do_exit, 0, TRUE);
|
||||
|
@ -438,6 +438,7 @@ typedef struct subnfunc {
|
||||
#define MBROWSER (1<<10)
|
||||
#define MWHEREISFILE (1<<11)
|
||||
#define MGOTODIR (1<<12)
|
||||
#define MYESNO (1<<13)
|
||||
/* This really isnt all but close enough */
|
||||
#define MALL (MMAIN|MWHEREIS|MREPLACE|MREPLACE2|MGOTOLINE|MWRITEFILE|MINSERTFILE|MEXTCMD|MSPELL|MBROWSER|MWHEREISFILE|MGOTODIR|MHELP)
|
||||
|
||||
|
@ -1247,6 +1247,7 @@ int do_yesno_prompt(bool all, const char *msg)
|
||||
const char *nostr; /* Same for No. */
|
||||
const char *allstr; /* And All, surprise! */
|
||||
const sc *s;
|
||||
int oldmenu = currmenu;
|
||||
|
||||
assert(msg != NULL);
|
||||
|
||||
@ -1308,6 +1309,7 @@ int do_yesno_prompt(bool all, const char *msg)
|
||||
int mouse_x, mouse_y;
|
||||
#endif
|
||||
|
||||
currmenu = MYESNO;
|
||||
kbinput = get_kbinput(bottomwin, &meta_key, &func_key);
|
||||
s = get_shortcut(currmenu, &kbinput, &meta_key, &func_key);
|
||||
|
||||
@ -1358,5 +1360,6 @@ int do_yesno_prompt(bool all, const char *msg)
|
||||
}
|
||||
} while (ok == -2);
|
||||
|
||||
currmenu = oldmenu;
|
||||
return ok;
|
||||
}
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user