fixing is_edit_mode flag removal
This commit is contained in:
@@ -35,7 +35,6 @@ pub fn render_ui(
|
||||
router: &mut Router,
|
||||
buffer_state: &BufferState,
|
||||
theme: &Theme,
|
||||
is_event_handler_edit_mode: bool,
|
||||
event_handler_command_input: &str,
|
||||
event_handler_command_mode_active: bool,
|
||||
event_handler_command_message: &str,
|
||||
@@ -96,7 +95,7 @@ pub fn render_ui(
|
||||
Page::Admin(state) => crate::components::admin::admin_panel::render_admin_panel(
|
||||
f,
|
||||
app_state,
|
||||
&mut AuthState::default(), // TODO: later move AuthState into Router
|
||||
&mut AuthState::default(),
|
||||
state,
|
||||
main_content_area,
|
||||
theme,
|
||||
@@ -109,7 +108,6 @@ pub fn render_ui(
|
||||
theme,
|
||||
app_state,
|
||||
state,
|
||||
is_event_handler_edit_mode,
|
||||
),
|
||||
Page::AddTable(state) => render_add_table(
|
||||
f,
|
||||
@@ -117,7 +115,6 @@ pub fn render_ui(
|
||||
theme,
|
||||
app_state,
|
||||
state,
|
||||
is_event_handler_edit_mode,
|
||||
),
|
||||
Page::Form(state) => {
|
||||
let (sidebar_area, form_actual_area) =
|
||||
@@ -189,7 +186,6 @@ pub fn render_ui(
|
||||
&mut chunk_idx,
|
||||
current_dir,
|
||||
theme,
|
||||
is_event_handler_edit_mode,
|
||||
current_fps,
|
||||
app_state,
|
||||
navigation_state,
|
||||
|
||||
@@ -544,7 +544,7 @@ pub async fn run_ui() -> Result<()> {
|
||||
|
||||
if let Page::Form(form_state) = &mut router.current {
|
||||
if !table_just_switched {
|
||||
if position_changed && !event_handler.is_edit_mode {
|
||||
if position_changed && !matches!(app_state.form_editor.as_ref().map(|e| e.mode()), Some(canvas::AppMode::Edit)) {
|
||||
position_logic_needs_redraw = true;
|
||||
|
||||
if let Some(form_state) = app_state.form_state_mut() {
|
||||
@@ -582,7 +582,7 @@ pub async fn run_ui() -> Result<()> {
|
||||
form_state.current_cursor_pos =
|
||||
event_handler.ideal_cursor_column.min(max_cursor_pos);
|
||||
}
|
||||
} else if !position_changed && !event_handler.is_edit_mode {
|
||||
} else if !position_changed && !matches!(app_state.form_editor.as_ref().map(|e| e.mode()), Some(canvas::AppMode::Edit)) {
|
||||
if let Some(form_state) = app_state.form_state_mut() {
|
||||
let current_input_str = form_state.get_current_input();
|
||||
let current_input_len = current_input_str.chars().count();
|
||||
@@ -597,7 +597,7 @@ pub async fn run_ui() -> Result<()> {
|
||||
}
|
||||
}
|
||||
} else if let Page::Register(state) = &mut router.current {
|
||||
if !event_handler.is_edit_mode {
|
||||
if !matches!(app_state.form_editor.as_ref().map(|e| e.mode()), Some(canvas::AppMode::Edit)) {
|
||||
let current_input = state.get_current_input();
|
||||
let max_cursor_pos =
|
||||
if !current_input.is_empty() { current_input.len() - 1 } else { 0 };
|
||||
@@ -605,7 +605,7 @@ pub async fn run_ui() -> Result<()> {
|
||||
event_handler.ideal_cursor_column.min(max_cursor_pos);
|
||||
}
|
||||
} else if let Page::Login(state) = &mut router.current {
|
||||
if !event_handler.is_edit_mode {
|
||||
if !matches!(app_state.form_editor.as_ref().map(|e| e.mode()), Some(canvas::AppMode::Edit)) {
|
||||
let current_input = state.get_current_input();
|
||||
let max_cursor_pos =
|
||||
if !current_input.is_empty() { current_input.len() - 1 } else { 0 };
|
||||
@@ -688,7 +688,6 @@ pub async fn run_ui() -> Result<()> {
|
||||
&mut router,
|
||||
&buffer_state,
|
||||
&theme,
|
||||
event_handler.is_edit_mode,
|
||||
&event_handler.command_input,
|
||||
event_handler.command_mode,
|
||||
&event_handler.command_message,
|
||||
|
||||
Reference in New Issue
Block a user