tarkah / tickrs

Realtime ticker data in your terminal 📈
MIT License
1.16k stars 58 forks source link

Allow reordering ticker tab entries #64

Closed miraclx closed 3 years ago

miraclx commented 3 years ago

Just a thought, but perhaps it would be nice to have the ability to reorder tabs after adding them.

This would reflect in the tabs view and also in the summary view.

Currently, you can move forward between tabs with the tab key, and in the inverse direction with the shift+tab.

However, (and maybe it's just me), I can also use the ctrl key with that to the same effect.

So a ctrl+tab has the same effect as a tab, and so does a ctrl+shift+tab have the same effect as a shift+tab.

Maybe the ctrl specifier can be used to signify reordering.

So a ctrl+tab would move a tab forward by an index, and a ctrl+shift+tab would move the selected tab and index backwards.

This is just a suggestion and the key specifiers can be anything, I just thought these appropriate since they're apparently redundant in effect and can be repurposed but can be a topic for discussion.

tarkah commented 3 years ago

I really like this idea! I've found myself removing tabs and readding them in the order I want, so this would be a nice improvement.

miraclx commented 3 years ago

For some extra info, here's what I get with the SHOW_DEBUG=1 env.

tab

DebugInfo { ..., last_event: Some(Key(KeyEvent { code: Tab, modifiers: NONE })), mode: DisplayStock }

ctrl+tab

DebugInfo { ..., last_event: Some(Key(KeyEvent { code: Tab, modifiers: NONE })), mode: DisplayStock }

shift+tab

DebugInfo { ..., last_event: Some(Key(KeyEvent { code: BackTab, modifiers: NONE })), mode: DisplayStock }

ctrl+shift+tab

DebugInfo { ..., last_event: Some(Key(KeyEvent { code: BackTab, modifiers: NONE })), mode: DisplayStock }

It doesn't seem to register the ctrl key

tarkah commented 3 years ago

Does ctrl not work with other combinations?

miraclx commented 3 years ago

ctrl+v

DebugInfo { ..., last_event: Some(Key(KeyEvent { code: Char('v'), modifiers: CONTROL })), mode: DisplayStock }

So, it does

EDIT: does ctrl+tab register something different for you?

tarkah commented 3 years ago

I'm not at my computer right now, I'll test it tomorrow

tarkah commented 3 years ago

Yeah ctrl+tab doesn't work for me either, but I noticed the shortcut also gets captured by some terminals (like Windows Terminal), so I don't think it'd be a good fit anyways.

We could do ctrl+<- and ctrl+-> ?

tarkah commented 3 years ago

@miraclx I published this in the latest release, using ctrl+left / right made most sense. Works great!

miraclx commented 3 years ago

Love it! And your dedication to this is impeccable, keep it up!

tarkah commented 3 years ago

Awesome 🎉 It wouldn't be great or fun without involvement or suggestions from others, so thank you!