in get_edit_input(), readd parameter allow_funcs, as it's now needed as
a workaround for when unjustified text is stored in the justify buffer and either the justify or the full justify shortcut is hit git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2128 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
304129315c
commit
d994ad5284
|
@ -36,12 +36,6 @@ CVS code -
|
|||
do_justify()
|
||||
- For consistency, preserve placewewant if we didn't unjustify
|
||||
instead of setting it to 0. (DLR)
|
||||
- winio.c:
|
||||
get_edit_input()
|
||||
- Remove parameter allow_funcs, as it was only needed as a
|
||||
workaround for when justified text was stored in the cutbuffer
|
||||
and the cut shortcut was hit at the "Can now UnJustify!"
|
||||
prompt. (DLR)
|
||||
|
||||
GNU nano 1.3.5 - 2004.11.22
|
||||
- General:
|
||||
|
|
|
@ -3038,7 +3038,7 @@ void do_justify(bool full_justify)
|
|||
|
||||
/* Now get a keystroke and see if it's unjustify; if not, unget the
|
||||
* keystroke and return. */
|
||||
kbinput = get_edit_input(&meta_key, &func_key);
|
||||
kbinput = get_edit_input(&meta_key, &func_key, FALSE);
|
||||
|
||||
if (!meta_key && !func_key && kbinput == NANO_UNJUSTIFY_KEY) {
|
||||
/* Restore the justify we just did (ungrateful user!). */
|
||||
|
@ -3092,6 +3092,8 @@ void do_justify(bool full_justify)
|
|||
edit_refresh();
|
||||
}
|
||||
} else {
|
||||
unget_kbinput(kbinput, meta_key, func_key);
|
||||
|
||||
/* Blow away the text in the justify buffer.*/
|
||||
free_filestruct(jusbuffer);
|
||||
jusbuffer = NULL;
|
||||
|
@ -3955,7 +3957,7 @@ int main(int argc, char **argv)
|
|||
currshortcut = main_list;
|
||||
#endif
|
||||
|
||||
kbinput = get_edit_input(&meta_key, &func_key);
|
||||
kbinput = get_edit_input(&meta_key, &func_key, TRUE);
|
||||
|
||||
/* Last gasp, stuff that's not in the main lists. */
|
||||
if (kbinput != ERR && !is_cntrl_char(kbinput)) {
|
||||
|
|
|
@ -555,7 +555,7 @@ const shortcut *get_shortcut(const shortcut *s_list, int kbinput, bool
|
|||
#ifndef NANO_SMALL
|
||||
const toggle *get_toggle(int kbinput, bool meta_key);
|
||||
#endif
|
||||
int get_edit_input(bool *meta_key, bool *func_key);
|
||||
int get_edit_input(bool *meta_key, bool *func_key, bool allow_funcs);
|
||||
#ifndef DISABLE_MOUSE
|
||||
bool get_edit_mouse(void);
|
||||
#endif
|
||||
|
|
17
src/winio.c
17
src/winio.c
|
@ -1491,7 +1491,7 @@ const toggle *get_toggle(int kbinput, bool meta_key)
|
|||
}
|
||||
#endif /* !NANO_SMALL */
|
||||
|
||||
int get_edit_input(bool *meta_key, bool *func_key)
|
||||
int get_edit_input(bool *meta_key, bool *func_key, bool allow_funcs)
|
||||
{
|
||||
bool keyhandled = FALSE;
|
||||
int kbinput, retval;
|
||||
|
@ -1536,10 +1536,12 @@ int get_edit_input(bool *meta_key, bool *func_key)
|
|||
if (s->func != do_cut_text)
|
||||
cutbuffer_reset();
|
||||
if (s->func != NULL) {
|
||||
if (ISSET(VIEW_MODE) && !s->viewok)
|
||||
print_view_warning();
|
||||
else
|
||||
s->func();
|
||||
if (allow_funcs) {
|
||||
if (ISSET(VIEW_MODE) && !s->viewok)
|
||||
print_view_warning();
|
||||
else
|
||||
s->func();
|
||||
}
|
||||
keyhandled = TRUE;
|
||||
}
|
||||
}
|
||||
|
@ -1553,7 +1555,8 @@ int get_edit_input(bool *meta_key, bool *func_key)
|
|||
* corresponding flag. */
|
||||
if (t != NULL) {
|
||||
cutbuffer_reset();
|
||||
do_toggle(t);
|
||||
if (allow_funcs)
|
||||
do_toggle(t);
|
||||
keyhandled = TRUE;
|
||||
}
|
||||
}
|
||||
|
@ -1562,7 +1565,7 @@ int get_edit_input(bool *meta_key, bool *func_key)
|
|||
/* If we got a shortcut with a corresponding function or a toggle,
|
||||
* reset meta_key and retval. If we didn't, keep the value of
|
||||
* meta_key and return the key we got in retval. */
|
||||
if (keyhandled) {
|
||||
if (allow_funcs && keyhandled) {
|
||||
*meta_key = FALSE;
|
||||
retval = ERR;
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue