diff options
| author | Santos Gallegos <stsewd@protonmail.com> | 2021-07-08 23:23:37 -0500 |
|---|---|---|
| committer | Stephan Seitz <stephan.lauf@yahoo.de> | 2021-07-09 20:05:37 +0200 |
| commit | 8eb8cc61e3ff08c1382587204aa1c1145c4bfe22 (patch) | |
| tree | ab5c7466b591cd062dbec6001138dd131010a809 /lua/nvim-treesitter | |
| parent | 08c6a3fb555288250523faf652f2d225f4aceeba (diff) | |
downcase predicate: nil protection
get_node_text could be nil if the range is invalid.
With https://github.com/neovim/neovim/pull/15030/
this fixes https://github.com/nvim-treesitter/nvim-treesitter/issues/1531
Diffstat (limited to 'lua/nvim-treesitter')
| -rw-r--r-- | lua/nvim-treesitter/query_predicates.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lua/nvim-treesitter/query_predicates.lua b/lua/nvim-treesitter/query_predicates.lua index 11df5916..2a3b4c38 100644 --- a/lua/nvim-treesitter/query_predicates.lua +++ b/lua/nvim-treesitter/query_predicates.lua @@ -119,7 +119,7 @@ query.add_directive("downcase!", function(match, _, bufnr, pred, metadata) text = value else local node = match[value] - text = query.get_node_text(node, bufnr) + text = query.get_node_text(node, bufnr) or "" end if #pred == 3 then |
