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()
|
do_justify()
|
||||||
- For consistency, preserve placewewant if we didn't unjustify
|
- For consistency, preserve placewewant if we didn't unjustify
|
||||||
instead of setting it to 0. (DLR)
|
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
|
GNU nano 1.3.5 - 2004.11.22
|
||||||
- General:
|
- 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
|
/* Now get a keystroke and see if it's unjustify; if not, unget the
|
||||||
* keystroke and return. */
|
* 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) {
|
if (!meta_key && !func_key && kbinput == NANO_UNJUSTIFY_KEY) {
|
||||||
/* Restore the justify we just did (ungrateful user!). */
|
/* Restore the justify we just did (ungrateful user!). */
|
||||||
|
@ -3092,6 +3092,8 @@ void do_justify(bool full_justify)
|
||||||
edit_refresh();
|
edit_refresh();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
unget_kbinput(kbinput, meta_key, func_key);
|
||||||
|
|
||||||
/* Blow away the text in the justify buffer.*/
|
/* Blow away the text in the justify buffer.*/
|
||||||
free_filestruct(jusbuffer);
|
free_filestruct(jusbuffer);
|
||||||
jusbuffer = NULL;
|
jusbuffer = NULL;
|
||||||
|
@ -3955,7 +3957,7 @@ int main(int argc, char **argv)
|
||||||
currshortcut = main_list;
|
currshortcut = main_list;
|
||||||
#endif
|
#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. */
|
/* Last gasp, stuff that's not in the main lists. */
|
||||||
if (kbinput != ERR && !is_cntrl_char(kbinput)) {
|
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
|
#ifndef NANO_SMALL
|
||||||
const toggle *get_toggle(int kbinput, bool meta_key);
|
const toggle *get_toggle(int kbinput, bool meta_key);
|
||||||
#endif
|
#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
|
#ifndef DISABLE_MOUSE
|
||||||
bool get_edit_mouse(void);
|
bool get_edit_mouse(void);
|
||||||
#endif
|
#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 */
|
#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;
|
bool keyhandled = FALSE;
|
||||||
int kbinput, retval;
|
int kbinput, retval;
|
||||||
|
@ -1536,10 +1536,12 @@ int get_edit_input(bool *meta_key, bool *func_key)
|
||||||
if (s->func != do_cut_text)
|
if (s->func != do_cut_text)
|
||||||
cutbuffer_reset();
|
cutbuffer_reset();
|
||||||
if (s->func != NULL) {
|
if (s->func != NULL) {
|
||||||
if (ISSET(VIEW_MODE) && !s->viewok)
|
if (allow_funcs) {
|
||||||
print_view_warning();
|
if (ISSET(VIEW_MODE) && !s->viewok)
|
||||||
else
|
print_view_warning();
|
||||||
s->func();
|
else
|
||||||
|
s->func();
|
||||||
|
}
|
||||||
keyhandled = TRUE;
|
keyhandled = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1553,7 +1555,8 @@ int get_edit_input(bool *meta_key, bool *func_key)
|
||||||
* corresponding flag. */
|
* corresponding flag. */
|
||||||
if (t != NULL) {
|
if (t != NULL) {
|
||||||
cutbuffer_reset();
|
cutbuffer_reset();
|
||||||
do_toggle(t);
|
if (allow_funcs)
|
||||||
|
do_toggle(t);
|
||||||
keyhandled = TRUE;
|
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,
|
/* 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
|
* reset meta_key and retval. If we didn't, keep the value of
|
||||||
* meta_key and return the key we got in retval. */
|
* meta_key and return the key we got in retval. */
|
||||||
if (keyhandled) {
|
if (allow_funcs && keyhandled) {
|
||||||
*meta_key = FALSE;
|
*meta_key = FALSE;
|
||||||
retval = ERR;
|
retval = ERR;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue