Skip to content

Make file picker autocompletion case-insensitive#464

Merged
lhecker merged 2 commits into
mainfrom
dev/lhecker/insensitive-autocomplete
Jun 11, 2025
Merged

Make file picker autocompletion case-insensitive#464
lhecker merged 2 commits into
mainfrom
dev/lhecker/insensitive-autocomplete

Conversation

@lhecker

@lhecker lhecker commented Jun 11, 2025

Copy link
Copy Markdown
Member

No description provided.

use std::fs;
use std::path::{Path, PathBuf};

use edit::arena::scratch_arena;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let mut files = Vec::new();
let mut off = 0;
// ["..", directories, files]
let mut dirs_files = [Vec::new(), Vec::new(), Vec::new()];

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This split allows us to use binary search to quickly find matching items during autocompletion. Previously it was O(n). We can't use a single list with a single binary search, because the list is sorted by directories first and then files.

@lhecker
lhecker merged commit e779c16 into main Jun 11, 2025
3 checks passed
@lhecker
lhecker deleted the dev/lhecker/insensitive-autocomplete branch June 11, 2025 20:30
Lou32Verbose pushed a commit to Lou32Verbose/edit that referenced this pull request Jan 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants