its now using enum fully for the highlight mode

This commit is contained in:
filipriec
2025-04-16 00:11:41 +02:00
parent af4567aa3d
commit b6c4d3308d
11 changed files with 103 additions and 95 deletions

View File

@@ -21,6 +21,7 @@ use crate::state::pages::intro::IntroState;
use crate::state::app::buffer::BufferState;
use crate::state::app::state::AppState;
use crate::state::pages::admin::AdminState;
use crate::state::app::highlight::HighlightState;
pub fn render_ui(
f: &mut Frame,
@@ -33,9 +34,7 @@ pub fn render_ui(
buffer_state: &BufferState,
theme: &Theme,
is_edit_mode: bool,
is_highlight_mode: bool,
is_linewise_highlight: bool,
highlight_anchor: Option<(usize, usize)>,
highlight_state: &HighlightState,
total_count: u64,
current_position: u64,
current_dir: &str,
@@ -95,9 +94,7 @@ pub fn render_ui(
register_state,
app_state,
register_state.current_field < 4,
is_highlight_mode,
is_linewise_highlight,
highlight_anchor,
highlight_state,
);
} else if app_state.ui.show_login {
render_login(
@@ -107,9 +104,7 @@ pub fn render_ui(
login_state,
app_state,
login_state.current_field < 2,
is_highlight_mode,
is_linewise_highlight,
highlight_anchor,
highlight_state,
);
} else if app_state.ui.show_admin {
crate::components::admin::admin_panel::render_admin_panel(
@@ -174,9 +169,7 @@ pub fn render_ui(
&values,
theme,
is_edit_mode,
is_highlight_mode,
is_linewise_highlight,
highlight_anchor,
highlight_state,
total_count,
current_position,
);

View File

@@ -91,9 +91,7 @@ pub async fn run_ui() -> Result<(), Box<dyn std::error::Error>> {
&buffer_state,
&theme,
is_edit_mode,
event_handler.is_highlight_mode,
event_handler.is_linewise_highlight,
event_handler.highlight_anchor,
&event_handler.highlight_state,
app_state.total_count,
app_state.current_position,
&app_state.current_dir,