refactor settings
Some checks failed
Rust / build (ubuntu-latest, stable) (push) Failing after 1m24s
Rust / build (ubuntu-latest, stable) (pull_request) Failing after 1m34s

This commit is contained in:
2026-02-14 09:00:05 +07:00
parent 911b841918
commit e921725df9
8 changed files with 541 additions and 454 deletions

View File

@@ -1009,8 +1009,7 @@ impl InputState {
let left_part = self.text.slice(0..offset).to_string();
UnicodeSegmentation::split_word_bound_indices(left_part.as_str())
.filter(|(_, s)| !s.trim_start().is_empty())
.next_back()
.rfind(|(_, s)| !s.trim_start().is_empty())
.map(|(i, _)| i)
.unwrap_or(0)
}

View File

@@ -1094,13 +1094,10 @@ impl Render for PopupMenu {
self.update_submenu_menu_anchor(window);
let max_width = self.max_width();
let max_height = self.max_height.map_or_else(
|| {
let window_half_height = window.window_bounds().get_bounds().size.height * 0.5;
window_half_height.min(px(450.))
},
|height| height,
);
let max_height = self.max_height.unwrap_or_else(|| {
let window_half_height = window.window_bounds().get_bounds().size.height * 0.5;
window_half_height.min(px(450.))
});
let view = cx.entity().clone();
let items_count = self.menu_items.len();