removing highlightmode from the app, handled by the library now
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
// src/components/admin/add_logic.rs
|
// src/components/admin/add_logic.rs
|
||||||
use crate::config::colors::themes::Theme;
|
use crate::config::colors::themes::Theme;
|
||||||
use crate::state::app::highlight::HighlightState;
|
|
||||||
use crate::state::app::state::AppState;
|
use crate::state::app::state::AppState;
|
||||||
use crate::state::pages::add_logic::{AddLogicFocus, AddLogicState};
|
use crate::state::pages::add_logic::{AddLogicFocus, AddLogicState};
|
||||||
use canvas::{render_canvas, FormEditor};
|
use canvas::{render_canvas, FormEditor};
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
// src/components/admin/add_table.rs
|
// src/components/admin/add_table.rs
|
||||||
use crate::config::colors::themes::Theme;
|
use crate::config::colors::themes::Theme;
|
||||||
use crate::state::app::highlight::HighlightState;
|
|
||||||
use crate::state::app::state::AppState;
|
use crate::state::app::state::AppState;
|
||||||
use crate::state::pages::add_table::{AddTableFocus, AddTableState};
|
use crate::state::pages::add_table::{AddTableFocus, AddTableState};
|
||||||
use canvas::{render_canvas_default, render_canvas, FormEditor};
|
use canvas::{render_canvas_default, render_canvas, FormEditor};
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ use ratatui::{
|
|||||||
widgets::{Block, BorderType, Borders, Paragraph},
|
widgets::{Block, BorderType, Borders, Paragraph},
|
||||||
Frame,
|
Frame,
|
||||||
};
|
};
|
||||||
use crate::state::app::highlight::HighlightState;
|
|
||||||
use canvas::{
|
use canvas::{
|
||||||
FormEditor,
|
FormEditor,
|
||||||
render_canvas,
|
render_canvas,
|
||||||
|
|||||||
@@ -13,18 +13,7 @@ use ratatui::{
|
|||||||
widgets::{Block, BorderType, Borders, Paragraph},
|
widgets::{Block, BorderType, Borders, Paragraph},
|
||||||
Frame,
|
Frame,
|
||||||
};
|
};
|
||||||
use crate::state::app::highlight::HighlightState;
|
|
||||||
use canvas::{FormEditor, render_canvas_default, render_canvas, render_suggestions_dropdown, DefaultCanvasTheme};
|
use canvas::{FormEditor, render_canvas_default, render_canvas, render_suggestions_dropdown, DefaultCanvasTheme};
|
||||||
use canvas::canvas::HighlightState as CanvasHighlightState;
|
|
||||||
|
|
||||||
// Helper function to convert between HighlightState types
|
|
||||||
fn convert_highlight_state(local: &HighlightState) -> CanvasHighlightState {
|
|
||||||
match local {
|
|
||||||
HighlightState::Off => CanvasHighlightState::Off,
|
|
||||||
HighlightState::Characterwise { anchor } => CanvasHighlightState::Characterwise { anchor: *anchor },
|
|
||||||
HighlightState::Linewise { anchor_line } => CanvasHighlightState::Linewise { anchor_line: *anchor_line },
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn render_register(
|
pub fn render_register(
|
||||||
f: &mut Frame,
|
f: &mut Frame,
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ use canvas::{FormEditor, AppMode as CanvasMode};
|
|||||||
use crate::state::{
|
use crate::state::{
|
||||||
app::{
|
app::{
|
||||||
buffer::{AppView, BufferState},
|
buffer::{AppView, BufferState},
|
||||||
highlight::HighlightState,
|
|
||||||
search::SearchState,
|
search::SearchState,
|
||||||
state::AppState,
|
state::AppState,
|
||||||
},
|
},
|
||||||
@@ -71,7 +70,6 @@ pub struct EventHandler {
|
|||||||
pub command_input: String,
|
pub command_input: String,
|
||||||
pub command_message: String,
|
pub command_message: String,
|
||||||
pub is_edit_mode: bool,
|
pub is_edit_mode: bool,
|
||||||
pub highlight_state: HighlightState,
|
|
||||||
pub edit_mode_cooldown: bool,
|
pub edit_mode_cooldown: bool,
|
||||||
pub ideal_cursor_column: usize,
|
pub ideal_cursor_column: usize,
|
||||||
pub key_sequence_tracker: KeySequenceTracker,
|
pub key_sequence_tracker: KeySequenceTracker,
|
||||||
@@ -103,7 +101,6 @@ impl EventHandler {
|
|||||||
command_input: String::new(),
|
command_input: String::new(),
|
||||||
command_message: String::new(),
|
command_message: String::new(),
|
||||||
is_edit_mode: false,
|
is_edit_mode: false,
|
||||||
highlight_state: HighlightState::Off,
|
|
||||||
edit_mode_cooldown: false,
|
edit_mode_cooldown: false,
|
||||||
ideal_cursor_column: 0,
|
ideal_cursor_column: 0,
|
||||||
key_sequence_tracker: KeySequenceTracker::new(400),
|
key_sequence_tracker: KeySequenceTracker::new(400),
|
||||||
@@ -653,45 +650,30 @@ impl EventHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
AppMode::ReadOnly => {
|
AppMode::ReadOnly => {
|
||||||
// Handle highlight mode transitions
|
// Handle highlight mode transitions (delegated to FormEditor)
|
||||||
if config.get_read_only_action_for_key(key_code, modifiers) == Some("enter_highlight_mode_linewise")
|
if config.get_read_only_action_for_key(key_code, modifiers)
|
||||||
|
== Some("enter_highlight_mode_linewise")
|
||||||
&& ModeManager::can_enter_highlight_mode(current_mode)
|
&& ModeManager::can_enter_highlight_mode(current_mode)
|
||||||
{
|
{
|
||||||
let current_field_index = Self::get_current_field_for_state(
|
if let Some(editor) = &mut app_state.form_editor {
|
||||||
app_state,
|
editor.enter_highlight_line_mode();
|
||||||
login_state,
|
}
|
||||||
register_state,
|
|
||||||
form_state
|
|
||||||
);
|
|
||||||
self.highlight_state = HighlightState::Linewise {
|
|
||||||
anchor_line: current_field_index
|
|
||||||
};
|
|
||||||
self.command_message = "-- LINE HIGHLIGHT --".to_string();
|
self.command_message = "-- LINE HIGHLIGHT --".to_string();
|
||||||
return Ok(EventOutcome::Ok(self.command_message.clone()));
|
return Ok(EventOutcome::Ok(self.command_message.clone()));
|
||||||
}
|
} else if config.get_read_only_action_for_key(key_code, modifiers)
|
||||||
else if config.get_read_only_action_for_key(key_code, modifiers) == Some("enter_highlight_mode")
|
== Some("enter_highlight_mode")
|
||||||
&& ModeManager::can_enter_highlight_mode(current_mode)
|
&& ModeManager::can_enter_highlight_mode(current_mode)
|
||||||
{
|
{
|
||||||
let current_field_index = Self::get_current_field_for_state(
|
if let Some(editor) = &mut app_state.form_editor {
|
||||||
app_state,
|
editor.enter_highlight_mode();
|
||||||
login_state,
|
}
|
||||||
register_state,
|
|
||||||
form_state
|
|
||||||
);
|
|
||||||
let current_cursor_pos = Self::get_current_cursor_pos_for_state(
|
|
||||||
app_state,
|
|
||||||
login_state,
|
|
||||||
register_state,
|
|
||||||
form_state
|
|
||||||
);
|
|
||||||
let anchor = (current_field_index, current_cursor_pos);
|
|
||||||
self.highlight_state = HighlightState::Characterwise { anchor };
|
|
||||||
self.command_message = "-- HIGHLIGHT --".to_string();
|
self.command_message = "-- HIGHLIGHT --".to_string();
|
||||||
return Ok(EventOutcome::Ok(self.command_message.clone()));
|
return Ok(EventOutcome::Ok(self.command_message.clone()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle edit mode transitions
|
// Handle edit mode transitions
|
||||||
else if config.get_read_only_action_for_key(key_code, modifiers).as_deref() == Some("enter_edit_mode_before")
|
else if config.get_read_only_action_for_key(key_code, modifiers).as_deref()
|
||||||
|
== Some("enter_edit_mode_before")
|
||||||
&& ModeManager::can_enter_edit_mode(current_mode)
|
&& ModeManager::can_enter_edit_mode(current_mode)
|
||||||
{
|
{
|
||||||
if let Some(editor) = &mut app_state.form_editor {
|
if let Some(editor) = &mut app_state.form_editor {
|
||||||
@@ -701,21 +683,18 @@ impl EventHandler {
|
|||||||
self.edit_mode_cooldown = true;
|
self.edit_mode_cooldown = true;
|
||||||
self.command_message = "Edit mode".to_string();
|
self.command_message = "Edit mode".to_string();
|
||||||
return Ok(EventOutcome::Ok(self.command_message.clone()));
|
return Ok(EventOutcome::Ok(self.command_message.clone()));
|
||||||
}
|
} else if config.get_read_only_action_for_key(key_code, modifiers).as_deref()
|
||||||
else if config.get_read_only_action_for_key(key_code, modifiers).as_deref() == Some("enter_edit_mode_after")
|
== Some("enter_edit_mode_after")
|
||||||
&& ModeManager::can_enter_edit_mode(current_mode)
|
&& ModeManager::can_enter_edit_mode(current_mode)
|
||||||
{
|
{
|
||||||
let current_input = Self::get_current_input_for_state(
|
let current_input = Self::get_current_input_for_state(
|
||||||
app_state,
|
app_state,
|
||||||
login_state,
|
login_state,
|
||||||
register_state,
|
register_state,
|
||||||
form_state
|
form_state,
|
||||||
);
|
|
||||||
let current_cursor_pos = Self::get_cursor_pos_for_mixed_state(
|
|
||||||
app_state,
|
|
||||||
login_state,
|
|
||||||
form_state
|
|
||||||
);
|
);
|
||||||
|
let current_cursor_pos =
|
||||||
|
Self::get_cursor_pos_for_mixed_state(app_state, login_state, form_state);
|
||||||
|
|
||||||
// Move cursor forward if possible
|
// Move cursor forward if possible
|
||||||
if !current_input.is_empty() && current_cursor_pos < current_input.len() {
|
if !current_input.is_empty() && current_cursor_pos < current_input.len() {
|
||||||
@@ -725,13 +704,13 @@ impl EventHandler {
|
|||||||
login_state,
|
login_state,
|
||||||
register_state,
|
register_state,
|
||||||
form_state,
|
form_state,
|
||||||
new_cursor_pos
|
new_cursor_pos,
|
||||||
);
|
);
|
||||||
self.ideal_cursor_column = Self::get_current_cursor_pos_for_state(
|
self.ideal_cursor_column = Self::get_current_cursor_pos_for_state(
|
||||||
app_state,
|
app_state,
|
||||||
login_state,
|
login_state,
|
||||||
register_state,
|
register_state,
|
||||||
form_state
|
form_state,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -743,8 +722,8 @@ impl EventHandler {
|
|||||||
app_state.ui.focus_outside_canvas = false;
|
app_state.ui.focus_outside_canvas = false;
|
||||||
self.command_message = "Edit mode (after cursor)".to_string();
|
self.command_message = "Edit mode (after cursor)".to_string();
|
||||||
return Ok(EventOutcome::Ok(self.command_message.clone()));
|
return Ok(EventOutcome::Ok(self.command_message.clone()));
|
||||||
}
|
} else if config.get_read_only_action_for_key(key_code, modifiers)
|
||||||
else if config.get_read_only_action_for_key(key_code, modifiers) == Some("enter_command_mode")
|
== Some("enter_command_mode")
|
||||||
&& ModeManager::can_enter_command_mode(current_mode)
|
&& ModeManager::can_enter_command_mode(current_mode)
|
||||||
{
|
{
|
||||||
if let Some(editor) = &mut app_state.form_editor {
|
if let Some(editor) = &mut app_state.form_editor {
|
||||||
@@ -779,12 +758,9 @@ impl EventHandler {
|
|||||||
// Try canvas action for form first
|
// Try canvas action for form first
|
||||||
if app_state.ui.show_form {
|
if app_state.ui.show_form {
|
||||||
if let Some(editor) = &mut app_state.form_editor {
|
if let Some(editor) = &mut app_state.form_editor {
|
||||||
if let Ok(Some(canvas_message)) = self.handle_form_canvas_action(
|
if let Ok(Some(canvas_message)) =
|
||||||
key_event,
|
self.handle_form_canvas_action(key_event, editor, config, false).await
|
||||||
editor,
|
{
|
||||||
config,
|
|
||||||
false,
|
|
||||||
).await {
|
|
||||||
return Ok(EventOutcome::Ok(canvas_message));
|
return Ok(EventOutcome::Ok(canvas_message));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -794,21 +770,23 @@ impl EventHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
AppMode::Highlight => {
|
AppMode::Highlight => {
|
||||||
if config.get_highlight_action_for_key(key_code, modifiers) == Some("exit_highlight_mode") {
|
if config.get_highlight_action_for_key(key_code, modifiers)
|
||||||
|
== Some("exit_highlight_mode")
|
||||||
|
{
|
||||||
if let Some(editor) = &mut app_state.form_editor {
|
if let Some(editor) = &mut app_state.form_editor {
|
||||||
editor.exit_highlight_mode();
|
editor.exit_highlight_mode();
|
||||||
}
|
}
|
||||||
self.highlight_state = HighlightState::Off;
|
|
||||||
self.command_message = "Exited highlight mode".to_string();
|
self.command_message = "Exited highlight mode".to_string();
|
||||||
return Ok(EventOutcome::Ok(self.command_message.clone()));
|
return Ok(EventOutcome::Ok(self.command_message.clone()));
|
||||||
} else if config.get_highlight_action_for_key(key_code, modifiers) == Some("enter_highlight_mode_linewise") {
|
} else if config.get_highlight_action_for_key(key_code, modifiers)
|
||||||
if let HighlightState::Characterwise { anchor } = self.highlight_state {
|
== Some("enter_highlight_mode_linewise")
|
||||||
self.highlight_state = HighlightState::Linewise { anchor_line: anchor.0 };
|
{
|
||||||
|
if let Some(editor) = &mut app_state.form_editor {
|
||||||
|
editor.enter_highlight_line_mode();
|
||||||
|
}
|
||||||
self.command_message = "-- LINE HIGHLIGHT --".to_string();
|
self.command_message = "-- LINE HIGHLIGHT --".to_string();
|
||||||
return Ok(EventOutcome::Ok(self.command_message.clone()));
|
return Ok(EventOutcome::Ok(self.command_message.clone()));
|
||||||
}
|
}
|
||||||
return Ok(EventOutcome::Ok("".to_string()));
|
|
||||||
}
|
|
||||||
|
|
||||||
return Ok(EventOutcome::Ok(self.command_message.clone()));
|
return Ok(EventOutcome::Ok(self.command_message.clone()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
use crate::state::app::state::AppState;
|
use crate::state::app::state::AppState;
|
||||||
use crate::modes::handlers::event::EventHandler;
|
use crate::modes::handlers::event::EventHandler;
|
||||||
use crate::state::pages::add_logic::AddLogicFocus;
|
use crate::state::pages::add_logic::AddLogicFocus;
|
||||||
use crate::state::app::highlight::HighlightState;
|
|
||||||
use crate::state::pages::admin::AdminState;
|
use crate::state::pages::admin::AdminState;
|
||||||
|
use canvas::AppMode as CanvasMode;
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||||
pub enum AppMode {
|
pub enum AppMode {
|
||||||
@@ -31,9 +31,12 @@ impl ModeManager {
|
|||||||
return AppMode::Command;
|
return AppMode::Command;
|
||||||
}
|
}
|
||||||
|
|
||||||
if !matches!(event_handler.highlight_state, HighlightState::Off) {
|
// NEW: delegate highlight detection to FormEditor
|
||||||
|
if let Some(editor) = &app_state.form_editor {
|
||||||
|
if editor.mode() == CanvasMode::Highlight {
|
||||||
return AppMode::Highlight;
|
return AppMode::Highlight;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let is_canvas_view = app_state.ui.show_login
|
let is_canvas_view = app_state.ui.show_login
|
||||||
|| app_state.ui.show_register
|
|| app_state.ui.show_register
|
||||||
@@ -42,12 +45,10 @@ impl ModeManager {
|
|||||||
|| app_state.ui.show_add_logic;
|
|| app_state.ui.show_add_logic;
|
||||||
|
|
||||||
if app_state.ui.show_add_logic {
|
if app_state.ui.show_add_logic {
|
||||||
// Specific logic for AddLogic view
|
|
||||||
match admin_state.add_logic_state.current_focus {
|
match admin_state.add_logic_state.current_focus {
|
||||||
AddLogicFocus::InputLogicName
|
AddLogicFocus::InputLogicName
|
||||||
| AddLogicFocus::InputTargetColumn
|
| AddLogicFocus::InputTargetColumn
|
||||||
| AddLogicFocus::InputDescription => {
|
| AddLogicFocus::InputDescription => {
|
||||||
// These are canvas inputs
|
|
||||||
if event_handler.is_edit_mode {
|
if event_handler.is_edit_mode {
|
||||||
AppMode::Edit
|
AppMode::Edit
|
||||||
} else {
|
} else {
|
||||||
@@ -59,23 +60,19 @@ impl ModeManager {
|
|||||||
} else if app_state.ui.show_add_table {
|
} else if app_state.ui.show_add_table {
|
||||||
if app_state.ui.focus_outside_canvas {
|
if app_state.ui.focus_outside_canvas {
|
||||||
AppMode::General
|
AppMode::General
|
||||||
} else {
|
} else if event_handler.is_edit_mode {
|
||||||
if event_handler.is_edit_mode {
|
|
||||||
AppMode::Edit
|
AppMode::Edit
|
||||||
} else {
|
} else {
|
||||||
AppMode::ReadOnly
|
AppMode::ReadOnly
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else if is_canvas_view {
|
} else if is_canvas_view {
|
||||||
if app_state.ui.focus_outside_canvas {
|
if app_state.ui.focus_outside_canvas {
|
||||||
AppMode::General
|
AppMode::General
|
||||||
} else {
|
} else if event_handler.is_edit_mode {
|
||||||
if event_handler.is_edit_mode {
|
|
||||||
AppMode::Edit
|
AppMode::Edit
|
||||||
} else {
|
} else {
|
||||||
AppMode::ReadOnly
|
AppMode::ReadOnly
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
AppMode::General
|
AppMode::General
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,4 +3,3 @@
|
|||||||
pub mod state;
|
pub mod state;
|
||||||
pub mod buffer;
|
pub mod buffer;
|
||||||
pub mod search;
|
pub mod search;
|
||||||
pub mod highlight;
|
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
// src/state/app/highlight.rs
|
|
||||||
|
|
||||||
/// Represents the different states of text highlighting.
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
||||||
pub enum HighlightState {
|
|
||||||
/// Highlighting is inactive.
|
|
||||||
Off,
|
|
||||||
/// Highlighting character by character. Stores the anchor point (line index, char index).
|
|
||||||
Characterwise { anchor: (usize, usize) },
|
|
||||||
/// Highlighting line by line. Stores the anchor line index.
|
|
||||||
Linewise { anchor_line: usize },
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Default for HighlightState {
|
|
||||||
/// The default state is no highlighting.
|
|
||||||
fn default() -> Self {
|
|
||||||
HighlightState::Off
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
use crate::config::colors::themes::Theme;
|
use crate::config::colors::themes::Theme;
|
||||||
use canvas::{DataProvider, AppMode, EditorState, FormEditor};
|
use canvas::{DataProvider, AppMode, EditorState, FormEditor};
|
||||||
use canvas::canvas::HighlightState;
|
|
||||||
use common::proto::komp_ac::search::search_response::Hit;
|
use common::proto::komp_ac::search::search_response::Hit;
|
||||||
use ratatui::layout::Rect;
|
use ratatui::layout::Rect;
|
||||||
use ratatui::Frame;
|
use ratatui::Frame;
|
||||||
@@ -123,7 +122,6 @@ impl FormState {
|
|||||||
area: Rect,
|
area: Rect,
|
||||||
theme: &Theme,
|
theme: &Theme,
|
||||||
is_edit_mode: bool,
|
is_edit_mode: bool,
|
||||||
highlight_state: &HighlightState,
|
|
||||||
) {
|
) {
|
||||||
// Wrap in FormEditor for new API
|
// Wrap in FormEditor for new API
|
||||||
let mut editor = FormEditor::new(self.clone());
|
let mut editor = FormEditor::new(self.clone());
|
||||||
|
|||||||
@@ -17,8 +17,6 @@ use crate::components::{
|
|||||||
use crate::config::colors::themes::Theme;
|
use crate::config::colors::themes::Theme;
|
||||||
use crate::modes::general::command_navigation::NavigationState;
|
use crate::modes::general::command_navigation::NavigationState;
|
||||||
use crate::state::app::buffer::BufferState;
|
use crate::state::app::buffer::BufferState;
|
||||||
use crate::state::app::highlight::HighlightState as LocalHighlightState;
|
|
||||||
use canvas::canvas::HighlightState as CanvasHighlightState;
|
|
||||||
use crate::state::app::state::AppState;
|
use crate::state::app::state::AppState;
|
||||||
use crate::state::pages::admin::AdminState;
|
use crate::state::pages::admin::AdminState;
|
||||||
use crate::state::pages::auth::AuthState;
|
use crate::state::pages::auth::AuthState;
|
||||||
@@ -31,15 +29,6 @@ use ratatui::{
|
|||||||
Frame,
|
Frame,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Helper function to convert between HighlightState types
|
|
||||||
fn convert_highlight_state(local: &LocalHighlightState) -> CanvasHighlightState {
|
|
||||||
match local {
|
|
||||||
LocalHighlightState::Off => CanvasHighlightState::Off,
|
|
||||||
LocalHighlightState::Characterwise { anchor } => CanvasHighlightState::Characterwise { anchor: *anchor },
|
|
||||||
LocalHighlightState::Linewise { anchor_line } => CanvasHighlightState::Linewise { anchor_line: *anchor_line },
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
pub fn render_ui(
|
pub fn render_ui(
|
||||||
f: &mut Frame,
|
f: &mut Frame,
|
||||||
@@ -52,7 +41,6 @@ pub fn render_ui(
|
|||||||
buffer_state: &BufferState,
|
buffer_state: &BufferState,
|
||||||
theme: &Theme,
|
theme: &Theme,
|
||||||
is_event_handler_edit_mode: bool,
|
is_event_handler_edit_mode: bool,
|
||||||
highlight_state: &LocalHighlightState, // Keep using local version
|
|
||||||
event_handler_command_input: &str,
|
event_handler_command_input: &str,
|
||||||
event_handler_command_mode_active: bool,
|
event_handler_command_mode_active: bool,
|
||||||
event_handler_command_message: &str,
|
event_handler_command_message: &str,
|
||||||
@@ -205,13 +193,11 @@ pub fn render_ui(
|
|||||||
};
|
};
|
||||||
|
|
||||||
// CHANGED: Convert local HighlightState to canvas HighlightState for FormState
|
// CHANGED: Convert local HighlightState to canvas HighlightState for FormState
|
||||||
let canvas_highlight_state = convert_highlight_state(highlight_state);
|
|
||||||
form_state.render(
|
form_state.render(
|
||||||
f,
|
f,
|
||||||
form_render_area,
|
form_render_area,
|
||||||
theme,
|
theme,
|
||||||
is_event_handler_edit_mode,
|
is_event_handler_edit_mode,
|
||||||
&canvas_highlight_state, // Use converted version
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -599,7 +599,6 @@ pub async fn run_ui() -> Result<()> {
|
|||||||
&buffer_state,
|
&buffer_state,
|
||||||
&theme,
|
&theme,
|
||||||
event_handler.is_edit_mode,
|
event_handler.is_edit_mode,
|
||||||
&event_handler.highlight_state,
|
|
||||||
&event_handler.command_input,
|
&event_handler.command_input,
|
||||||
event_handler.command_mode,
|
event_handler.command_mode,
|
||||||
&event_handler.command_message,
|
&event_handler.command_message,
|
||||||
|
|||||||
Reference in New Issue
Block a user