commit 1fbcf0b23deed5081ca5e04166adbf459a673e6f
parent 1ea76eb51bcc36cf5d044a1d1b49104ca7600f2a
Author: Benno Schulenberg <bensberg@justemail.net>
Date: Wed, 2 Dec 2015 19:03:34 +0000
Accepting not just 'Uncut' but also 'Undo' for undoing a justification.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5468 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Diffstat:
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -2,6 +2,8 @@
* doc/syntax/python.nanorc: Don't colour triple quotes by themselves.
* doc/syntax/python.nanorc: Treat backslashed quotes properly, and
don't colour triple-quoted strings in two manners.
+ * src/text.c (do_justify): Accept not just the Uncut keystroke but
+ also the Undo keystroke for undoing a justification.
2015-12-02 Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
* doc/syntax/nftables.nanorc: New file; syntax colouring for nftables.
diff --git a/src/text.c b/src/text.c
@@ -2256,7 +2256,7 @@ void do_justify(bool full_justify)
func = func_from_key(&kbinput);
- if (func == do_uncut_text) {
+ if (func == do_uncut_text || func == do_undo) {
/* Splice the justify buffer back into the file, but only if we
* actually justified something. */
if (first_par_line != NULL) {
@@ -2307,7 +2307,8 @@ void do_justify(bool full_justify)
edit_refresh_needed = TRUE;
}
} else {
- unget_kbinput(kbinput, meta_key, func_key);
+ if (func != do_undo)
+ unget_kbinput(kbinput, meta_key, func_key);
/* Blow away the text in the justify buffer. */
free_filestruct(jusbuffer);