tex icon indicating copy to clipboard operation
tex copied to clipboard

Implement Sort mode

Open alpacaaa opened this issue 7 years ago • 2 comments

Right now, only a single mode is supported, which I would tentatively call Navigation. It would be cool to have more modes, this issue is specifically for Sort mode. We could use the same keybindings as lf:

map sn :set sortby natural; set info
map ss :set sortby size; set info size
map st :set sortby time; set info time

The idea being that when in Navigation mode, pressing s transitions the program to Sort mode and awaits one of n,s,t or ESC to go back to Navigation. We could go one step further and show the appropriate column too, but that would require some thinking as the layout system is pretty basic at the moment and there's no notion of tables/columns.

alpacaaa avatar Nov 12 '18 20:11 alpacaaa

Sounds like we need a state machine

On Mon, 12 Nov 2018, 21:47 Marco Sampellegrini <[email protected] wrote:

Right now, only a single mode is supported, which I would tentatively call Navigation. It would be cool to have more modes, this issue is specifically for Sort mode. We could use the same keybindings as lf:

map sn :set sortby natural; set info map ss :set sortby size; set info size map st :set sortby time; set info time

The idea being that when in Navigation mode, pressing s transitions the program to Sort mode and awaits one of n,s,t or ESC to go back to Navigation. We could go one step further and show the appropriate column too, but that would require some thinking as the layout system is pretty basic at the moment and there's no notion of tables/columns.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/alpacaaa/lame-fs/issues/3, or mute the thread https://github.com/notifications/unsubscribe-auth/AEuoDBsk3MJXKV_oXdVBTiE0JzyzF8pQks5uudd5gaJpZM4YaXTJ .

sphaso avatar Nov 12 '18 23:11 sphaso

Core.update is a state machine already, I think. We simply need to add more state to it, in this specific case a currentMode with its state would do.

alpacaaa avatar Nov 13 '18 13:11 alpacaaa