From 20e5e507973362016381538aab3091fc0f63ef03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Preu=C3=9F?= Date: Fri, 22 Oct 2021 13:03:48 +0200 Subject: fix(lualine): use tabstop in spaces component when sensible (#1807) --- lua/lvim/core/lualine/components.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lua/lvim/core') diff --git a/lua/lvim/core/lualine/components.lua b/lua/lvim/core/lualine/components.lua index b10fdad9..9366df56 100644 --- a/lua/lvim/core/lualine/components.lua +++ b/lua/lvim/core/lualine/components.lua @@ -122,11 +122,14 @@ return { progress = { "progress", cond = conditions.hide_in_width, color = {} }, spaces = { function() - local label = "Spaces: " if not vim.api.nvim_buf_get_option(0, "expandtab") then - label = "Tab size: " + return "Tab size: " .. vim.api.nvim_buf_get_option(0, "tabstop") .. " " end - return label .. vim.api.nvim_buf_get_option(0, "shiftwidth") .. " " + local size = vim.api.nvim_buf_get_option(0, "shiftwidth") + if size == 0 then + size = vim.api.nvim_buf_get_option(0, "tabstop") + end + return "Spaces: " .. size .. " " end, cond = conditions.hide_in_width, color = {}, -- cgit v1.2.3