From c4043ebacd7cd2ba7f2454f378db5f4cd1be887d Mon Sep 17 00:00:00 2001 From: Philipp Oeschger Date: Mon, 16 Sep 2024 22:30:27 +0200 Subject: [PATCH] simplify --- lua/oil/util.lua | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lua/oil/util.lua b/lua/oil/util.lua index 57adc2b0..79d095cd 100644 --- a/lua/oil/util.lua +++ b/lua/oil/util.lua @@ -373,12 +373,7 @@ M.get_title = function(winid) path = fs.posix_to_os_path(path) if config.float.relative_win_title then - local cwd = vim.fn.getcwd() - title = vim.fn.fnamemodify(path, ":p") - - if title:sub(1, #cwd) == cwd then - title = title:gsub(cwd, ".", 1) - end + title = vim.fn.fnamemodify(path, ":p:~:.") else title = vim.fn.fnamemodify(path, ":~") end