diff --git a/lua/jsonfly/json.lua b/lua/jsonfly/json.lua index 20ad726..549d5d6 100644 --- a/lua/jsonfly/json.lua +++ b/lua/jsonfly/json.lua @@ -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. diff --git a/lua/telescope/_extensions/jsonfly.lua b/lua/telescope/_extensions/jsonfly.lua index 5b0b0f6..7705d91 100644 --- a/lua/telescope/_extensions/jsonfly.lua +++ b/lua/telescope/_extensions/jsonfly.lua @@ -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,