summaryrefslogtreecommitdiff
path: root/stowables-dotlocal/share/nvim/site/pack/manual/start/nvim-cmp-v0.0.1/lua/cmp/utils/debug.lua
blob: c8b0dba16e5e11a43f25d24ec1919940c4ec0d35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
local debug = {}

debug.flag = false

---Print log
---@vararg any
debug.log = function(...)
  if debug.flag then
    local data = {}
    for _, v in ipairs({ ... }) do
      if not vim.tbl_contains({ 'string', 'number', 'boolean' }, type(v)) then
        v = vim.inspect(v)
      end
      table.insert(data, v)
    end
    print(table.concat(data, '\t'))
  end
end

return debug