Feat: UI/UX fixes + removing clones from places

This commit is contained in:
2026-03-05 00:15:51 +01:00
parent 35370a6f2c
commit 60fb62829f
17 changed files with 1817 additions and 290 deletions

View File

@@ -1,6 +1,7 @@
//! Script editor widget with completion, search, and sample finder popups.
use std::cell::Cell;
use std::sync::Arc;
use crate::theme;
use ratatui::{
@@ -25,7 +26,7 @@ pub struct CompletionCandidate {
}
struct CompletionState {
candidates: Vec<CompletionCandidate>,
candidates: Arc<[CompletionCandidate]>,
matches: Vec<usize>,
cursor: usize,
prefix: String,
@@ -37,7 +38,7 @@ struct CompletionState {
impl CompletionState {
fn new() -> Self {
Self {
candidates: Vec::new(),
candidates: Arc::from([]),
matches: Vec::new(),
cursor: 0,
prefix: String::new(),
@@ -171,7 +172,7 @@ impl Editor {
self.scroll_offset.set(0);
}
pub fn set_candidates(&mut self, candidates: Vec<CompletionCandidate>) {
pub fn set_candidates(&mut self, candidates: Arc<[CompletionCandidate]>) {
self.completion.candidates = candidates;
}