summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSenghan Bright <senghan.bright@deltaprojects.com>2021-01-04 08:02:11 +0100
committerGitHub <noreply@github.com>2021-01-04 08:02:11 +0100
commit71ea4130a2a0afd5800707ea30bc03d2adaabae4 (patch)
tree412501ec5cad8911a40e4aa9e409be70997421ba
parent6a403ddf98e182d73ec280361135c391af111eec (diff)
Fix missing global (#384)
* add selected command to cmd-history * make N_ function global * fix vimoptions description resolution and add color
-rw-r--r--data/options/options.lua2
-rw-r--r--lua/telescope/make_entry.lua15
2 files changed, 8 insertions, 9 deletions
diff --git a/data/options/options.lua b/data/options/options.lua
index 219babb..95861cc 100644
--- a/data/options/options.lua
+++ b/data/options/options.lua
@@ -41,7 +41,7 @@ local imacros=function(s)
return '(intptr_t)' .. s
end
end
-local N_=function(s) -- luacheck: ignore 211 (currently unused)
+N_=function(s) -- luacheck: ignore 211 (currently unused)
return function()
return 'N_(' .. cstr(s) .. ')'
end
diff --git a/lua/telescope/make_entry.lua b/lua/telescope/make_entry.lua
index 188a54d..7456e2b 100644
--- a/lua/telescope/make_entry.lua
+++ b/lua/telescope/make_entry.lua
@@ -721,7 +721,7 @@ function make_entry.gen_from_vimoptions()
end
local str_funcname = o.short_desc()
- option.description = assert(loadstring("return " .. str_funcname))()
+ option.description = assert(loadstring(str_funcname))()
-- if #option.description > opts.desc_col_length then
-- opts.desc_col_length = #option.description
-- end
@@ -750,10 +750,11 @@ function make_entry.gen_from_vimoptions()
end
local displayer = entry_display.create {
- separator = "│",
+ separator = "",
+ hl_chars = { ['['] = 'TelescopeBorder', [']'] = 'TelescopeBorder' },
items = {
{ width = 25 },
- { width = 50 },
+ { width = 12 },
{ remaining = true },
},
}
@@ -761,11 +762,9 @@ function make_entry.gen_from_vimoptions()
local make_display = function(entry)
return displayer {
- entry.name,
- string.format(
- "[%s] %s",
- entry.value_type,
- utils.display_termcodes(tostring(entry.current_value))),
+ {entry.name, "Keyword"},
+ {"["..entry.value_type.."]", "Type"},
+ utils.display_termcodes(tostring(entry.current_value)),
entry.description,
}
end