tarkah / tickrs

Realtime ticker data in your terminal 📈

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow reordering ticker tab entries

miraclx opened this issue · comments

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.

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.

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

Does ctrl not work with other combinations?

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?

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

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+-> ?

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

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

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