diff options
author | kylo252 <[email protected]> | 2022-10-17 17:29:15 +0200 |
---|---|---|
committer | kylo252 <[email protected]> | 2022-10-17 17:29:15 +0200 |
commit | 4ef07315003f723bb8e97d5a91b2bde3773ec1b8 (patch) | |
tree | e9889a492f76e3f9573228343aaba647dfd48136 /lua/lvim/utils/functions.lua | |
parent | e4a5fe97abe500bbbe78fb137d57a59f558da05a (diff) | |
parent | 6f6cbc394d2a7e64964b6067a2f42d2e6a07824e (diff) |
Merge remote-tracking branch 'origin/rolling'
Diffstat (limited to 'lua/lvim/utils/functions.lua')
-rw-r--r-- | lua/lvim/utils/functions.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lua/lvim/utils/functions.lua b/lua/lvim/utils/functions.lua index de46bc8a..1cb8ec8e 100644 --- a/lua/lvim/utils/functions.lua +++ b/lua/lvim/utils/functions.lua @@ -16,4 +16,17 @@ function M.smart_quit() end end +function M.isempty(s) + return s == nil or s == "" +end + +function M.get_buf_option(opt) + local status_ok, buf_option = pcall(vim.api.nvim_buf_get_option, 0, opt) + if not status_ok then + return nil + else + return buf_option + end +end + return M |