From 18bfb517067f8e7320b99bec63ee1597145342e0 Mon Sep 17 00:00:00 2001 From: monaqa Date: Mon, 18 Nov 2024 22:16:31 +0900 Subject: [PATCH] docs: add docs about `match_before_cursor` option --- doc/dial.jax | 8 ++++++++ doc/dial.txt | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/doc/dial.jax b/doc/dial.jax index 8454e90..9cf27d9 100644 --- a/doc/dial.jax +++ b/doc/dial.jax @@ -981,6 +981,10 @@ CONSTANT *dial-augends-constant* word = false, cyclic = true, }, + augend.constant.new{ + elements = {"let", "const"}, + match_before_cursor = true, + }, }, } < @@ -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 にしてください。 diff --git a/doc/dial.txt b/doc/dial.txt index 659bb9c..0aa2e32 100644 --- a/doc/dial.txt +++ b/doc/dial.txt @@ -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, + }, }, } < @@ -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 `||`.