mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 05:06:43 +01:00
add Phrase::duplicate and PhrasePool::index_of()
This commit is contained in:
parent
e002d2e51a
commit
d2cda0c54d
2 changed files with 14 additions and 1 deletions
|
|
@ -67,7 +67,7 @@ impl Handle<Tui> for PhrasePool<Tui> {
|
|||
self.phrase += 1;
|
||||
},
|
||||
key!(KeyCode::Char('d')) => { // insert duplicate
|
||||
let mut phrase = (*self.phrases[self.phrase].read().unwrap()).clone();
|
||||
let mut phrase = self.phrases[self.phrase].read().unwrap().duplicate();
|
||||
phrase.color = random_color_near(phrase.color, 0.2);
|
||||
self.phrases.insert(self.phrase + 1, Arc::new(RwLock::new(phrase)));
|
||||
self.phrase += 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue