summaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorSimon Hauser <Simon-Hauser@outlook.de>2022-05-22 11:50:00 +0200
committerSimon Hauser <simon.hauser@helsinki-systems.de>2022-06-30 14:01:49 +0200
commit5510587ff488e9d6dfae66ba7e19bce090633329 (patch)
tree25747f59d453481dffc998fb5d26fb761a927b3e /lua
parent7648e5d8914ecc65346ce7d1c49e1a5fe2979564 (diff)
feat(vim_options): show scope information in display (#1956)
Also make type, scope and value searchable
Diffstat (limited to 'lua')
-rw-r--r--lua/telescope/make_entry.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/lua/telescope/make_entry.lua b/lua/telescope/make_entry.lua
index 3280f2a..c71849d 100644
--- a/lua/telescope/make_entry.lua
+++ b/lua/telescope/make_entry.lua
@@ -817,6 +817,7 @@ function make_entry.gen_from_vimoptions()
items = {
{ width = 25 },
{ width = 12 },
+ { width = 11 },
{ remaining = true },
},
}
@@ -825,6 +826,7 @@ function make_entry.gen_from_vimoptions()
return displayer {
{ entry.value.name, "Keyword" },
{ "[" .. entry.value.type .. "]", "Type" },
+ { "[" .. entry.value.scope .. "]", "Identifier" },
utils.display_termcodes(tostring(entry.value.value)),
}
end
@@ -836,13 +838,17 @@ function make_entry.gen_from_vimoptions()
name = o.name,
value = o.default,
type = o.type,
+ scope = o.scope,
},
- ordinal = o.name,
+ ordinal = string.format("%s %s %s", o.name, o.type, o.scope),
}
local ok, value = pcall(vim.api.nvim_get_option, o.name)
if ok then
entry.value.value = value
+ entry.ordinal = entry.ordinal .. " " .. utils.display_termcodes(tostring(value))
+ else
+ entry.ordinal = entry.ordinal .. " " .. utils.display_termcodes(tostring(o.default))
end
return entry