Skip to content

Commit

Permalink
keymap/vi (decompose-meta): translate "S-a" to "A"
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Apr 3, 2023
1 parent cdda7c4 commit eaf66c7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ble-edit.sh
Expand Up @@ -6404,7 +6404,7 @@ function ble-decode/keymap:safe/bind-common {
ble-decode/keymap:safe/.bind 'S-home' '@marked beginning-of-line'
ble-decode/keymap:safe/.bind 'S-end' '@marked end-of-line'
ble-decode/keymap:safe/.bind 'M-m' '@nomarked beginning-of-line'
ble-decode/keymap:safe/.bind 'S-M-m' '@marked beginning-of-line'
ble-decode/keymap:safe/.bind 'M-S-m' '@marked beginning-of-line'
ble-decode/keymap:safe/.bind 'M-M' '@marked beginning-of-line'
ble-decode/keymap:safe/.bind 'C-p' '@nomarked backward-line' # overwritten by bind-history
ble-decode/keymap:safe/.bind 'up' '@nomarked backward-line' # overwritten by bind-history
Expand Down
8 changes: 6 additions & 2 deletions keymap/vi.sh
Expand Up @@ -114,7 +114,9 @@ function ble/widget/vi_imap/__default__ {

local esc=27 # ESC
# local esc=$((ble_decode_Ctrl|0x5b)) # もしくは C-[
ble-decode-key "$esc" "$((KEYS[0]&~ble_decode_Meta))" "${KEYS[@]:1}"
((flag&=~_ble_decode_Meta))
((flag==_ble_decode_Shft&&0x61<=code&&code<=0x7A&&(flag=0,code-=0x20)))
ble-decode-key "$esc" "$((flag|code))" "${KEYS[@]:1}"
return 0
fi

Expand All @@ -140,7 +142,9 @@ function ble/widget/vi-command/decompose-meta {
old_suppress=$_ble_decode_keylog_depth
local _ble_decode_keylog_depth=$((old_suppress-1))

ble-decode-key "$esc" "$((KEYS[0]&~ble_decode_Meta))" "${KEYS[@]:1}"
((flag&=~_ble_decode_Meta))
((flag==_ble_decode_Shft&&0x61<=code&&code<=0x7A&&(flag=0,code-=0x20)))
ble-decode-key "$esc" "$((flag|code))" "${KEYS[@]:1}"
return 0
fi

Expand Down

0 comments on commit eaf66c7

Please sign in to comment.