Skip to content

Commit

Permalink
global: pick fixes and changes from ble-0.1..0.2 backports
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Feb 19, 2023
1 parent ccb93a5 commit 78bbc5e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions lib/init-cmap.sh
Expand Up @@ -93,6 +93,7 @@ function ble/init:cmap/initialize {
# ble-bind --csi '6~' next

# 順番を固定
local ret
ble-decode-kbd/generate-keycode insert
ble-decode-kbd/generate-keycode home
ble-decode-kbd/generate-keycode prior
Expand Down
2 changes: 1 addition & 1 deletion src/canvas.sh
Expand Up @@ -732,7 +732,7 @@ function ble/canvas/trace/.process-csi-sequence {
# HVP "CSI f"
local -a params
ble/string#split-words params "${param//[^0-9]/ }"
params=("${params[@]/#/10#}")
params=("${params[@]/#/10#0}")
local x1 y1
((x1=params[1]-1))
((y1=params[0]-1))
Expand Down
4 changes: 2 additions & 2 deletions src/edit.sh
Expand Up @@ -3475,7 +3475,6 @@ _ble_edit_exec_lines=()
_ble_edit_exec_lastexit=0
_ble_edit_exec_lastarg=$BASH
function ble-edit/exec/register {
local BASH_COMMAND=$1
ble/array#push _ble_edit_exec_lines "$1"
}
function ble-edit/exec/has-pending-commands {
Expand Down Expand Up @@ -6909,6 +6908,7 @@ function ble/widget/command-help/.read-man {
local pager="sh -c 'cat >| \"\$_ble_local_tmpfile\"'"
MANPAGER=$pager PAGER=$pager MANOPT= man "$@" 2>/dev/null; local ext=$? # 668ms
ble/util/readfile man_content "$_ble_local_tmpfile" # 80ms
ble/util/assign/.rmtmp
return "$ext"
}

Expand Down Expand Up @@ -7283,7 +7283,7 @@ function ble-edit/bind/.check-detach {
"Please run \`stty sane' to recover the correct TTY state."

if ((_ble_bash>=40000)); then
READLINE_LINE=' stty sane;' READLINE_POINT=10
READLINE_LINE=' stty sane;' READLINE_POINT=11
printf %s "$READLINE_LINE"
fi
fi
Expand Down
7 changes: 3 additions & 4 deletions src/util.sh
Expand Up @@ -1051,7 +1051,7 @@ else
function ble/util/readfile { # 465ms for man bash
[[ -r $2 && ! -d $2 ]] || return 1
local TMOUT= 2>/dev/null # #D1630 WA readonly TMOUT
IFS= builtin read "${_ble_bash_tmout_wa[@]}" -r -d '' "$1" < "$2"
IFS= builtin read -r -d '' "$1" < "$2"
return 0
}
function ble/util/mapfile {
Expand Down Expand Up @@ -1117,7 +1117,7 @@ else
local _ble_local_ret=$?
TMOUT= IFS= builtin read -r -d '' "$1" < "$_ble_local_tmpfile"
ble/util/assign/.rmtmp
builtin eval "$1=\${$1%$_ble_term_nl}"
builtin eval "$1=\${$1%\$_ble_term_nl}"
return "$_ble_local_ret"
}
fi
Expand Down Expand Up @@ -1265,8 +1265,7 @@ fi
## @param[in] command
## 種類を判定するコマンド名を指定します。
function ble/util/type {
ble/util/assign "$1" 'builtin type -t -- "$3" 2>/dev/null' "$2"
builtin eval "$1=\"\${$1%$_ble_term_nl}\""
ble/util/assign-array "$1" 'builtin type -a -t -- "$3" 2>/dev/null' "$2"
}

if ((_ble_bash>=40000)); then
Expand Down

0 comments on commit 78bbc5e

Please sign in to comment.