Fix bug where empty string causes empty libmodal name

This commit is contained in:
Iron-E 2020-11-18 15:56:16 -05:00
parent c9dd739eb0
commit d00feb0ad3
No known key found for this signature in database
GPG Key ID: 19B71B7B7B021D22

View File

@ -252,7 +252,11 @@ function _metaMode:_tearDown()
end
if vim.g then -- this step requires 0.5
vim.g.libmodalActiveModeName = self._previousModeName
if self._previousModeName and #vim.trim(self._previousModeName) < 1 then
vim.g.libmodalActiveModeName = nil
else
vim.g.libmodalActiveModeName = self._previousModeName
end
end
self._winState:restore()