From e5f00bfb1e3b3853985f5ba9ce0d18e9fc250922 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 17 Jan 2024 18:53:40 +0000 Subject: [PATCH 1/3] fix(deps): update rust crate rayon to 1.8.1 --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c0bfc9e..60d34ec 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -429,9 +429,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" dependencies = [ "either", "rayon-core", @@ -439,9 +439,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.12.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ "crossbeam-deque", "crossbeam-utils", diff --git a/Cargo.toml b/Cargo.toml index 5bc417c..cf70aca 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ path = "rust/lib.rs" [dependencies] ignore = "0.4.22" fuzzy-matcher = "0.3.7" -rayon = "1.8.0" +rayon = "1.8.1" [dev-dependencies] criterion = "0.5.1" From c32698cf254b9f358f7b06ad02c95545aae6d0d7 Mon Sep 17 00:00:00 2001 From: Ade Attwood Date: Wed, 17 Jan 2024 21:11:12 +0000 Subject: [PATCH 2/3] feat: don't search in sapling source control directories This file should be treated as the .git dir and not show up in the candidates list for files. --- rust/finder.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/rust/finder.rs b/rust/finder.rs index 2e577c6..f3baa97 100644 --- a/rust/finder.rs +++ b/rust/finder.rs @@ -20,6 +20,7 @@ pub fn find_files(options: Options) -> Vec { // is no way to handel errors in the rust library let mut override_builder = OverrideBuilder::new(""); override_builder.add("!.git").unwrap(); + override_builder.add("!.sl").unwrap(); let overrides = override_builder.build().unwrap(); builder.overrides(overrides); From dc7f6815fb6020da193e5765ec16c04954ddb730 Mon Sep 17 00:00:00 2001 From: Ade Attwood Date: Tue, 13 Feb 2024 09:19:05 +0000 Subject: [PATCH 3/3] fix: opening file with square brackets in them Summary: Fixes an issue where you could not open files that were already open with ivy. If the file path contains a square brackets and that file is already loaded into a buffer, ivy will throw an error when trying to open it via "files" or "buffers". This is an issue with the file escaping before we try and cal `buffer` passing in the file path to go to the buffer rather than open a new buffer. This is common with JS frameworks like next js for parameters in file based routing. Test Plan: Test have been added for this change. I have also added tests for the dollar that was previously handled. --- lua/ivy/utils.lua | 3 ++- lua/ivy/utils_escape_test.lua | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 lua/ivy/utils_escape_test.lua diff --git a/lua/ivy/utils.lua b/lua/ivy/utils.lua index 92f74e0..910e57f 100644 --- a/lua/ivy/utils.lua +++ b/lua/ivy/utils.lua @@ -104,7 +104,8 @@ utils.line_action = function() end utils.escape_file_name = function(input) - return string.gsub(input, "([$])", "\\%1") + local file, _ = string.gsub(input, "([$%]\\[])", "\\%1") + return file end return utils diff --git a/lua/ivy/utils_escape_test.lua b/lua/ivy/utils_escape_test.lua new file mode 100644 index 0000000..ebe41d2 --- /dev/null +++ b/lua/ivy/utils_escape_test.lua @@ -0,0 +1,11 @@ +local utils = require "ivy.utils" + +it("will escape a dollar in the file name", function(t) + local result = utils.escape_file_name "/path/to/$file/$name.lua" + t.assert_equal(result, "/path/to/\\$file/\\$name.lua") +end) + +it("will escape a brackets in the file name", function(t) + local result = utils.escape_file_name "/path/to/[file]/[name].lua" + t.assert_equal(result, "/path/to/\\[file\\]/\\[name\\].lua") +end)