summaryrefslogtreecommitdiff
path: root/lua/telescope
diff options
context:
space:
mode:
authorJulian Fricker <402357+TC72@users.noreply.github.com>2021-11-04 06:22:09 +0000
committerGitHub <noreply@github.com>2021-11-04 07:22:09 +0100
commit6652d4d55571db0ebd6cb636c523cb8a87785c27 (patch)
treec7b7aa78f544e6e17a06f258e8f1469b09735c6b /lua/telescope
parent6a8fbb53e01f9c523a68fb1eb06a346e43db720d (diff)
feat: Full width select (#1403)
Can be changed back by setting telescope.setup { defaults = { hl_result_eol = false, } }
Diffstat (limited to 'lua/telescope')
-rw-r--r--lua/telescope/config.lua10
-rw-r--r--lua/telescope/pickers/highlights.lua9
2 files changed, 18 insertions, 1 deletions
diff --git a/lua/telescope/config.lua b/lua/telescope/config.lua
index c7d151e..dc01d3b 100644
--- a/lua/telescope/config.lua
+++ b/lua/telescope/config.lua
@@ -321,6 +321,16 @@ append(
)
append(
+ "hl_result_eol",
+ true,
+ [[
+ Changes if the highlight for the selected item in the results
+ window is always the full width of the window
+
+ Default: true]]
+)
+
+append(
"dynamic_preview_title",
false,
[[
diff --git a/lua/telescope/pickers/highlights.lua b/lua/telescope/pickers/highlights.lua
index e7b99e1..6d89b78 100644
--- a/lua/telescope/pickers/highlights.lua
+++ b/lua/telescope/pickers/highlights.lua
@@ -1,5 +1,6 @@
local a = vim.api
local log = require "telescope.log"
+local conf = require("telescope.config").values
local highlights = {}
@@ -69,7 +70,13 @@ function Highlighter:hi_selection(row, caret)
a.nvim_buf_clear_namespace(results_bufnr, ns_telescope_selection, 0, -1)
a.nvim_buf_add_highlight(results_bufnr, ns_telescope_selection, "TelescopeSelectionCaret", row, 0, #caret)
- a.nvim_buf_add_highlight(results_bufnr, ns_telescope_selection, "TelescopeSelection", row, #caret, -1)
+ a.nvim_buf_set_extmark(
+ results_bufnr,
+ ns_telescope_selection,
+ row,
+ #caret,
+ { end_line = row + 1, hl_eol = conf.hl_result_eol, hl_group = "TelescopeSelection" }
+ )
end
function Highlighter:hi_multiselect(row, is_selected)