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:
parent
619ededcff
commit
180f5de5b8
|
@ -550,6 +550,7 @@ sections = {
|
||||||
path = 0, -- 0: Just the filename
|
path = 0, -- 0: Just the filename
|
||||||
-- 1: Relative path
|
-- 1: Relative path
|
||||||
-- 2: Absolute 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
|
shorting_target = 40, -- Shortens path to leave 40 spaces in the window
|
||||||
-- for other components. (terrible name, any suggestions?)
|
-- for other components. (terrible name, any suggestions?)
|
||||||
|
|
|
@ -43,6 +43,9 @@ M.update_status = function(self)
|
||||||
elseif self.options.path == 2 then
|
elseif self.options.path == 2 then
|
||||||
-- absolute path
|
-- absolute path
|
||||||
data = vim.fn.expand('%:p')
|
data = vim.fn.expand('%:p')
|
||||||
|
elseif self.options.path == 3 then
|
||||||
|
-- absolute path, with tilde
|
||||||
|
data = vim.fn.expand('%:p:~')
|
||||||
else
|
else
|
||||||
-- just filename
|
-- just filename
|
||||||
data = vim.fn.expand('%:t')
|
data = vim.fn.expand('%:t')
|
||||||
|
|
Loading…
Reference in New Issue