diff options
author | TJ DeVries <devries.timothyj@gmail.com> | 2021-06-29 09:18:59 -0400 |
---|---|---|
committer | TJ DeVries <devries.timothyj@gmail.com> | 2021-06-29 09:18:59 -0400 |
commit | 19b7cef0a7dc52f3ec016e0dd0ae82f0f6ecd4b1 (patch) | |
tree | 43f8c5f346c3b6560fe4a219ae63f56fd61ebe1f /runtime/lua/vim/_meta.lua | |
parent | 6ecec87c099ce6182b4a1cc81846be9e0e70c1cd (diff) | |
download | rneovim-19b7cef0a7dc52f3ec016e0dd0ae82f0f6ecd4b1.tar.gz rneovim-19b7cef0a7dc52f3ec016e0dd0ae82f0f6ecd4b1.tar.bz2 rneovim-19b7cef0a7dc52f3ec016e0dd0ae82f0f6ecd4b1.zip |
fix(vim.opt): Fix #14828 with empty values being incorrectly inserted
Diffstat (limited to 'runtime/lua/vim/_meta.lua')
-rw-r--r-- | runtime/lua/vim/_meta.lua | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/runtime/lua/vim/_meta.lua b/runtime/lua/vim/_meta.lua index 416746b2cc..b1f935541c 100644 --- a/runtime/lua/vim/_meta.lua +++ b/runtime/lua/vim/_meta.lua @@ -414,6 +414,12 @@ local convert_value_to_lua = (function() return value end + -- Empty strings mean that there is nothing there, + -- so empty table should be returned. + if value == '' then + return {} + end + -- Handles unescaped commas in a list. if string.find(value, ",,,") then local comma_split = vim.split(value, ",,,") @@ -451,6 +457,12 @@ local convert_value_to_lua = (function() [OptionTypes.SET] = function(info, value) if type(value) == "table" then return value end + -- Empty strings mean that there is nothing there, + -- so empty table should be returned. + if value == '' then + return {} + end + assert(info.flaglist, "That is the only one I know how to handle") if info.flaglist and info.commalist then |