Skip to content

Commit

Permalink
complete: support "bleopt complete_auto_wordbreaks"
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Jan 13, 2020
1 parent 0770234 commit c294e31
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
7 changes: 7 additions & 0 deletions blerc
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,13 @@
#bleopt complete_auto_delay=100


## The setting "complete_auto_wordbreaks" is used as the delimiters for
## identifying words for M-right (auto-complete/insert-word). The default
## value is $' \t\n'. If the empty value is set, the default value is used.

#bleopt complete_auto_wordbreaks=$' \t\n/'


## When there are user inputs while generating completion candidates, the
## candidates generation will be canceled to process the user inputs. The
## following setting controls the interval of checking user inputs while
Expand Down
1 change: 1 addition & 0 deletions lib/core-complete-def.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ bleopt/declare -v complete_contract_function_names 1
bleopt/declare -v complete_auto_complete 1
bleopt/declare -v complete_auto_history 1
bleopt/declare -n complete_auto_delay 1
bleopt/declare -v complete_auto_wordbreaks $' \t\n'
bleopt/declare -v complete_allow_reduction ''

## オプション complete_menu_style
Expand Down
3 changes: 2 additions & 1 deletion lib/core-complete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4972,7 +4972,8 @@ function ble/widget/auto_complete/insert-on-end {
fi
}
function ble/widget/auto_complete/insert-word {
local rex='^['$_ble_term_IFS']*([^'$_ble_term_IFS']+['$_ble_term_IFS']*)?'
local breaks=${bleopt_complete_auto_wordbreaks:-$_ble_term_IFS}
local rex='^['$breaks']*([^'$breaks']+['$breaks']*)?'
if [[ $_ble_complete_ac_type == [ch] ]]; then
local ins=${_ble_edit_str:_ble_edit_ind:_ble_edit_mark-_ble_edit_ind}
[[ $ins =~ $rex ]]
Expand Down
13 changes: 13 additions & 0 deletions memo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2367,6 +2367,9 @@ bash_tips

2020-01-12 -- (#D1215... ) c74abc5...

New features
- complete: support `bleopt complete_auto_wordbreaks` `#D1219`

2019-03-21 -- 2020-01-12 (#D1015...#D1215) df4feaa...c74abc5

New features
Expand Down Expand Up @@ -3499,6 +3502,16 @@ bash_tips
Done (実装ログ)
-------------------------------------------------------------------------------

2020-01-13

* util: 自動補完の区切り文字を設定できる様にする [#D1219]
https://github.com/akinomyoga/ble.sh/issues/33#issuecomment-573528032

/ で区切る様にしたいとの事だ。
試してみると確かに fish では / も区切りになっている。
新しい機能なので ble-0.4 に入れる事にする。
と思ったけれどどうしようか。取り敢えず ble-0.4 に実装する事にした。

2020-01-12

* util: 構文着色を単体で呼び出せる様にする [#D1218]
Expand Down

0 comments on commit c294e31

Please sign in to comment.