mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-21 20:31:20 +03:00
Rebuilding the file list only when necessary, and not for each and every
cursor movement. This fixes Savannah bug #47133. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5638 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
parent
0db28259ad
commit
813f9f72d0
@ -1,3 +1,8 @@
|
||||
2016-02-13 Benno Schulenberg <bensberg@justemail.net>
|
||||
* src/browser.c (do_browser, browser_refresh): Rebuild the file list
|
||||
only when necessary, not for each and every cursor movement. This
|
||||
fixes Savannah bug #47133.
|
||||
|
||||
GNU nano 2.5.2 - 2016.02.12
|
||||
|
||||
2016-02-11 Benno Schulenberg <bensberg@justemail.net>
|
||||
|
@ -115,9 +115,20 @@ char *do_browser(char *path, DIR *dir)
|
||||
/* The path we switch to at the "Go to Directory"
|
||||
* prompt. */
|
||||
|
||||
/* Display the file list if we don't have a key, or if the
|
||||
* selected file has changed, and set width in the process. */
|
||||
if (kbinput == ERR || old_selected != selected)
|
||||
#ifndef NANO_TINY
|
||||
if (kbinput == KEY_WINCH) {
|
||||
/* Rebuild the file list and sort it. */
|
||||
browser_init(path_save, opendir(path_save));
|
||||
qsort(filelist, filelist_len, sizeof(char *), diralphasort);
|
||||
|
||||
/* Make sure the selected file is within range. */
|
||||
if (selected >= filelist_len)
|
||||
selected = filelist_len - 1;
|
||||
}
|
||||
#endif
|
||||
/* Display (or redisplay) the file list if we don't have a key yet,
|
||||
* or the list has changed, or the selected file has changed. */
|
||||
if (kbinput == ERR || kbinput == KEY_WINCH || old_selected != selected)
|
||||
browser_refresh();
|
||||
|
||||
old_selected = selected;
|
||||
@ -125,11 +136,8 @@ char *do_browser(char *path, DIR *dir)
|
||||
kbinput = get_kbinput(edit);
|
||||
|
||||
#ifndef NANO_TINY
|
||||
if (kbinput == KEY_WINCH) {
|
||||
kbinput = ERR;
|
||||
curs_set(0);
|
||||
if (kbinput == KEY_WINCH)
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_MOUSE
|
||||
@ -170,8 +178,8 @@ char *do_browser(char *path, DIR *dir)
|
||||
} else if (func == do_help_void) {
|
||||
#ifndef DISABLE_HELP
|
||||
do_help_void();
|
||||
/* Perhaps the window dimensions have changed. */
|
||||
browser_refresh();
|
||||
/* The window dimensions might have changed, so act as if. */
|
||||
kbinput = KEY_WINCH;
|
||||
curs_set(0);
|
||||
#else
|
||||
say_there_is_no_help();
|
||||
@ -548,14 +556,6 @@ void browser_refresh(void)
|
||||
char *foo;
|
||||
/* The additional information that we'll display about a file. */
|
||||
|
||||
/* Perhaps window dimensions have changed; reinitialize the browser. */
|
||||
browser_init(path_save, opendir(path_save));
|
||||
qsort(filelist, filelist_len, sizeof(char *), diralphasort);
|
||||
|
||||
/* Make sure the selected file is within range. */
|
||||
if (selected >= filelist_len)
|
||||
selected = filelist_len - 1;
|
||||
|
||||
titlebar(path_save);
|
||||
blank_edit();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user