mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-10 21:56:42 +01:00
wip(p66,e16)
This commit is contained in:
parent
e768790658
commit
faf7576ad8
2 changed files with 6 additions and 5 deletions
|
|
@ -153,7 +153,7 @@ impl<T: PhrasesControl> Command<T> for PhraseLengthCommand {
|
|||
fn execute (self, state: &mut T) -> Perhaps<Self> {
|
||||
use PhraseLengthFocus::*;
|
||||
use PhraseLengthCommand::*;
|
||||
let mode = state.phrases_mode_mut();
|
||||
let mut mode = state.phrases_mode_mut().clone();
|
||||
if let Some(PhrasesMode::Length(
|
||||
phrase,
|
||||
ref mut length,
|
||||
|
|
@ -180,10 +180,11 @@ impl<T: PhrasesControl> Command<T> for PhraseLengthCommand {
|
|||
Tick => { *length = length.saturating_sub(1) },
|
||||
},
|
||||
Self::Set(length) => {
|
||||
let mut phrase = state.phrases()[*phrase].write().unwrap();
|
||||
let mut phrase = state.phrases()[phrase].write().unwrap();
|
||||
let old_length = phrase.length;
|
||||
phrase.length = length;
|
||||
*mode = None;
|
||||
std::mem::drop(phrase);
|
||||
*state.phrases_mode_mut() = None;
|
||||
return Ok(Some(Self::Set(old_length)))
|
||||
},
|
||||
_ => unreachable!()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue