Skip to content

Commit

Permalink
fix(moveToFolderInCwd): add cwd itself also to the list of folders
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgrieser committed Feb 11, 2024
1 parent adf2e8c commit b84accb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/genghis/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ function M.moveToFolderInCwd()
or fullPath == currentFolderOfFile
return not ignoreDirs
end, { type = "directory", limit = math.huge })
table.insert(subfoldersOfCwd, vim.loop.cwd() .. "/")

-- sort by modification time
table.sort(subfoldersOfCwd, function(a, b)
Expand All @@ -151,7 +152,7 @@ function M.moveToFolderInCwd()
vim.ui.select(subfoldersOfCwd, {
prompt = promptStr,
kind = "genghis.moveToFolderInCwd",
format_item = function(path) return path:sub(#vim.loop.cwd() + 2) end, -- only relative path
format_item = function(path) return path:sub(#vim.loop.cwd() + 1) end, -- only relative path
}, function(destination)
if not destination then return end
local newFilePath = destination .. "/" .. filename
Expand Down

0 comments on commit b84accb

Please sign in to comment.