diff --git a/doc/lualine.txt b/doc/lualine.txt index b2a451c..dc26c80 100644 --- a/doc/lualine.txt +++ b/doc/lualine.txt @@ -459,7 +459,9 @@ Component specific options These are options that are available on mode = 0, -- 0: Shows buffer name -- 1: Shows buffer index - -- 2: Shows buffer name + buffer index + -- 2: Shows buffer name + buffer index + -- 3: Shows buffer number + -- 4: Shows buffer name + buffer number max_length = vim.o.columns * 2 / 3, -- Maximum width of buffers component, -- it can also be a function that returns @@ -477,6 +479,12 @@ Component specific options These are options that are available on active = 'lualine_{section}_normal', -- Color for active buffer. inactive = 'lualine_{section}_inactive', -- Color for inactive buffer. }, + + symbols = { + modified = ' ●' -- Text to show when the buffer is modified + alternate_file = '#', -- Text to show to indify the alternate file + directory = '', -- Text to show when the buffer is a directory + }, } } } diff --git a/lua/lualine/components/buffers/buffer.lua b/lua/lualine/components/buffers/buffer.lua index 613a140..bda0b8e 100644 --- a/lua/lualine/components/buffers/buffer.lua +++ b/lua/lualine/components/buffers/buffer.lua @@ -171,7 +171,14 @@ function Buffer:apply_mode(name) end if self.options.mode == 2 then - return string.format('%s%s %s%s%s', self.alternate_file_icon, self.buf_index or '', self.icon, name, self.modified_icon) + return string.format( + '%s%s %s%s%s', + self.alternate_file_icon, + self.buf_index or '', + self.icon, + name, + self.modified_icon + ) end if self.options.mode == 3 then @@ -180,7 +187,6 @@ function Buffer:apply_mode(name) -- if self.options.mode == 4 then return string.format('%s%s %s%s%s', self.alternate_file_icon, self.bufnr or '', self.icon, name, self.modified_icon) - end return Buffer diff --git a/lua/lualine/components/buffers/init.lua b/lua/lualine/components/buffers/init.lua index f427c9e..955d1d6 100644 --- a/lua/lualine/components/buffers/init.lua +++ b/lua/lualine/components/buffers/init.lua @@ -25,8 +25,8 @@ local default_options = { symbols = { modified = ' ●', alternate_file = '#', - directory = '', - } + directory = '', + }, } -- This function is duplicated in tabs