|
1 | 1 | *mini.ai* Extend and create a/i textobjects |
2 | | -*MiniAi* |
3 | 2 |
|
4 | 3 | MIT License Copyright (c) 2022 Evgeni Chasnovski |
5 | 4 |
|
6 | | -============================================================================== |
7 | | - |
| 5 | +------------------------------------------------------------------------------ |
| 6 | + *MiniAi* |
8 | 7 | Enhance some builtin |text-objects| (like |a(|, |a)|, |a'|, and more), |
9 | 8 | create new ones (like `a*`, `a<Space>`, `af`, `a?`, and more), and allow |
10 | 9 | user to create their own. |
@@ -230,22 +229,22 @@ Notes: |
230 | 229 | Examples: |
231 | 230 | 1. Either balanced `()` or balanced `[]` but both with inner edge space: >lua |
232 | 231 |
|
233 | | - -- Composed pattern |
234 | | - { { '%b()', '%b[]' }, '^. .* .$' } |
| 232 | + -- Composed pattern |
| 233 | + { { '%b()', '%b[]' }, '^. .* .$' } |
235 | 234 |
|
236 | | - -- Composed pattern expanded into equivalent array of nested patterns |
237 | | - { '%b()', '^. .* .$' } -- and |
238 | | - { '%b[]', '^. .* .$' } |
| 235 | + -- Composed pattern expanded into equivalent array of nested patterns |
| 236 | + { '%b()', '^. .* .$' } -- and |
| 237 | + { '%b[]', '^. .* .$' } |
239 | 238 | < |
240 | 239 | 2. Either "balanced `()` with inner edge space" or "balanced `[]` with |
241 | 240 | no inner edge space", both with 5 or more characters: >lua |
242 | 241 |
|
243 | | - -- Composed pattern |
244 | | - { { { '%b()', '^. .* .$' }, { '%b[]', '^.[^ ].*[^ ].$' } }, '.....' } |
| 242 | + -- Composed pattern |
| 243 | + { { { '%b()', '^. .* .$' }, { '%b[]', '^.[^ ].*[^ ].$' } }, '.....' } |
245 | 244 |
|
246 | | - -- Composed pattern expanded into equivalent array of nested patterns |
247 | | - { '%b()', '^. .* .$', '.....' } -- and |
248 | | - { '%b[]', '^.[^ ].*[^ ].$', '.....' } |
| 245 | + -- Composed pattern expanded into equivalent array of nested patterns |
| 246 | + { '%b()', '^. .* .$', '.....' } -- and |
| 247 | + { '%b[]', '^.[^ ].*[^ ].$', '.....' } |
249 | 248 | < |
250 | 249 | - SPAN MATCHES COMPOSED PATTERN if it matches at least one nested pattern |
251 | 250 | from expanded composed pattern. |
@@ -636,7 +635,7 @@ Example: >lua |
636 | 635 | ['|'] = gen_spec.pair('|', '|', { type = 'non-balanced' }), |
637 | 636 | } |
638 | 637 | }) |
639 | | - |
| 638 | +< |
640 | 639 | ------------------------------------------------------------------------------ |
641 | 640 | *MiniAi.gen_spec.argument()* |
642 | 641 | `MiniAi.gen_spec.argument`({opts}) |
@@ -685,7 +684,7 @@ Example: |
685 | 684 | only alphanumeric or underscore (not dot). |
686 | 685 |
|
687 | 686 | Parameters ~ |
688 | | -{opts} `(table|nil)` Optsion. Allowed fields: |
| 687 | +{opts} `(table|nil)` Options. Allowed fields: |
689 | 688 | - <name_pattern> - string pattern of character set allowed in function name. |
690 | 689 | Default: `'[%w_%.]'` (alphanumeric, underscore, or dot). |
691 | 690 | Note: should be enclosed in `[]`. |
@@ -793,10 +792,10 @@ Return ~ |
793 | 792 | corresponding (`a` or `i`) treesitter capture. |
794 | 793 |
|
795 | 794 | See also ~ |
796 | | -|MiniAi-textobject-specification| for how this type of textobject |
| 795 | +- |MiniAi-textobject-specification| for how this type of textobject |
797 | 796 | specification is processed. |
798 | | -|vim.treesitter.get_query()| for how query is fetched. |
799 | | -|Query:iter_captures()| for how all query captures are iterated in case of |
| 797 | +- |vim.treesitter.get_query()| for how query is fetched. |
| 798 | +- |Query:iter_captures()| for how all query captures are iterated in case of |
800 | 799 | no 'nvim-treesitter'. |
801 | 800 |
|
802 | 801 | ------------------------------------------------------------------------------ |
|
0 commit comments