aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/nvim/lua/mytelescopefiles.lua9
m---------private0
2 files changed, 7 insertions, 2 deletions
diff --git a/config/nvim/lua/mytelescopefiles.lua b/config/nvim/lua/mytelescopefiles.lua
index 733a1d8..2a98505 100644
--- a/config/nvim/lua/mytelescopefiles.lua
+++ b/config/nvim/lua/mytelescopefiles.lua
@@ -2,10 +2,15 @@ local ts = require("telescope.builtin")
local utils = require("telescope.utils")
return function()
- local root, ret = utils.get_os_command_output({ "git", "rev-parse", "--show-toplevel" }, vim.fn.expand("%:h"))
+ local dir = vim.fn.expand("%:h")
+ if dir == "" or not vim.fn.exists(dir) then
+ dir = vim.fn.getcwd()
+ end
+ local root, ret = utils.get_os_command_output({ "git", "rev-parse", "--show-toplevel" }, dir)
+ root = root[1]
if ret == 0 then
ts.git_files({
- cwd = root[1],
+ cwd = root,
git_command = {
"sh",
"-c",
diff --git a/private b/private
-Subproject b6ba779e4a9da9325df5e57e2a1898d150171c9
+Subproject b0c7e860ee85a97ff0939f16b34574b753a6bb8