last speck of dust

This commit is contained in:
Penwing 2024-01-25 20:54:54 +01:00
parent 4320990497
commit 0c466a322e
2 changed files with 166 additions and 167 deletions

View file

@ -303,11 +303,8 @@ impl CodeEditor {
{
if let Some(range) = last_cursor {
if range.primary.index != range.secondary.index {
(*text, extend) = self.add_start_of_line(
*range,
previous_text.clone(),
"\t",
);
(*text, extend) =
self.add_start_of_line(*range, previous_text.clone(), "\t");
get_new_cursor = false;
}
}
@ -337,8 +334,7 @@ impl CodeEditor {
} else if let Some(cursor_range) = *last_cursor {
let mut start =
min(cursor_range.primary.index, cursor_range.secondary.index);
let end =
max(cursor_range.primary.index, cursor_range.secondary.index);
let end = max(cursor_range.primary.index, cursor_range.secondary.index);
let extended = match end as isize + extend {
// Check for overflow or negative result
value if value < 0 => 0,

View file

@ -49,7 +49,10 @@ fn main() -> Result<(), eframe::Error> {
let app_state: tools::AppState = if Path::new(SAVE_PATH).exists() {
tools::load_state(SAVE_PATH).expect("Failed to load the save")
} else {
tools::AppState {tabs: vec![], theme: 0,}
tools::AppState {
tabs: vec![],
theme: 0,
}
};
eframe::run_native(