local H={}function H.set_indent(H,A)if A==nil then A=vim.o end A.tabstop=H A.softtabstop=H A.shiftwidth=H end function H.get_buf_file_size(H)H=H or 0 local A=vim.api.nvim_buf_get_name(H)if not A then return 0 end local K=vim.loop.fs_stat(A,nil)if not K then return 0 end return K.size end function H.refresh_statusline()local H=package.loaded.lualine if H then H.refresh({place={"\115\116\097\116\117\115\108\105\110\101"}})end end return H
-- This module contains various utils

local M = {}

function M.set_indent(length, obj)
  if obj == nil then
    obj = vim.o
  end

  -- tab length
  -- https://neovim.io/doc/user/options.html#'tabstop'
  obj.tabstop = length

  -- tab length on editing operations
  -- https://neovim.io/doc/user/options.html#'softtabstop'
  obj.softtabstop = length

  -- used for autoindent
  -- https://neovim.io/doc/user/options.html#'shiftwidth'
  obj.shiftwidth = length
end

function M.get_buf_file_size(bufnr)
  bufnr = bufnr or 0

  local buf_name = vim.api.nvim_buf_get_name(bufnr)
  if not buf_name then
    return 0
  end

  local stat = vim.loop.fs_stat(buf_name, nil)
  if not stat then
    return 0
  end

  return stat.size
end

function M.refresh_statusline()
  local lualine = package.loaded["lualine"]

  if lualine then
    lualine.refresh({
      place = { "statusline" },
    })
  end
end

return M
