Add an option to disable .gitignore when completing paths in the prompt

pull/11957/head
Ian Hobson 4 weeks ago
parent 101a74bf6e
commit ac8ebe739d

@ -31,6 +31,7 @@
| `cursorline` | Highlight all lines with a cursor | `false` | | `cursorline` | Highlight all lines with a cursor | `false` |
| `cursorcolumn` | Highlight all columns with a cursor | `false` | | `cursorcolumn` | Highlight all columns with a cursor | `false` |
| `gutters` | Gutters to display: Available are `diagnostics` and `diff` and `line-numbers` and `spacer`, note that `diagnostics` also includes other features like breakpoints, 1-width padding will be inserted if gutters is non-empty | `["diagnostics", "spacer", "line-numbers", "spacer", "diff"]` | | `gutters` | Gutters to display: Available are `diagnostics` and `diff` and `line-numbers` and `spacer`, note that `diagnostics` also includes other features like breakpoints, 1-width padding will be inserted if gutters is non-empty | `["diagnostics", "spacer", "line-numbers", "spacer", "diff"]` |
| `command-git-ignore` | Whether to read `.gitignore` when listing paths in the command prompt | `true` |
| `auto-completion` | Enable automatic pop up of auto-completion | `true` | | `auto-completion` | Enable automatic pop up of auto-completion | `true` |
| `auto-format` | Enable automatic formatting on save | `true` | | `auto-format` | Enable automatic formatting on save | `true` |
| `idle-timeout` | Time in milliseconds since last keypress before idle timers trigger. | `250` | | `idle-timeout` | Time in milliseconds since last keypress before idle timers trigger. | `250` |

@ -341,7 +341,7 @@ pub mod completers {
} }
pub fn filename(editor: &Editor, input: &str) -> Vec<Completion> { pub fn filename(editor: &Editor, input: &str) -> Vec<Completion> {
filename_with_git_ignore(editor, input, true) filename_with_git_ignore(editor, input, editor.config().command_git_ignore)
} }
pub fn filename_with_git_ignore( pub fn filename_with_git_ignore(
@ -392,7 +392,7 @@ pub mod completers {
} }
pub fn directory(editor: &Editor, input: &str) -> Vec<Completion> { pub fn directory(editor: &Editor, input: &str) -> Vec<Completion> {
directory_with_git_ignore(editor, input, true) directory_with_git_ignore(editor, input, editor.config().command_git_ignore)
} }
pub fn directory_with_git_ignore( pub fn directory_with_git_ignore(
@ -472,6 +472,8 @@ pub mod completers {
.hidden(false) .hidden(false)
.follow_links(false) // We're scanning over depth 1 .follow_links(false) // We're scanning over depth 1
.git_ignore(git_ignore) .git_ignore(git_ignore)
.git_global(git_ignore)
.git_exclude(git_ignore)
.max_depth(Some(1)) .max_depth(Some(1))
.build() .build()
.filter_map(|file| { .filter_map(|file| {

@ -259,6 +259,8 @@ pub struct Config {
pub cursorcolumn: bool, pub cursorcolumn: bool,
#[serde(deserialize_with = "deserialize_gutter_seq_or_struct")] #[serde(deserialize_with = "deserialize_gutter_seq_or_struct")]
pub gutters: GutterConfig, pub gutters: GutterConfig,
/// Whether .gitignore should be read when listing paths in the command prompt. Defaults to true.
pub command_git_ignore: bool,
/// Middle click paste support. Defaults to true. /// Middle click paste support. Defaults to true.
pub middle_click_paste: bool, pub middle_click_paste: bool,
/// Automatic insertion of pairs to parentheses, brackets, /// Automatic insertion of pairs to parentheses, brackets,
@ -944,6 +946,7 @@ impl Default for Config {
cursorline: false, cursorline: false,
cursorcolumn: false, cursorcolumn: false,
gutters: GutterConfig::default(), gutters: GutterConfig::default(),
command_git_ignore: true,
middle_click_paste: true, middle_click_paste: true,
auto_pairs: AutoPairConfig::default(), auto_pairs: AutoPairConfig::default(),
auto_completion: true, auto_completion: true,

Loading…
Cancel
Save