@@ -187,8 +187,10 @@ local function mru_list(config)
187187 local filename = vim .fn .fnamemodify (file , ' :t' )
188188 local icon , group = utils .get_icon (filename )
189189 icon = icon or ' '
190- if not utils .is_win then
191- file = file :gsub (vim .env .HOME , ' ~' )
190+ if config .mru .cwd_only then
191+ file = vim .fn .fnamemodify (file , ' :.' )
192+ elseif not utils .is_win then
193+ file = vim .fn .fnamemodify (file , ' :~' )
192194 end
193195 file = icon .. ' ' .. file
194196 table.insert (groups , { # icon , group })
279281local function map_key (config , key , content )
280282 keymap .set (' n' , key , function ()
281283 local text = content or api .nvim_get_current_line ()
282- local scol = utils .is_win and text :find (' %w' ) or text :find (' %p' )
283- text = text :sub (scol )
284+
285+ if config .mru .cwd_only then
286+ local scol = text :find (' %w' )
287+ text = text :sub (scol )
288+ else
289+ local scol = utils .is_win and text :find (' %w' ) or text :find (' %p' )
290+ text = text :sub (scol )
291+ end
292+
284293 local path = text :sub (1 , text :find (' %w(%s+)$' ))
285294 path = vim .fs .normalize (path )
286295 if vim .fn .isdirectory (path ) == 1 then
0 commit comments