Support tilde as home path in the absolute file paths (#676)

* Support tile as home path in the absolute file paths
This commit is contained in:
Jackson Cooper 2022-05-13 15:28:03 +10:00 committed by GitHub
parent 619ededcff
commit 180f5de5b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -550,6 +550,7 @@ sections = {
path = 0, -- 0: Just the filename
-- 1: Relative path
-- 2: Absolute path
-- 3: Absolute path, with tilde as the home directory
shorting_target = 40, -- Shortens path to leave 40 spaces in the window
-- for other components. (terrible name, any suggestions?)

View File

@ -43,6 +43,9 @@ M.update_status = function(self)
elseif self.options.path == 2 then
-- absolute path
data = vim.fn.expand('%:p')
elseif self.options.path == 3 then
-- absolute path, with tilde
data = vim.fn.expand('%:p:~')
else
-- just filename
data = vim.fn.expand('%:t')