nano

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

commit 77bce9f1c4d15211f7a5848aaad2dc2721930816
parent a2b85e0c12499940421247242a52b036bd14fbf8
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Thu, 11 Jun 2020 16:27:23 +0200

tweaks: remove a redundant cursor movement, remove a redundant condition

Each listing of a name is preceeded by a call to wmove(), so there
is no need for an initial wmove().  And after writing "more" on the
bottom row of the edit window, the loop is terminated, so there is
no need to check that this is the first item on the bottom row.

Diffstat:
Msrc/files.c | 4+---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/files.c b/src/files.c @@ -2605,7 +2605,6 @@ char *input_tab(char *buf, bool allow_files, size_t *place, /* Blank the edit window and hide the cursor. */ blank_edit(); curs_set(0); - wmove(edit, 0, 0); /* Now print the list of matches out there. */ for (match = 0; match < num_matches; match++) { @@ -2613,8 +2612,7 @@ char *input_tab(char *buf, bool allow_files, size_t *place, wmove(edit, editline, (longest_name + 2) * (match % ncols)); - if (match % ncols == 0 && editline == editwinrows - 1 && - num_matches - match > ncols) { + if (editline == editwinrows - 1 && num_matches - match > ncols) { waddstr(edit, _("(more)")); break; }