diff --git a/lua/cmp/utils/options.lua b/lua/cmp/utils/options.lua index 253b475..076dbba 100644 --- a/lua/cmp/utils/options.lua +++ b/lua/cmp/utils/options.lua @@ -7,7 +7,11 @@ local M = {} M.win_set_option = function(window, name, value) local eventignore = vim.opt.eventignore:get() vim.opt.eventignore:append('OptionSet') - vim.api.nvim_win_set_option(window, name, value) + if vim.fn.has("nvim-0.10") == 1 then + vim.api.nvim_set_option_value(name, value, { win = window } ) + else + vim.api.nvim_win_set_option(window, name, value) + end vim.opt.eventignore = eventignore end diff --git a/lua/cmp/view/custom_entries_view.lua b/lua/cmp/view/custom_entries_view.lua index 3ac2a06..3ee069c 100644 --- a/lua/cmp/view/custom_entries_view.lua +++ b/lua/cmp/view/custom_entries_view.lua @@ -166,7 +166,7 @@ custom_entries_view.open = function(self, offset, entries) else vim.api.nvim_buf_set_lines(entries_buf, 0, -1, false, lines) end - if vim.fn.has('nvim-0.10') then + if vim.fn.has('nvim-0.10') == 1 then vim.api.nvim_set_option_value('modified', false, { buf = entries_buf }) else vim.api.nvim_buf_set_option(entries_buf, 'modified', false) @@ -311,7 +311,7 @@ custom_entries_view.draw = function(self) vim.api.nvim_buf_set_lines(entries_buf, topline, botline, false, texts) end - if vim.fn.has('nvim-0.10') then + if vim.fn.has('nvim-0.10') == 1 then vim.api.nvim_set_option_value('modified', false, { buf = entries_buf }) else vim.api.nvim_buf_set_option(entries_buf, 'modified', false) diff --git a/lua/cmp/view/wildmenu_entries_view.lua b/lua/cmp/view/wildmenu_entries_view.lua index 07c92d5..ac7ef87 100644 --- a/lua/cmp/view/wildmenu_entries_view.lua +++ b/lua/cmp/view/wildmenu_entries_view.lua @@ -164,7 +164,7 @@ wildmenu_entries_view.draw = function(self) end vim.api.nvim_buf_set_lines(entries_buf, 0, 1, false, { table.concat(texts, self:_get_separator()) }) - if vim.fn.has('nvim-0.10') then + if vim.fn.has('nvim-0.10') == 1 then vim.api.nvim_set_option_value('modified', false, { buf = entries_buf }) else vim.api.nvim_buf_set_option(entries_buf, 'modified', false)