browser: keep the same file selected when the directory contents change
When refreshing the screen (and thus the file list), use the prev_dir mechanism to reselect the file that was selected before the refresh, to prevent the selection from changing when files were added or deleted. Also, when the selected name has disappeared, move the highlight one step back, so that it is obvious that the selection has changed. (Decrementing 'selected' will never make it negative, because selected == 0 means the '..' entry, and every directory has a '..' entry, so it will be found.) This fixes https://savannah.gnu.org/bugs/?47812 . Signed-off-by: Rishabh Dave <rishabhddave@gmail.com Signed-off-by:Benno Schulenberg <bensberg@justemail.net>
Showing
+18 -3
Please register or sign in to comment