From 33483ca6f2327ccc6e2e1bd367242ffef12764b2 Mon Sep 17 00:00:00 2001 From: Philipp Mildenberger Date: Wed, 1 Jun 2022 21:31:24 +0200 Subject: [PATCH] Fix PATH_REGEX for relative parent directories --- helix-term/src/commands.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index c58dc560a869..b9c0662f9d64 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -3962,7 +3962,7 @@ pub fn completion_path(cx: &mut Context) { let line_until_cursor = text.slice(begin_line..cursor).to_string(); // TODO find a good regex for most use cases (especially Windows, which is not yet covered...) // currently only one path match per line is possible in unix - static PATH_REGEX: Lazy = Lazy::new(|| Regex::new(r"((?:/|\./).*)$").unwrap()); + static PATH_REGEX: Lazy = Lazy::new(|| Regex::new(r"((?:\.{0,2}/)+.*)$").unwrap()); // TODO: trigger_offset should be the cursor offset but we also need a starting offset from where we want to apply // completion filtering. For example logger.te| should filter the initial suggestion list with "te".