From 7e1fefb841caa522d7f46ca14bce6e23a7328493 Mon Sep 17 00:00:00 2001 From: Myzel394 <50424412+Myzel394@users.noreply.github.com> Date: Sun, 14 Apr 2024 12:52:06 +0200 Subject: [PATCH] fix: Fix value_start position --- lua/jsonfly/parsers.lua | 2 +- lua/telescope/_extensions/jsonfly.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/jsonfly/parsers.lua b/lua/jsonfly/parsers.lua index 2ffe8ee..45be2f6 100644 --- a/lua/jsonfly/parsers.lua +++ b/lua/jsonfly/parsers.lua @@ -142,7 +142,7 @@ function M:get_entries_from_lsp_symbols(symbols) -- We assume a default JSON file like: -- `"my_key": "my_value"` -- Since we get the end of the key, we can just add 4 to get the start of the value - value_start = symbol.selectionRange["end"].character + 4 + value_start = symbol.selectionRange["end"].character + 3, } } table.insert(keys, entry) diff --git a/lua/telescope/_extensions/jsonfly.lua b/lua/telescope/_extensions/jsonfly.lua index 8e4cfe9..61db420 100644 --- a/lua/telescope/_extensions/jsonfly.lua +++ b/lua/telescope/_extensions/jsonfly.lua @@ -47,7 +47,7 @@ local opts = { }, jump_behavior = "key_start", subkeys_display = "normal", - backend = "lua", + backend = "lsp", } ---@param results Entry[]