summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-04-26 09:55:23 +0200
committerYorhel <git@yorhel.nl>2009-04-26 09:55:23 +0200
commitf6e34e520eda903760d38366b8941a879e8de830 (patch)
tree4c85b54aba0806fc59bfe09c6295ac9406e7bf73
parentba243df042d236f0035923a4c3f6372156c4d02b (diff)
Don't re-sort when pressing the browse keys without affecting the dir
-rw-r--r--src/browser.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/browser.c b/src/browser.c
index 2e7be85..abe84f8 100644
--- a/src/browser.c
+++ b/src/browser.c
@@ -362,7 +362,7 @@ int browse_key(int ch) {
browse_key_sel(winrows-3);
break;
- /* sorting items */
+ /* sorting items */
case 'n':
if(flags & BF_NAME)
toggle(flags, BF_DESC);
@@ -394,32 +394,35 @@ int browse_key(int ch) {
nonfo++;
break;
- /* browsing */
+ /* browsing */
case 10:
case KEY_RIGHT:
for(n=browse_dir; n!=NULL; n=n->next)
if(n->flags & FF_BSEL)
break;
- if(n != NULL && n->sub != NULL)
+ if(n != NULL && n->sub != NULL) {
browse_dir = n->sub;
- if(n == NULL && browse_dir != NULL && browse_dir->parent->parent)
+ sort++;
+ }
+ if(n == NULL && browse_dir != NULL && browse_dir->parent->parent) {
browse_dir = browse_dir->parent->parent->sub;
+ sort++;
+ }
nonfo++;
- sort++;
break;
case KEY_LEFT:
- if(browse_dir != NULL && browse_dir->parent->parent != NULL)
+ if(browse_dir != NULL && browse_dir->parent->parent != NULL) {
browse_dir = browse_dir->parent->parent->sub;
+ sort++;
+ }
nonfo++;
- sort++;
break;
- /* refresh */
+ /* refresh */
case 'r':
if(browse_dir != NULL)
calc_init(getpath(browse_dir->parent), browse_dir->parent);
nonfo++;
- sort++;
break;
/* and other stuff */