removing highlightmode from the app, handled by the library now

This commit is contained in:
Priec
2025-08-21 10:33:52 +02:00
parent 1320884409
commit 11b073c2fd
11 changed files with 54 additions and 131 deletions

View File

@@ -17,8 +17,6 @@ use crate::components::{
use crate::config::colors::themes::Theme;
use crate::modes::general::command_navigation::NavigationState;
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::pages::admin::AdminState;
use crate::state::pages::auth::AuthState;
@@ -31,15 +29,6 @@ use ratatui::{
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)]
pub fn render_ui(
f: &mut Frame,
@@ -52,7 +41,6 @@ pub fn render_ui(
buffer_state: &BufferState,
theme: &Theme,
is_event_handler_edit_mode: bool,
highlight_state: &LocalHighlightState, // Keep using local version
event_handler_command_input: &str,
event_handler_command_mode_active: bool,
event_handler_command_message: &str,
@@ -205,13 +193,11 @@ pub fn render_ui(
};
// CHANGED: Convert local HighlightState to canvas HighlightState for FormState
let canvas_highlight_state = convert_highlight_state(highlight_state);
form_state.render(
f,
form_render_area,
theme,
is_event_handler_edit_mode,
&canvas_highlight_state, // Use converted version
);
}

View File

@@ -599,7 +599,6 @@ pub async fn run_ui() -> Result<()> {
&buffer_state,
&theme,
event_handler.is_edit_mode,
&event_handler.highlight_state,
&event_handler.command_input,
event_handler.command_mode,
&event_handler.command_message,