@@ -250,16 +250,16 @@ Textobject specification has a structure of composed pattern (see
250
250
arguments as | MiniAi.find_textobject() | and should return one of:
251
251
- Composed pattern. Useful for implementing user input. Example of
252
252
simplified variant of textobject for function call with name taken
253
- from user prompt:
254
- >
253
+ from user prompt: >
254
+
255
255
function()
256
256
local left_edge = vim.pesc(vim.fn.input('Function name: '))
257
257
return { string.format('%s+%%b()', left_edge), '^.-%(().*()%)$' }
258
258
end
259
259
<
260
260
- Single output region. Useful to allow full control over
261
- textobject. Will be taken as is. Example of returning whole buffer:
262
- >
261
+ textobject. Will be taken as is. Example of returning whole buffer: >
262
+
263
263
function()
264
264
local from = { line = 1, col = 1 }
265
265
local to = {
@@ -273,8 +273,8 @@ Textobject specification has a structure of composed pattern (see
273
273
instruments, like treesitter (see | MiniAi.gen_spec.treesitter() | ).
274
274
The best region will be picked in the same manner as with composed
275
275
pattern (respecting options `n_lines` , `search_method` , etc.).
276
- Example of selecting "best" line with display width more than 80:
277
- >
276
+ Example of selecting "best" line with display width more than 80: >
277
+
278
278
function(_, _, _)
279
279
local res = {}
280
280
for i = 1, vim.api.nvim_buf_line_count(0) do
@@ -297,8 +297,8 @@ Textobject specification has a structure of composed pattern (see
297
297
!IMPORTANT NOTE!: it means that output's `from` shouldn't be strictly
298
298
to the left of `init` (it will lead to infinite loop). Not allowed as
299
299
last item (as it should be pattern with captures).
300
- Example of matching only balanced parenthesis with big enough width:
301
- >
300
+ Example of matching only balanced parenthesis with big enough width: >
301
+
302
302
{
303
303
'%b()',
304
304
function(s, init)
@@ -307,7 +307,7 @@ Textobject specification has a structure of composed pattern (see
307
307
end,
308
308
'^.().*().$'
309
309
}
310
- >
310
+ <
311
311
More examples:
312
312
- See | MiniAi.gen_spec | for function wrappers to create commonly used
313
313
textobject specifications.
@@ -711,8 +711,7 @@ Example configuration for function definition textobject with
711
711
})
712
712
}
713
713
})
714
- >
715
-
714
+ <
716
715
Notes:
717
716
- By default query is done using 'nvim-treesitter' plugin if it is present
718
717
(falls back to builtin methods otherwise). This allows for a more
0 commit comments