File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -190,14 +190,13 @@ local function mru_list(config)
190190
191191 if config .mru .cwd_only then
192192 local cwd = uv .cwd ()
193- -- get separator from the first file
194- local sep = mlist [1 ]:match (' [\\ /]' )
195- local cwd_with_sep = cwd :gsub (' [\\ /]' , sep ) .. sep
193+ -- Normalize both paths to use forward slashes
194+ cwd = vim .fn .fnamemodify (cwd , ' :p' )
196195 mlist = vim .tbl_filter (function (file )
197- local file_dir = vim .fn .fnamemodify (file , ' :p:h ' )
198- if file_dir and cwd_with_sep then
199- return file_dir : sub ( 1 , # cwd_with_sep ) == cwd_with_sep
200- end
196+ local file_path = vim .fn .fnamemodify (file , ' :p' )
197+ local file_dir = vim . fn . fnamemodify ( file_path , ' :h ' ) .. ' / '
198+ -- Ensure both paths end with separator and are normalized
199+ return file_dir : sub ( 1 , # cwd ) == cwd
201200 end , mlist )
202201 end
203202
You can’t perform that action at this time.
0 commit comments