mirror of
https://github.com/Myzel394/jsonfly.nvim.git
synced 2025-06-18 04:05:26 +02:00
fix: Show nested keys
This commit is contained in:
parent
2015ac5aef
commit
c6c630babe
@ -375,7 +375,7 @@ local function grok_object(self, text, start, options)
|
||||
local new_val, new_i = grok_one(self, text, i, options)
|
||||
|
||||
---- Add start position so we can quickly jump to it
|
||||
VALUE[key] = {new_val, key_start = key_start, key_end = key_end, newlines = newlines, relative_start = relative_start}
|
||||
VALUE[key] = {value = new_val, key_start = key_start, key_end = key_end, newlines = newlines, relative_start = relative_start}
|
||||
|
||||
--
|
||||
-- Expect now either '}' to end things, or a ',' to allow us to continue.
|
||||
|
@ -10,7 +10,7 @@ local function get_recursive_keys(t)
|
||||
for k, raw_value in pairs(t) do
|
||||
table.insert(keys, {key = k, entry = raw_value})
|
||||
|
||||
local v = raw_value[0]
|
||||
local v = raw_value.value
|
||||
|
||||
if type(v) == "table" then
|
||||
local sub_keys = get_recursive_keys(v)
|
||||
@ -37,7 +37,7 @@ return require"telescope".register_extension {
|
||||
local parsed = json:decode(content)
|
||||
local keys = get_recursive_keys(parsed)
|
||||
|
||||
print(vim.inspect(keys))
|
||||
-- print(vim.inspect(keys))
|
||||
|
||||
pickers.new(opts, {
|
||||
prompt_title = "colors",
|
||||
@ -52,6 +52,9 @@ return require"telescope".register_extension {
|
||||
bufnr = current_buf,
|
||||
filename = filename,
|
||||
lnum = entry.entry.newlines + 1,
|
||||
col = 2,
|
||||
start = 2,
|
||||
finish = 8,
|
||||
|
||||
indicator = 0,
|
||||
extra = 0,
|
||||
|
Loading…
x
Reference in New Issue
Block a user