From ac05f165e9ce92921b0f14c148681260a9be6503 Mon Sep 17 00:00:00 2001 From: Christoph Bier Date: Sun, 12 May 2024 20:30:53 +0200 Subject: [PATCH] fix(builtin.oldfiles): fix cwd_only for windows (#3096) Remove backslash escaping in oldfiles picker, which was needed before the code was changed to use substring comparison instead of regex matching. (Commit b3ff5f33) (cherry picked from commit 02a60a83961cf9c80e471599171982a31d1cc853) --- lua/telescope/builtin/__internal.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/telescope/builtin/__internal.lua b/lua/telescope/builtin/__internal.lua index 71fa107..c209a65 100644 --- a/lua/telescope/builtin/__internal.lua +++ b/lua/telescope/builtin/__internal.lua @@ -543,9 +543,9 @@ internal.oldfiles = function(opts) end end - if opts.cwd_only then - local cwd = vim.loop.cwd() .. utils.get_separator() - cwd = cwd:gsub([[\]], [[\\]]) + if opts.cwd_only or opts.cwd then + local cwd = opts.cwd_only and vim.loop.cwd() or opts.cwd + cwd = cwd .. utils.get_separator() results = vim.tbl_filter(function(file) return buf_in_cwd(file, cwd) end, results)