From 12a24c0eb37e575fe099ee9e2637b2dbc7552ae6 Mon Sep 17 00:00:00 2001 From: Hexin Date: Sat, 9 Oct 2021 15:18:18 +0900 Subject: [PATCH] Check whether option exists (#301) --- lua/cmp/utils/window.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/cmp/utils/window.lua b/lua/cmp/utils/window.lua index 9883b49..6c1cd4c 100644 --- a/lua/cmp/utils/window.lua +++ b/lua/cmp/utils/window.lua @@ -45,6 +45,10 @@ end ---@param key string ---@param value any window.option = function(self, key, value) + if vim.fn.exists('+' .. key) == 0 then + return + end + if value == nil then return self.opt[key] end