Skip to content

Commit

Permalink
docs: add docs about match_before_cursor option
Browse files Browse the repository at this point in the history
  • Loading branch information
monaqa committed Nov 18, 2024
1 parent ed0e8c1 commit 18bfb51
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions doc/dial.jax
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,10 @@ CONSTANT *dial-augends-constant*
word = false,
cyclic = true,
},
augend.constant.new{
elements = {"let", "const"},
match_before_cursor = true,
},
},
}
<
Expand All @@ -999,6 +1003,10 @@ CONSTANT *dial-augends-constant*
pattern_regexp (string, default: `\C\V\<\(%s\)\>`)
文字列検索を行う際の正規表現。 elements に指定した文字列を
`%s` に指定します。
match_before_cursor (boolean, default: false)
true のとき、カーソルが対象の単語より後ろにある場合でもマッチ
します。ただし、カーソル上またはカーソルの後に他の有効な被加数が
存在すればそちらが優先されます。

注意: `&&``||` のように、記号からなる文字列を相互変換するときは `cyclic`
を false にしてください。
Expand Down
8 changes: 8 additions & 0 deletions doc/dial.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,10 @@ Predefined sequence of strings. You can use this rule with
word = false,
cyclic = true,
},
augend.constant.new{
elements = {"let", "const"},
match_before_cursor = true,
},
},
}
<
Expand All @@ -1033,6 +1037,10 @@ The argument table of `augend.constant.new` can take the following keys:
pattern_regexp (string, default: `\C\V\<\(%s\)\>`)
A regular expression used in search. `%s` represents the string
specified in `elements.`
match_before_cursor (boolean, default: false)
If true, it matches even when the cursor is positioned after
the target word. In that case, however, any other valid augend
on or after the cursor will take precedence.

NOTE: Set `cyclic` to false when cross-converting strings consisting of
symbols, such as `&&` and `||`.
Expand Down

0 comments on commit 18bfb51

Please sign in to comment.