Skip to content

Commit

Permalink
fix(hyper): handle backslash and slash regardles of os in cwd (#463)
Browse files Browse the repository at this point in the history
* fix(hyper): use backslash when user has shellslash enabled on windows

* fix: test wit use explicitly

* fix: handle backslash and slash regardless of os

* fix(hyper): use correct matching method

* fix(hyper): extract sep from mlist
  • Loading branch information
adriankarlen authored Jun 23, 2024
1 parent b88c997 commit f10a18e
Showing 1 changed file with 5 additions and 4 deletions.
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

0 comments on commit f10a18e

Please sign in to comment.