Fix links key binding masking editor key bindings
This commit is contained in:
parent
9c3f846d8a
commit
a091855ea3
1 changed files with 25 additions and 10 deletions
|
|
@ -331,15 +331,6 @@ impl EuphRoom {
|
||||||
crossterm_lock: &Arc<FairMutex<()>>,
|
crossterm_lock: &Arc<FairMutex<()>>,
|
||||||
event: &InputEvent,
|
event: &InputEvent,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
if let key!('I') = event {
|
|
||||||
if let Some(id) = self.chat.cursor().await {
|
|
||||||
if let Some(msg) = self.vault.msg(&id).await {
|
|
||||||
self.state = State::Links(LinksState::new(&msg.content));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Some(room) = &self.room {
|
if let Some(room) = &self.room {
|
||||||
let status = room.status().await;
|
let status = room.status().await;
|
||||||
let can_compose = matches!(status, Ok(Some(Status::Joined(_))));
|
let can_compose = matches!(status, Ok(Some(Status::Joined(_))));
|
||||||
|
|
@ -362,6 +353,15 @@ impl EuphRoom {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let key!('I') = event {
|
||||||
|
if let Some(id) = self.chat.cursor().await {
|
||||||
|
if let Some(msg) = self.vault.msg(&id).await {
|
||||||
|
self.state = State::Links(LinksState::new(&msg.content));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
match status.ok().flatten() {
|
match status.ok().flatten() {
|
||||||
Some(Status::Joining(Joining {
|
Some(Status::Joining(Joining {
|
||||||
bounce: Some(_), ..
|
bounce: Some(_), ..
|
||||||
|
|
@ -389,10 +389,25 @@ impl EuphRoom {
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
self.chat
|
if self
|
||||||
|
.chat
|
||||||
.handle_input_event(terminal, crossterm_lock, event, false)
|
.handle_input_event(terminal, crossterm_lock, event, false)
|
||||||
.await
|
.await
|
||||||
.handled()
|
.handled()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if let key!('I') = event {
|
||||||
|
if let Some(id) = self.chat.cursor().await {
|
||||||
|
if let Some(msg) = self.vault.msg(&id).await {
|
||||||
|
self.state = State::Links(LinksState::new(&msg.content));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue