Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(hyper): handle backslash and slash regardles of os in cwd #463

Merged
merged 5 commits into from
Jun 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions lua/dashboard/theme/hyper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,12 @@ local function mru_list(config)

if config.mru.cwd_only then
local cwd = uv.cwd()
local sep = utils.is_win and '\\' or '/'
local cwd_with_sep = cwd .. sep
-- get separator from the first file
local sep = mlist[1]:match('[\\/]')
local cwd_with_sep = cwd:gsub('[\\/]', sep) .. sep
mlist = vim.tbl_filter(function(file)
local file_dir = vim.fn.fnamemodify(file, ':p:h') .. sep
if file_dir and cwd then
local file_dir = vim.fn.fnamemodify(file, ':p:h')
if file_dir and cwd_with_sep then
return file_dir:sub(1, #cwd_with_sep) == cwd_with_sep
end
end, mlist)
Expand Down
Loading