53 lines
1.8 KiB
Rust
53 lines
1.8 KiB
Rust
|
|
use super::editor::TextEditor;
|
||
|
|
use super::editor::TextProcessingResult;
|
||
|
|
use crate::app::{tab::Tab, theme::Theme};
|
||
|
|
use std::sync::{Arc, Mutex};
|
||
|
|
|
||
|
|
impl Default for TextEditor {
|
||
|
|
fn default() -> Self {
|
||
|
|
Self {
|
||
|
|
tabs: vec![Tab::new_empty(1)],
|
||
|
|
active_tab_index: 0,
|
||
|
|
tab_counter: 1,
|
||
|
|
show_about: false,
|
||
|
|
show_shortcuts: false,
|
||
|
|
show_find: false,
|
||
|
|
show_preferences: false,
|
||
|
|
pending_unsaved_action: None,
|
||
|
|
force_quit_confirmed: false,
|
||
|
|
clean_quit_requested: false,
|
||
|
|
show_line_numbers: false,
|
||
|
|
word_wrap: true,
|
||
|
|
auto_hide_toolbar: false,
|
||
|
|
theme: Theme::default(),
|
||
|
|
line_side: false,
|
||
|
|
font_family: "Proportional".to_string(),
|
||
|
|
font_size: 14.0,
|
||
|
|
font_size_input: None,
|
||
|
|
zoom_factor: 1.0,
|
||
|
|
menu_interaction_active: false,
|
||
|
|
tab_bar_rect: None,
|
||
|
|
menu_bar_stable_until: None,
|
||
|
|
text_processing_result: Arc::new(Mutex::new(TextProcessingResult::default())),
|
||
|
|
processing_thread_handle: None,
|
||
|
|
// Find functionality
|
||
|
|
find_query: String::new(),
|
||
|
|
find_matches: Vec::new(),
|
||
|
|
current_match_index: None,
|
||
|
|
case_sensitive_search: false,
|
||
|
|
prev_show_find: false,
|
||
|
|
// Width calculation cache and state tracking
|
||
|
|
cached_width: None,
|
||
|
|
last_word_wrap: true,
|
||
|
|
last_show_line_numbers: false,
|
||
|
|
last_font_size: 14.0,
|
||
|
|
last_line_side: false,
|
||
|
|
last_viewport_width: 0.0,
|
||
|
|
// vim_mode: false,
|
||
|
|
|
||
|
|
// Cursor tracking for smart scrolling
|
||
|
|
previous_cursor_position: None,
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|