From 8a75a7ba1b7fbbbdffbd35a35e04fb0b0569b1d7 Mon Sep 17 00:00:00 2001 From: Steven Arcangeli Date: Sat, 4 Dec 2021 12:16:34 -0800 Subject: [PATCH] refactor: replace call to vim.fn with pcall --- lua/dressing/select/builtin.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lua/dressing/select/builtin.lua b/lua/dressing/select/builtin.lua index 563c8c8..c9ec2d5 100644 --- a/lua/dressing/select/builtin.lua +++ b/lua/dressing/select/builtin.lua @@ -41,9 +41,7 @@ M.select = function(config, items, opts, on_choice) local winnr = vim.api.nvim_open_win(bufnr, true, winopt) vim.api.nvim_win_set_option(winnr, "winblend", config.winblend) vim.api.nvim_win_set_option(winnr, "cursorline", true) - if vim.fn.exists("&cursorlineopt") ~= 0 then - vim.api.nvim_win_set_option(winnr, "cursorlineopt", "both") - end + pcall(vim.api.nvim_win_set_option, winnr, "cursorlineopt", "both") local function map(lhs, rhs) vim.api.nvim_buf_set_keymap(bufnr, "n", lhs, rhs, { silent = true, noremap = true })