From fad0842b7679a8f010b2991bd987a8b0ee07642f Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Mon, 29 Sep 2025 15:17:58 +0200 Subject: [PATCH] nvim/lua/user/utils/indent.lua: document parameters and minor updates --- nvim/lua/user/utils/indent.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nvim/lua/user/utils/indent.lua b/nvim/lua/user/utils/indent.lua index 86c677f..7bc00fd 100644 --- a/nvim/lua/user/utils/indent.lua +++ b/nvim/lua/user/utils/indent.lua @@ -1,15 +1,18 @@ local M = {} +---@param width number? function M.setHardtabs(width) width = width or 8 vim.cmd(string.format("setlocal noet ts=%s sts=0 sw=0", width)) end ---@param width number +---@param isLocal boolean? function M.setSofttabs(width, isLocal) - isLocal = (isLocal or false) and "local" or "" - vim.cmd(string.format("set%s et ts=%s sts=0 sw=%s", isLocal, width, width)) + isLocal = isLocal or false + vim.cmd(string.format("set%s et ts=%s sts=0 sw=%s", + isLocal and "local" or "", width, width)) end return M