nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 5c07a747bbf03f59e67252ec406f6acfb586b0fa
parent a9f7277b1b80c8eddc497641da68f48004bbed0c
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Mon, 17 Feb 2020 11:29:13 +0100

tweaks: adjust some whitespace, reshuffle two ifs, and remove two braces

Diffstat:
Msrc/cut.c | 4++--
Msrc/nano.c | 1-
Msrc/text.c | 7+++----
3 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/cut.c b/src/cut.c @@ -120,7 +120,7 @@ void do_delete(void) zap_text(); else #endif - do_deletion(DEL); + do_deletion(DEL); } /* Backspace over one character. That is, move the cursor left one @@ -132,7 +132,7 @@ void do_backspace(void) zap_text(); else #endif - if (openfile->current != openfile->filetop || openfile->current_x > 0) { + if (openfile->current_x > 0 || openfile->current != openfile->filetop) { do_left(); do_deletion(BACK); } diff --git a/src/nano.c b/src/nano.c @@ -1734,7 +1734,6 @@ void inject(char *burst, size_t count) if (!refresh_needed) check_the_multis(openfile->current); #endif - if (!refresh_needed) update_line(openfile->current, openfile->current_x); } diff --git a/src/text.c b/src/text.c @@ -1062,10 +1062,9 @@ bool execute_command(const char *command) else read_file(stream, 0, "pipe", TRUE); - if (should_pipe && !ISSET(MULTIBUFFER)) { + if (should_pipe && !ISSET(MULTIBUFFER)) /* TRANSLATORS: The next two go with Undid/Redid messages. */ add_undo(COUPLE_END, N_("filtering")); - } /* Wait for the external command (and possibly data sender) to terminate. */ wait(NULL); @@ -1223,10 +1222,10 @@ void add_undo(undo_type action, const char *message) } break; case PASTE: - if (openfile->current == openfile->filebot) - u->xflags |= WAS_FINAL_LINE; u->cutbuffer = copy_buffer(cutbuffer); u->lineno += cutbottom->lineno - cutbuffer->lineno; + if (openfile->current == openfile->filebot) + u->xflags |= WAS_FINAL_LINE; break; case INSERT: if (openfile->current == openfile->filebot)