From b0c1bc28f81147e12e7bae317cce772b62ce42a9 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Thu, 29 Jun 2006 15:46:05 +0000 Subject: [PATCH] in browser_refresh(), simplify more things git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3692 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 2 +- src/browser.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1c8a74fd..02c9ec45 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,7 +14,7 @@ CVS code - do_mouse() for consistency. (DLR) - Remove unneeded call to blank_edit(). (DLR) browser_refresh() - - Simplify the for loop. (DLR) + - Simplify. (DLR) - doc/syntax/c.nanorc: - Since .i and .ii are preprocessed C and C++ output, colorize them here. (Mike Frysinger) diff --git a/src/browser.c b/src/browser.c index 73eaafc8..99ff00d1 100644 --- a/src/browser.c +++ b/src/browser.c @@ -522,18 +522,18 @@ void parse_browser_input(int *kbinput, bool *meta_key, bool *func_key) void browser_refresh(void) { struct stat st; - size_t i = 0; + size_t i; int col = 0, line = 0, filecols = 0; size_t foo_len = mb_cur_max() * 7; char *foo = charalloc(foo_len + 1); - if (width != 0) - i = width * editwinrows * ((selected / width) / editwinrows); - blank_edit(); wmove(edit, 0, 0); + i = (width != 0) ? width * editwinrows * ((selected / width) / + editwinrows) : 0; + for (; i < filelist_len && line < editwinrows; i++) { char *disp = display_string(tail(filelist[i]), 0, longest, FALSE); -- 2.39.5