Fix(treewide): Resolve merge conflicts

This commit is contained in:
Benedikt Peetz 2023-07-26 22:25:08 +02:00
parent 855d487693
commit 84c13fd6f8
Signed by: bpeetz
GPG Key ID: A5E94010C3A642AD
5 changed files with 24 additions and 22 deletions

View File

@ -4,14 +4,14 @@ use anyhow::{Error, Result};
use cli_log::{trace, warn};
use tokio::sync::oneshot;
use crate::app::{
use crate::{app::{
command_interface::{
lua_command_manager::{CommandTransferValue, Table},
Command,
},
events::event_types::EventStatus,
App,
};
App, status::State,
}, ui::central::InputPosition};
pub async fn handle(
app: &mut App<'_>,
@ -99,14 +99,14 @@ pub async fn handle(
Command::SetModeNormal => {
app.status.set_state(State::Normal);
set_status_output!("Set input mode to Normal");
(EventStatus::Ok, "".to_owned())
send_status_output!("Set input mode to Normal");
EventStatus::Ok
}
Command::SetModeInsert => {
app.status.set_state(State::Insert);
app.ui.set_input_position(InputPosition::MessageCompose);
set_status_output!("Set input mode to Insert");
(EventStatus::Ok, "".to_owned())
send_status_output!("Set input mode to Insert");
EventStatus::Ok
}
Command::RoomMessageSend(msg) => {

View File

@ -10,7 +10,7 @@ use crate::{
ui::central,
};
pub async fn handle(
pub async fn handle_normal(
app: &mut App<'_>,
input_event: &CrosstermEvent,
) -> Result<EventStatus> {

View File

@ -5,7 +5,11 @@ use cli_log::trace;
use crossterm::event::Event as CrosstermEvent;
use tokio::sync::oneshot;
use crate::app::{command_interface::{Command, lua_command_manager::CommandTransferValue}, status::State, App};
use crate::app::{
command_interface::{lua_command_manager::CommandTransferValue, Command},
status::State,
App,
};
use self::handlers::{command, lua_command, main, matrix, setup};
@ -34,18 +38,16 @@ impl Event {
.await
.with_context(|| format!("Failed to handle lua code: `{}`", lua_code)),
Event::InputEvent(event) => match app.status.state() {
State::Normal => main::handle_normal(app, event)
.await
.with_context(|| format!("Failed to handle input event: `{:#?}`", event)),
State::Insert => main::handle_insert(app, event)
State::Main => main::handle(app, &event)
.await
.with_context(|| format!("Failed to handle input event: `{:#?}`", event)),
State::Setup => setup::handle(app, &event)
.await
.with_context(|| format!("Failed to handle input event: `{:#?}`", event)),
State::Normal => main::handle_normal(app, &event).await.with_context(|| {
format!("Failed to handle input (normal) event: `{:#?}`", event)
}),
State::Insert => main::handle_insert(app, &event).await.with_context(|| {
format!("Failed to handle input (insert) event: `{:#?}`", event)
}),
State::Setup => setup::handle(app, &event).await.with_context(|| {
format!("Failed to handle input (setup) event: `{:#?}`", event)
}),
},
}
}

View File

@ -151,7 +151,7 @@ impl Status {
};
Self {
state: State::None,
state: State::Normal,
account_name: "".to_owned(),
account_user_id: "".to_owned(),
client,

View File

@ -1,7 +1,7 @@
use std::cmp;
use anyhow::{Context, Result};
use tui::layout::{Constraint, Direction, Layout};
use tui::{layout::{Constraint, Direction, Layout}, widgets::{Paragraph, Block, Borders}, style::{Style, Color}};
use crate::app::status::Status;