Skip to content

feat: make filename_impl walker configurable - #7716

Open
sigmaSd wants to merge 1 commit into
helix-editor:masterfrom
sigmaSd:pp
Open

feat: make filename_impl walker configurable#7716
sigmaSd wants to merge 1 commit into
helix-editor:masterfrom
sigmaSd:pp

Conversation

@sigmaSd

@sigmaSd sigmaSd commented Jul 22, 2023

Copy link
Copy Markdown
Contributor

ref #7715

couple of notes:

@sigmaSd

sigmaSd commented Jul 22, 2023

Copy link
Copy Markdown
Contributor Author

adding another config option might look like this

diff --git a/helix-term/src/ui/mod.rs b/helix-term/src/ui/mod.rs
index 1dc3ddac..897ad4aa 100644
--- a/helix-term/src/ui/mod.rs
+++ b/helix-term/src/ui/mod.rs
@@ -486,9 +486,9 @@ fn filename_impl<F>(editor: &Editor, input: &str, filter_fn: F) -> Vec<Completio
             .hidden(false)
             .follow_links(false) // We're scanning over depth 1
             .max_depth(Some(1))
-            .ignore(config.file_picker.ignore)
-            .git_ignore(config.file_picker.git_ignore)
-            .git_exclude(config.file_picker.git_exclude)
+            .ignore(config.path_completer.ignore)
+            .git_ignore(config.path_completer.git_ignore)
+            .git_exclude(config.path_completer.git_exclude)
             .build()
             .filter_map(|file| {
                 file.ok().and_then(|entry| {
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs
index 20469ae9..94f16b5b 100644
--- a/helix-view/src/editor.rs
+++ b/helix-view/src/editor.rs
@@ -260,6 +260,8 @@ pub struct Config {
     /// Whether to display infoboxes. Defaults to true.
     pub auto_info: bool,
     pub file_picker: FilePickerConfig,
+    // we don't use all the fields of FilePickerConfig
+    pub path_completer: FilePickerConfig,
     /// Configuration of the statusline elements
     pub statusline: StatusLineConfig,
     /// Shape for cursor in each mode
@@ -801,6 +803,12 @@ fn default() -> Self {
             completion_trigger_len: 2,
             auto_info: true,
             file_picker: FilePickerConfig::default(),
+            path_completer: FilePickerConfig {
+                ignore: false,
+                git_ignore: false,
+                git_exclude: false,
+                ..Default::default()
+            },
             statusline: StatusLineConfig::default(),
             cursor_shape: CursorShapeConfig::default(),
             true_color: false,

@sigmaSd

sigmaSd commented Jul 24, 2023

Copy link
Copy Markdown
Contributor Author

If BurntSushi/ripgrep#2566 lands, this PR wont be needed

@sigmaSd

sigmaSd commented Sep 4, 2023

Copy link
Copy Markdown
Contributor Author

It would be great if this get reviewd, the PR on ripgrep seems to take a while

The motivation is with nucleo space f have no lag but using :o is basically impossible an my old PC, at least with this option I can fix it

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.

1 participant