Replies: 1 comment
-
I think this behavior is intuitive and desirable in an interactive context. However, it's tricky to change behavior based on existing column state, as this can make cmdlog replay a lot less predictable. We already have this with e.g. This would also be better, as we wouldn't be changing the semantics of the existing longnames, but only the bindings to these new commands with new longnames. |
Beta Was this translation helpful? Give feedback.
-
When I'm sorting by more than one column, I often want to reverse one of the sort directions. For example, if I am sorting movies by the multiple criteria of 1) genre 2) rating, and 3) title, I may want to see the ratings ascending or descending, but keep the other columns unchanged. Right now the only way to change the direction is to rebuild the sort all over, which is inconvenient.
I've prototyped a version that makes it easy. If you sort a column by
z[
, it'll be added as usual. If you then hitz]
it'll reverse the sort direction, but keep the other columns and keep the column's priority unchanged.What do you think, should this be the default behavior of
z[
?Another change this makes: if you use
z[
on a column that's already sorted ascending (orz]
on one that's descending), the column is removed from the sort criteria. So to demonstrate with the movie example, let's say I am sorting by↑genre
(ascending),↡rating
(descending),⇞title
(ascending). If I hitz[
on the genre column, it'll only sort by↓rating
and↟title
. If I then hitz]
on the rating column, it'll only sort by↑title
. Is this removal behavior intuitive or not?Here is code to add to your .visidatarc to try it out. I welcome feedback.
Beta Was this translation helpful? Give feedback.
All reactions