From 402d8f1b6a7d46911de05843a458afeafe5dcd24 Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Fri, 11 Sep 2020 11:21:09 -0400 Subject: [PATCH] fix: make begin proff --- lua/telescope/init.lua | 4 ++++ lua/telescope/pickers.lua | 5 ++++- plugin/telescope.vim | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lua/telescope/init.lua b/lua/telescope/init.lua index c0a4e37..ecec931 100644 --- a/lua/telescope/init.lua +++ b/lua/telescope/init.lua @@ -44,6 +44,10 @@ require('telescope').setup { --]] function telescope.setup(opts) + if opts.default then + error("'default' is not a valid value for setup. See 'defaults'") + end + require('telescope.config').set_defaults(opts.defaults) end diff --git a/lua/telescope/pickers.lua b/lua/telescope/pickers.lua index 146cfa7..dae92dc 100644 --- a/lua/telescope/pickers.lua +++ b/lua/telescope/pickers.lua @@ -115,6 +115,7 @@ function Picker:new(opts) width = get_default(opts.width, config.values.width), get_preview_width = get_default(opts.preview_width, config.values.get_preview_width), results_width = get_default(opts.results_width, 0.8), + winblend = get_default(opts.winblend, config.values.winblend), prompt_position = get_default(opts.prompt_position, config.values.prompt_position), @@ -264,6 +265,7 @@ function Picker:find() -- TODO: Should probably always show all the line for results win, so should implement a resize for the windows a.nvim_win_set_option(results_win, 'wrap', false) a.nvim_win_set_option(results_win, 'winhl', 'Normal:TelescopeNormal') + a.nvim_win_set_option(results_win, 'winblend', self.window.winblend) local preview_win, preview_opts, preview_bufnr @@ -274,12 +276,13 @@ function Picker:find() -- TODO: For some reason, highlighting is kind of weird on these windows. -- It may actually be my colorscheme tho... a.nvim_win_set_option(preview_win, 'winhl', 'Normal:TelescopeNormal') - a.nvim_win_set_option(preview_win, 'winblend', config.values.winblend) + a.nvim_win_set_option(preview_win, 'winblend', self.window.winblend) end -- TODO: We need to center this and make it prettier... local prompt_win, prompt_opts = popup.create('', popup_opts.prompt) local prompt_bufnr = a.nvim_win_get_buf(prompt_win) + a.nvim_win_set_option(prompt_win, 'winblend', self.window.winblend) a.nvim_win_set_option(prompt_win, 'winhl', 'Normal:TelescopeNormal') pcall(a.nvim_buf_set_option, prompt_bufnr, 'filetype', 'TelescopePrompt') diff --git a/plugin/telescope.vim b/plugin/telescope.vim index 76a100e..3a333c9 100644 --- a/plugin/telescope.vim +++ b/plugin/telescope.vim @@ -14,4 +14,6 @@ cnoremap (TelescopeFuzzyCommandSearch) e \ }" +" TODO: Make a real perf module that works nicer. Probably something for +" another night :) lua PERF = function(...) end