Skip to content

Commit

Permalink
decode: fix a bug of broken cmap cache
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Apr 13, 2020
1 parent fe78bd6 commit 4b15993
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions lib/init-cmap.sh
Expand Up @@ -40,6 +40,7 @@
# この一覧を更新することでキャッシュの更新が起こるようにしている。
#
# 2019-05-06 ble-update 関連でバグがあったのを潰したので更新。
# 2020-04-13 cmap キャッシュ生成のバグ修正に伴う更新。

function ble/init:cmap/bind-keypad-key {
local Ft=$1 name=$2
Expand Down
14 changes: 10 additions & 4 deletions src/decode.sh
Expand Up @@ -1794,6 +1794,7 @@ function ble-bind/option:print {
function ble-bind {
local kmap=$ble_bind_keymap ret
local -a keymaps; keymaps=()
ble-decode/initialize

local arg c
while (($#)); do
Expand Down Expand Up @@ -2048,10 +2049,15 @@ function ble-decode-bind/cmap/initialize {
else
ble-edit/info/immediate-show text 'ble.sh: generating "'"$dump"'"...'
source "$init"
ble-bind -D | ble/bin/sed '
s/^declare \{1,\}\(-[aAfFgilrtux]\{1,\} \{1,\}\)\{0,1\}//
s/^-- //
s/["'"'"']//g
ble-bind -D | ble/bin/awk '
{
sub(/^declare +(-[aAfFgiclrtux]+ +)?/, "");
sub(/^-- +/, "");
}
/^_ble_decode_(cmap|csimap|kbd)/ {
gsub(/["'\'']/, "");
print
}
' >| "$dump"
fi

Expand Down

0 comments on commit 4b15993

Please sign in to comment.