Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make filename_impl walker configurable #7716

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sigmaSd
Copy link
Contributor

@sigmaSd sigmaSd commented Jul 22, 2023

ref #7715

couple of notes:

@sigmaSd
Copy link
Contributor Author

sigmaSd commented Jul 22, 2023

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
Copy link
Contributor Author

sigmaSd commented Jul 24, 2023

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

@sigmaSd
Copy link
Contributor Author

sigmaSd commented Sep 4, 2023

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.

None yet

1 participant