summaryrefslogtreecommitdiff
path: root/lua/lvim/core/lualine/components.lua
diff options
context:
space:
mode:
authorkylo252 <[email protected]>2021-10-24 08:37:02 +0200
committerkylo252 <[email protected]>2021-10-24 08:37:02 +0200
commit1f2167df0ea3f837c9c78a0137a888ca05e5e83a (patch)
tree6fd46809d7dd4ff7fffae00b257579397de793cd /lua/lvim/core/lualine/components.lua
parent30de3736baec9a72134205de91f3388e3ea68bcf (diff)
parent3dd60bd3d4165b14844a514d519f3810b8142a02 (diff)
Merge remote-tracking branch 'origin/rolling'
Diffstat (limited to 'lua/lvim/core/lualine/components.lua')
-rw-r--r--lua/lvim/core/lualine/components.lua9
1 files changed, 6 insertions, 3 deletions
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 = {},