feat(filename): add unnamed option (#496)
* feat(filename): add unnamed option * docs(filename): add documentation for symbols
This commit is contained in:
parent
c4a09735a6
commit
d02658b34d
|
@ -505,8 +505,13 @@ sections = {
|
||||||
'filename',
|
'filename',
|
||||||
file_status = true, -- displays file status (readonly status, modified status)
|
file_status = true, -- displays file status (readonly status, modified status)
|
||||||
path = 0, -- 0 = just filename, 1 = relative path, 2 = absolute path
|
path = 0, -- 0 = just filename, 1 = relative path, 2 = absolute path
|
||||||
shorting_target = 40 -- Shortens path to leave 40 space in the window
|
shorting_target = 40, -- Shortens path to leave 40 space in the window
|
||||||
-- for other components. Terrible name any suggestions?
|
-- for other components. Terrible name any suggestions?
|
||||||
|
symbols = {
|
||||||
|
modified = '[+]', -- when the file was modified
|
||||||
|
readonly = '[-]', -- if the file is not modifiable or readonly
|
||||||
|
unnamed = '[No Name]', -- default display name for unnamed buffers
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -532,8 +532,13 @@ Component specific options These are options that are available on
|
||||||
'filename',
|
'filename',
|
||||||
file_status = true, -- displays file status (readonly status, modified status)
|
file_status = true, -- displays file status (readonly status, modified status)
|
||||||
path = 0, -- 0 = just filename, 1 = relative path, 2 = absolute path
|
path = 0, -- 0 = just filename, 1 = relative path, 2 = absolute path
|
||||||
shorting_target = 40 -- Shortens path to leave 40 space in the window
|
shorting_target = 40, -- Shortens path to leave 40 space in the window
|
||||||
-- for other components. Terrible name any suggestions?
|
-- for other components. Terrible name any suggestions?
|
||||||
|
symbols = {
|
||||||
|
modified = '[+]', -- when the file was modified
|
||||||
|
readonly = '[-]', -- if the file is not modifiable or readonly
|
||||||
|
unnamed = '[No Name]', -- default display name for unnamed buffers
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
local M = require('lualine.component'):extend()
|
local M = require('lualine.component'):extend()
|
||||||
|
|
||||||
local default_options = {
|
local default_options = {
|
||||||
symbols = { modified = '[+]', readonly = '[-]' },
|
symbols = { modified = '[+]', readonly = '[-]', unnamed = '[No Name]' },
|
||||||
file_status = true,
|
file_status = true,
|
||||||
path = 0,
|
path = 0,
|
||||||
shorting_target = 40,
|
shorting_target = 40,
|
||||||
|
@ -45,7 +45,7 @@ M.update_status = function(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
if data == '' then
|
if data == '' then
|
||||||
data = '[No Name]'
|
data = self.options.symbols.unnamed
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.options.shorting_target ~= 0 then
|
if self.options.shorting_target ~= 0 then
|
||||||
|
|
Loading…
Reference in New Issue