diff options
| author | Simon Hauser <Simon-Hauser@outlook.de> | 2022-05-22 12:53:37 +0200 |
|---|---|---|
| committer | Simon Hauser <simon.hauser@helsinki-systems.de> | 2022-06-30 14:01:49 +0200 |
| commit | 83b6cadb2c61b6eee6a8f0ec8bb4599c89b6ab57 (patch) | |
| tree | 9e33acbc68a154e2ddb1fca34cfa87f6f80b2904 /lua/telescope/actions/init.lua | |
| parent | a1aec79cb1abc5630f941bafbe83f6e00dcff316 (diff) | |
break: deprecate utils.get_default utils.if_nil (#1545)
Diffstat (limited to 'lua/telescope/actions/init.lua')
| -rw-r--r-- | lua/telescope/actions/init.lua | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/lua/telescope/actions/init.lua b/lua/telescope/actions/init.lua index 2c4624b..0413f33 100644 --- a/lua/telescope/actions/init.lua +++ b/lua/telescope/actions/init.lua @@ -1059,22 +1059,22 @@ end ---@param prompt_bufnr number: The prompt bufnr actions.which_key = function(prompt_bufnr, opts) opts = opts or {} - opts.max_height = utils.get_default(opts.max_height, 0.4) - opts.only_show_current_mode = utils.get_default(opts.only_show_current_mode, true) - opts.mode_width = utils.get_default(opts.mode_width, 1) - opts.keybind_width = utils.get_default(opts.keybind_width, 7) - opts.name_width = utils.get_default(opts.name_width, 30) - opts.line_padding = utils.get_default(opts.line_padding, 1) - opts.separator = utils.get_default(opts.separator, " -> ") - opts.close_with_action = utils.get_default(opts.close_with_action, true) - opts.normal_hl = utils.get_default(opts.normal_hl, "TelescopePrompt") - opts.border_hl = utils.get_default(opts.border_hl, "TelescopePromptBorder") - opts.winblend = utils.get_default(opts.winblend, config.values.winblend) - opts.column_padding = utils.get_default(opts.column_padding, " ") + opts.max_height = vim.F.if_nil(opts.max_height, 0.4) + opts.only_show_current_mode = vim.F.if_nil(opts.only_show_current_mode, true) + opts.mode_width = vim.F.if_nil(opts.mode_width, 1) + opts.keybind_width = vim.F.if_nil(opts.keybind_width, 7) + opts.name_width = vim.F.if_nil(opts.name_width, 30) + opts.line_padding = vim.F.if_nil(opts.line_padding, 1) + opts.separator = vim.F.if_nil(opts.separator, " -> ") + opts.close_with_action = vim.F.if_nil(opts.close_with_action, true) + opts.normal_hl = vim.F.if_nil(opts.normal_hl, "TelescopePrompt") + opts.border_hl = vim.F.if_nil(opts.border_hl, "TelescopePromptBorder") + opts.winblend = vim.F.if_nil(opts.winblend, config.values.winblend) + opts.column_padding = vim.F.if_nil(opts.column_padding, " ") -- Assigning into 'opts.column_indent' would override a number with a string and -- cause issues with subsequent calls, keep a local copy of the string instead - local column_indent = table.concat(utils.repeated_table(utils.get_default(opts.column_indent, 4), " ")) + local column_indent = table.concat(utils.repeated_table(vim.F.if_nil(opts.column_indent, 4), " ")) -- close on repeated keypress local km_bufs = (function() @@ -1111,9 +1111,9 @@ actions.which_key = function(prompt_bufnr, opts) local make_display = function(mapping) return displayer { - { mapping.mode, utils.get_default(opts.mode_hl, "TelescopeResultsConstant") }, - { mapping.keybind, utils.get_default(opts.keybind_hl, "TelescopeResultsVariable") }, - { mapping.name, utils.get_default(opts.name_hl, "TelescopeResultsFunction") }, + { mapping.mode, vim.F.if_nil(opts.mode_hl, "TelescopeResultsConstant") }, + { mapping.keybind, vim.F.if_nil(opts.keybind_hl, "TelescopeResultsVariable") }, + { mapping.name, vim.F.if_nil(opts.name_hl, "TelescopeResultsFunction") }, } end |
