mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
reenable phrase selections
nice rollover expressions
This commit is contained in:
parent
d5a37229b9
commit
964a4fec8f
1 changed files with 6 additions and 2 deletions
|
|
@ -248,8 +248,12 @@ impl<T: PhrasesControl> InputToCommand<Tui, T> for PhrasesCommand {
|
|||
let index = state.phrase_index();
|
||||
let count = state.phrases().len();
|
||||
Some(match input.event() {
|
||||
key!(Up) => Self::Select(0),
|
||||
key!(Down) => Self::Select(0),
|
||||
key!(Up) => Self::Select(
|
||||
state.phrase_index().overflowing_sub(1).0.min(state.phrases().len() - 1)
|
||||
),
|
||||
key!(Down) => Self::Select(
|
||||
state.phrase_index().saturating_add(1) % state.phrases().len()
|
||||
),
|
||||
key!(Char(',')) => if index > 1 {
|
||||
state.set_phrase_index(state.phrase_index().saturating_sub(1));
|
||||
Self::Phrase(Pool::Swap(index - 1, index))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue