nvim-libmodal/lua/libmodal/utils/init.lua
Iron-E 485b77bf14
fix(mode): incompatible with vim.v.count (#26)
* fix(mode): incompatible with vim.v.count

* ref(Vars): track local copy of global value

* ref(Mode): use new `Vars`

* ref(Mode): handle exit during `enter`

* ref: swap `Var.new` param order

Mode name should come before var name

* docs(examples): Vars

* ref: rename `Vars` -> `Var`

* fix(Mode): check if `exit == 1` for vim compat

* fix(Prompt): use new `Var` impl

* ref: remove `count1`

It seems like `math.max` is enough for this purpose

* doc: use h3 headers
2024-03-12 16:04:16 +00:00

29 lines
787 B
Lua

--- @class libmodal.utils
--- @field api libmodal.utils.api
--- @field classes libmodal.utils.classes
--- @field Help libmodal.utils.Help
--- @field Popup libmodal.utils.Popup
--- @field Var libmodal.utils.Var
local utils =
{
api = require 'libmodal.utils.api',
classes = require 'libmodal.utils.classes',
Help = require 'libmodal.utils.Help',
Popup = require 'libmodal.utils.Popup',
Var = require 'libmodal.utils.Var',
}
--- `vim.notify` with a `msg` some `error` which has a `vim.v.throwpoint` and `vim.v.exception`.
--- @param msg string
--- @param err string
--- @return nil
function utils.notify_error(msg, err)
vim.notify(
msg .. ': ' .. vim.v.throwpoint .. '\n' .. vim.v.exception .. '\n' .. err,
vim.log.levels.ERROR,
{title = 'nvim-libmodal'}
)
end
return utils