diff options
author | TJ DeVries <devries.timothyj@gmail.com> | 2021-05-28 08:24:48 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-28 17:24:48 +0200 |
commit | 43956dea55a49a847a0f2e5d9e0f48384cb34635 (patch) | |
tree | 673f3572cb43fab0f79302280bc03b6afc975bcd /runtime/lua/vim/F.lua | |
parent | 192ea01eddbc7508055f855f2afc4dd397d992b1 (diff) | |
download | rneovim-43956dea55a49a847a0f2e5d9e0f48384cb34635.tar.gz rneovim-43956dea55a49a847a0f2e5d9e0f48384cb34635.tar.bz2 rneovim-43956dea55a49a847a0f2e5d9e0f48384cb34635.zip |
lua: Add vim.opt and fix scopes of vim.o (#13479)
* lua: Add vim.opt
* fixup: cleaning
* fixup: comments
* ty clason
* fixup: comments
* this is the last commit. period.
Diffstat (limited to 'runtime/lua/vim/F.lua')
-rw-r--r-- | runtime/lua/vim/F.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/runtime/lua/vim/F.lua b/runtime/lua/vim/F.lua index 5887e978b9..7925ff6e44 100644 --- a/runtime/lua/vim/F.lua +++ b/runtime/lua/vim/F.lua @@ -20,5 +20,12 @@ function F.npcall(fn, ...) return F.ok_or_nil(pcall(fn, ...)) end +--- Wrap a function to return nil if it fails, otherwise the value +function F.nil_wrap(fn) + return function(...) + return F.npcall(fn, ...) + end +end + return F |