summaryrefslogtreecommitdiff
path: root/lua/telescope/make_entry.lua
diff options
context:
space:
mode:
authorLuke Kershaw <35707277+l-kershaw@users.noreply.github.com>2021-11-27 16:00:24 +0000
committerGitHub <noreply@github.com>2021-11-27 16:00:24 +0000
commit414a7a5b44b464305754349248f323bf75d03b94 (patch)
tree8d523cb69940489d6f35f49a7d2174011a8f29b1 /lua/telescope/make_entry.lua
parentb415e862bf248d66c40e242de4a0c76c68e278f1 (diff)
feat: extend functionality of `entry_display.create` (#1408)
* feat: extend functionality of `entry_display.create` - now allows passing functions or fractional values to `width` option * refactor: cache `width` instead of results window size * feat: use new `width` functionality for more entry makers
Diffstat (limited to 'lua/telescope/make_entry.lua')
-rw-r--r--lua/telescope/make_entry.lua16
1 files changed, 8 insertions, 8 deletions
diff --git a/lua/telescope/make_entry.lua b/lua/telescope/make_entry.lua
index 2328711..498db9c 100644
--- a/lua/telescope/make_entry.lua
+++ b/lua/telescope/make_entry.lua
@@ -290,7 +290,7 @@ function make_entry.gen_from_quickfix(opts)
separator = "▏",
items = {
{ width = 8 },
- { width = 50 },
+ { width = 0.45 },
{ remaining = true },
},
}
@@ -666,9 +666,9 @@ end
function make_entry.gen_from_picker(opts)
local displayer = entry_display.create {
- separator = " ",
+ separator = " │ ",
items = {
- { width = 30 },
+ { width = 0.5 },
{ remaining = true },
},
}
@@ -957,17 +957,17 @@ function make_entry.gen_from_lsp_diagnostics(opts)
end
end
- local layout = {
+ local display_items = {
{ width = utils.if_nil(signs, 8, 10) },
{ remaining = true },
}
- local line_width = utils.get_default(opts.line_width, 45)
+ local line_width = utils.get_default(opts.line_width, 0.5)
if not utils.is_path_hidden(opts) then
- table.insert(layout, 2, { width = line_width })
+ table.insert(display_items, 2, { width = line_width })
end
local displayer = entry_display.create {
separator = "▏",
- items = layout,
+ items = display_items,
}
local make_display = function(entry)
@@ -1049,7 +1049,7 @@ function make_entry.gen_from_commands(_)
local displayer = entry_display.create {
separator = "▏",
items = {
- { width = 25 },
+ { width = 0.2 },
{ width = 4 },
{ width = 4 },
{ width = 11 },