diff options
author | Christian Clason <c.clason@uni-graz.at> | 2022-02-11 15:19:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-11 15:19:19 +0100 |
commit | 4761dd4fc2d7ecaef3516b3931589e4310bc6db7 (patch) | |
tree | f7bdc2a7fc5c819ad500fbc8b748b1442978ffd2 /test/functional/treesitter/parser_spec.lua | |
parent | f6329ea137730e571671ee31309ec1b7dc6ec85e (diff) | |
parent | 58d81efcb271b93d2d4903d235eab6c97a6c4d39 (diff) | |
download | rneovim-4761dd4fc2d7ecaef3516b3931589e4310bc6db7.tar.gz rneovim-4761dd4fc2d7ecaef3516b3931589e4310bc6db7.tar.bz2 rneovim-4761dd4fc2d7ecaef3516b3931589e4310bc6db7.zip |
Merge pull request #17365 from kevinhwang91/fix-ts-empty-lines
fix(query.lua): check empty table for lines
Diffstat (limited to 'test/functional/treesitter/parser_spec.lua')
-rw-r--r-- | test/functional/treesitter/parser_spec.lua | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/functional/treesitter/parser_spec.lua b/test/functional/treesitter/parser_spec.lua index 396fe5feab..599c74102c 100644 --- a/test/functional/treesitter/parser_spec.lua +++ b/test/functional/treesitter/parser_spec.lua @@ -285,6 +285,25 @@ end]] eq(true, result) end) + it('support getting empty text if node range is zero width', function() + local text = [[ +```lua +{} +```]] + insert(text) + local result = exec_lua([[ + local fake_node = {} + function fake_node:start() + return 1, 0, 7 + end + function fake_node:end_() + return 1, 0, 7 + end + return vim.treesitter.get_node_text(fake_node, 0) == '' + ]]) + eq(true, result) + end) + it('can match special regex characters like \\ * + ( with `vim-match?`', function() insert('char* astring = "\\n"; (1 + 1) * 2 != 2;') |