From 5510587ff488e9d6dfae66ba7e19bce090633329 Mon Sep 17 00:00:00 2001 From: Simon Hauser Date: Sun, 22 May 2022 11:50:00 +0200 Subject: [PATCH] feat(vim_options): show scope information in display (#1956) Also make type, scope and value searchable --- lua/telescope/make_entry.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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