fix: allow previewer win customization (#460)

This commit is contained in:
Alvaro Muñoz
2021-01-24 23:53:58 +01:00
committed by GitHub
parent 099910dcd9
commit 951ede2a70
3 changed files with 5 additions and 2 deletions

View File

@@ -364,7 +364,7 @@ function Picker:find()
preview_win, preview_opts = popup.create('', popup_opts.preview) preview_win, preview_opts = popup.create('', popup_opts.preview)
preview_bufnr = a.nvim_win_get_buf(preview_win) preview_bufnr = a.nvim_win_get_buf(preview_win)
a.nvim_win_set_option(preview_win, 'winhl', 'Normal:TelescopeNormal') a.nvim_win_set_option(preview_win, 'winhl', 'Normal:TelescopePreviewNormal')
a.nvim_win_set_option(preview_win, 'winblend', self.window.winblend) a.nvim_win_set_option(preview_win, 'winblend', self.window.winblend)
local preview_border_win = preview_opts and preview_opts.border and preview_opts.border.win_id local preview_border_win = preview_opts and preview_opts.border and preview_opts.border.win_id
if preview_border_win then if preview_border_win then

View File

@@ -125,7 +125,7 @@ previewers.new_buffer_previewer = function(opts)
vim.api.nvim_win_set_buf(status.preview_win, bufnr) vim.api.nvim_win_set_buf(status.preview_win, bufnr)
-- TODO(conni2461): We only have to set options once. Right? -- TODO(conni2461): We only have to set options once. Right?
vim.api.nvim_win_set_option(status.preview_win, 'winhl', 'Normal:Normal') vim.api.nvim_win_set_option(status.preview_win, 'winhl', 'Normal:TelescopePreviewNormal')
vim.api.nvim_win_set_option(status.preview_win, 'signcolumn', 'no') vim.api.nvim_win_set_option(status.preview_win, 'signcolumn', 'no')
vim.api.nvim_win_set_option(status.preview_win, 'foldlevel', 100) vim.api.nvim_win_set_option(status.preview_win, 'foldlevel', 100)
vim.api.nvim_win_set_option(status.preview_win, 'wrap', false) vim.api.nvim_win_set_option(status.preview_win, 'wrap', false)

View File

@@ -6,6 +6,9 @@ highlight default link TelescopeMultiSelection Type
" "Normal" in the floating windows created by telescope. " "Normal" in the floating windows created by telescope.
highlight default link TelescopeNormal Normal highlight default link TelescopeNormal Normal
" "Normal" in the preview floating windows created by telescope.
highlight default link TelescopePreviewNormal Normal
" Border highlight groups. " Border highlight groups.
" Use TelescopeBorder to override the default. " Use TelescopeBorder to override the default.
" Otherwise set them specifically " Otherwise set them specifically