Skip to content
This repository has been archived by the owner on Jul 5, 2022. It is now read-only.

Commit

Permalink
fix: Check for nil node text
Browse files Browse the repository at this point in the history
close #98
close #104
  • Loading branch information
SmiteshP committed May 29, 2022
1 parent 9552418 commit b77453b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lua/nvim-gps/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit b77453b

Please sign in to comment.