diff --git a/scheme/browse-directory-list.scm b/scheme/browse-directory-list.scm index 9bd9685..c050910 100644 --- a/scheme/browse-directory-list.scm +++ b/scheme/browse-directory-list.scm @@ -253,14 +253,17 @@ (- (result-buffer-num-lines buffer) 1) (result-buffer-num-cols buffer)))) + (define sort-up-key (config 'ls 'sort-up-key)) + (define sort-down-key (config 'ls 'sort-down-key)) + (define (handle-key-press self key) (cond ((= key key-return) (handle-return-key self (select-list-selected-entry select-list) (calculate-number-of-lines buffer))) - ((or (= key (config 'ls 'sort-up-key)) - (= key (config 'ls 'sort-down-key))) + ((or (= key sort-up-key) + (= key sort-down-key)) (let ((column (select-line-selected-entry select-line))) (receive (compare-up compare-down select) (case column @@ -289,7 +292,7 @@ (file-info:mtime (fs-object-info fso))))) (else (error "unknown column" column))) - (let ((compare (if (= key (config 'ls 'sort-up-key)) + (let ((compare (if (= key sort-up-key) compare-up compare-down))) (set-fs-objects!