Skip to content

Commit

Permalink
(mini.ai) Update docs to consistently use 'prev' search method.
Browse files Browse the repository at this point in the history
  • Loading branch information
echasnovski committed Oct 24, 2022
1 parent 8087764 commit 8b0f423
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions doc/mini-ai.txt
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ Default values:
-- How to search for object (first inside current line, then inside
-- neighborhood). One of 'cover', 'cover_or_next', 'cover_or_prev',
-- 'cover_or_nearest', 'next', 'previous', 'nearest'.
-- 'cover_or_nearest', 'next', 'prev', 'nearest'.
search_method = 'cover_or_next',
}
<
Expand Down Expand Up @@ -466,16 +466,16 @@ Possible values are:
- `'cover_or_prev'` - use covering match. If not found, use previous.
- `'cover_or_nearest'` - use covering match. If not found, use nearest.
- `'next'` - use next match.
- `'previous'` - use previous match.
- `'prev'` - use previous match.
- `'nearest'` - use nearest match.

Note: search is first performed on the reference region lines and only
after failure - on the whole neighborhood defined by `config.n_lines`. This
means that with `config.search_method` not equal to `'cover'`, "previous"
or "next" textobject will end up as search result if they are found on
first stage although covering match might be found in bigger, whole
neighborhood. This design is based on observation that most of the time
operation is done within reference region lines (usually cursor line).
means that with `config.search_method` not equal to `'cover'`, "prev" or
"next" textobject will end up as search result if they are found on first
stage although covering match might be found in bigger, whole neighborhood.
This design is based on observation that most of the time operation is done
within reference region lines (usually cursor line).

Here is an example of what `a)` textobject is based on a value of
`'config.search_method'` when cursor is inside `bbb` word:
Expand Down
14 changes: 7 additions & 7 deletions lua/mini/ai.lua
Original file line number Diff line number Diff line change
Expand Up @@ -443,16 +443,16 @@ end
--- - `'cover_or_prev'` - use covering match. If not found, use previous.
--- - `'cover_or_nearest'` - use covering match. If not found, use nearest.
--- - `'next'` - use next match.
--- - `'previous'` - use previous match.
--- - `'prev'` - use previous match.
--- - `'nearest'` - use nearest match.
---
--- Note: search is first performed on the reference region lines and only
--- after failure - on the whole neighborhood defined by `config.n_lines`. This
--- means that with `config.search_method` not equal to `'cover'`, "previous"
--- or "next" textobject will end up as search result if they are found on
--- first stage although covering match might be found in bigger, whole
--- neighborhood. This design is based on observation that most of the time
--- operation is done within reference region lines (usually cursor line).
--- means that with `config.search_method` not equal to `'cover'`, "prev" or
--- "next" textobject will end up as search result if they are found on first
--- stage although covering match might be found in bigger, whole neighborhood.
--- This design is based on observation that most of the time operation is done
--- within reference region lines (usually cursor line).
---
--- Here is an example of what `a)` textobject is based on a value of
--- `'config.search_method'` when cursor is inside `bbb` word:
Expand Down Expand Up @@ -497,7 +497,7 @@ MiniAi.config = {

-- How to search for object (first inside current line, then inside
-- neighborhood). One of 'cover', 'cover_or_next', 'cover_or_prev',
-- 'cover_or_nearest', 'next', 'previous', 'nearest'.
-- 'cover_or_nearest', 'next', 'prev', 'nearest'.
search_method = 'cover_or_next',
}
--minidoc_afterlines_end
Expand Down

0 comments on commit 8b0f423

Please sign in to comment.