Debian Codegraph @

memo/D2092/ble-bind.nocasematch.patch

raw
1 From 11a202a575bcca1d25eeccc9a644b0da94baff6c Mon Sep 17 00:00:00 2001
2 From: Koichi Murase <[email protected]>
3 Date: Sun, 10 Dec 2023 17:03:22 +0900
4 Subject: [PATCH] [stub] ble-bind: nocasematch
5
6 ---
7 src/decode.sh | 19 +++++++++++++++----
8 1 file changed, 15 insertions(+), 4 deletions(-)
9
10 diff --git a/src/decode.sh b/src/decode.sh
11 index 5ba20cdc..acb67610 100644
12 --- a/src/decode.sh
13 +++ b/src/decode.sh
14 @@ -3164,6 +3164,12 @@ function ble-bind {
15 local -a keymaps; keymaps=()
16 ble/decode/initialize
17
18 + local nocasematch=
19 + if shopt -q nocasematch 2>/dev/null; then
20 + shopt -u nocasematch
21 + nocasematch=1
22 + fi
23 +
24 local IFS=$_ble_term_IFS q=\' Q="''\'"
25
26 local arg c
27 @@ -3293,10 +3299,15 @@ function ble-bind {
28 fi
29 done
30
31 - [[ $flags == *E* ]] && return 2
32 - [[ $flags == *R* ]] && return 1
33 - [[ $flags == *D* ]] || ble-bind/option:print "${keymaps[@]}"
34 - return 0
35 + local ext=0
36 + case $flags in
37 + (*E*) ext=2 ;;
38 + (*R*) ext=1 ;;
39 + (*D*) ;;
40 + (*) ble-bind/option:print "${keymaps[@]}" ;;
41 + esac
42 + [[ $nocasematch ]] && shopt -s nocasematch
43 + return "$ext"
44 }
45
46 #------------------------------------------------------------------------------
47 --
48 2.41.0
49