Files
nvim-cmp/lua/cmp
AF 0ad2450ff6 fix(context): in_treesitter_capture (#1211)
* fix(context): `in_treesitter_capture`

`in_treesitter_capture` used to compare a node:type() with what should
be a capture, returning always a falsy value.
The example https://github.com/hrsh7th/nvim-cmp/wiki/Advanced-techniques#disabling-completion-in-certain-contexts-such-as-comments
did not work as expected, being in_treesitter_capture("comment") always
not true.
Now it works as expected.

* feat(context): `in...capture`, `in...group` table

`in_treesitter_capture` and `in_syntax_group` can take a list of string
as argument.

* refactor(context): in...capture use vim.treesitter

Use vim.treesitter.get_captures_at_cursor()

* fix(context): get_captures_at_cursor -> ..._at_pos

get_captures_at_cursor() sometimes fails. Do it explicitly with
get_captures_at_pos(buf, row, col)

* refactor(context): vim.fn -> vim.api

Get row and col using vim.api and not vim.fn in in_syntax_group, as done
in in_treesitter_capture
2022-10-10 17:06:41 +09:00
..
2022-10-02 20:22:13 +09:00
2021-08-04 01:07:12 +09:00
2022-07-24 12:44:53 +09:00
2021-11-15 13:15:56 +09:00
2022-09-25 21:24:27 +09:00
2022-09-27 12:27:31 +09:00
2022-05-04 01:47:01 +09:00
2022-07-24 12:44:53 +09:00
2021-08-27 23:26:54 +09:00
2022-09-27 12:27:31 +09:00
2022-08-23 15:21:32 +09:00
2022-07-24 12:44:53 +09:00