From b77453b9d4c66bc1aa530bbd6cfc66efe5e38811 Mon Sep 17 00:00:00 2001 From: Smitesh Patil Date: Sun, 29 May 2022 20:16:38 +0530 Subject: [PATCH] fix: Check for nil node text close #98 close #104 --- lua/nvim-gps/init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/nvim-gps/init.lua b/lua/nvim-gps/init.lua index 30a27bb..96797b1 100644 --- a/lua/nvim-gps/init.lua +++ b/lua/nvim-gps/init.lua @@ -327,6 +327,9 @@ function M.get_data() if vim.fn.has("nvim-0.7") then text = vim.treesitter.query.get_node_text(capture_node, 0) + if text == nil then + return data_cache_value + end text = string.gsub(text, "%s+", ' ') else text = utils.get_node_text()