You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue exists on nnn master: pretty sure, i might be a few commits behind the latest commit
Exact steps to reproduce the issue
When I change contexts, the sort order of the current context is preserved in the second context. This preservation occurs when I set the sort order by hand (video 1), but also when the sort order is part of the NNN_ORDER envvar (video 2). Even if case 1 is intentional, I do not believe case 2 is, as leaving the NNN_ORDER-ed directory in the same context unsets the sort and does not preserve it.
There is another strange behavior: If i unset the sorting state in the 2nd context, go back to the first context, and then attempt to re-set the sort, nothing happens. It is as if my first attempt to re-set the sort actually performed the unset operation in the first context, and the second attempt actually did re-set the sort (though I'm not too sure what's really going on in the code).
Sort manually by size (s) and switch to an ordered context. In this case the sort order is not changed in the second context.
However, if I manually set the reverse order (r) or version sort (v), the reverse order is added in the second context too.
The second observations seems to be a manifestation of the same. If you check set_sort_flags(), r and v use special function pointers. It seems they are retained and adds up along with the order dictated by NNN_ORDER even for a context that is already open.
Environment details
nnn
master: pretty sure, i might be a few commits behind the latest commitExact steps to reproduce the issue
When I change contexts, the sort order of the current context is preserved in the second context. This preservation occurs when I set the sort order by hand (video 1), but also when the sort order is part of the
NNN_ORDER
envvar (video 2). Even if case 1 is intentional, I do not believe case 2 is, as leaving theNNN_ORDER
-ed directory in the same context unsets the sort and does not preserve it.There is another strange behavior: If i unset the sorting state in the 2nd context, go back to the first context, and then attempt to re-set the sort, nothing happens. It is as if my first attempt to re-set the sort actually performed the unset operation in the first context, and the second attempt actually did re-set the sort (though I'm not too sure what's really going on in the code).
Video 1: https://github.com/jarun/nnn/assets/51880422/e56ac3ac-94cd-41ef-89cf-31c56798c202
Video 2: https://github.com/jarun/nnn/assets/51880422/50536d6c-3f52-4618-8c0b-bd3c3b66a4eb
What is the desired behavior? I'm happy to open a pull request, but I don't want to implement the wrong behavior ^_^
The text was updated successfully, but these errors were encountered: