Skip to content

Commit

Permalink
global: work around empty cache files by "tmux-resurrect"
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Jul 28, 2022
1 parent 8eb493a commit d7130d5
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
6 changes: 3 additions & 3 deletions ble-core.sh
Expand Up @@ -1478,10 +1478,10 @@ function ble-term/.initialize {
_ble_term_IFS=$' \t\n'
_ble_term_CR=$'\r'

if [[ $_ble_base/term.sh -nt $_ble_base_cache/$TERM.term ]]; then
source "$_ble_base/term.sh"
else
if [[ -s $_ble_base_cache/$TERM.term && $_ble_base_cache/$TERM.term -nt $_ble_base/term.sh ]]; then
source "$_ble_base_cache/$TERM.term"
else
source "$_ble_base/term.sh"
fi

_ble_util_string_prototype.reserve "$_ble_term_it"
Expand Down
6 changes: 3 additions & 3 deletions ble-decode.sh
Expand Up @@ -1583,7 +1583,7 @@ function ble-decode-bind/cmap/initialize {

local init=$_ble_base/cmap/default.sh
local dump=$_ble_base_cache/cmap+default.$_ble_decode_kbd_ver.$TERM.dump
if [[ $dump -nt $init ]]; then
if [[ -s $dump && $dump -nt $init ]]; then
source "$dump"
else
echo 'ble.sh: generating "'"$dump"'"...' 1>&2
Expand All @@ -1604,7 +1604,7 @@ function ble-decode-bind/cmap/initialize {
# 3文字以上 bind/unbind ソースの生成
local fbinder=$_ble_base_cache/cmap+default.binder-source
_ble_decode_bind_fbinder=$fbinder
if ! [[ $_ble_decode_bind_fbinder -nt $init ]]; then
if ! [[ -s $_ble_decode_bind_fbinder && $_ble_decode_bind_fbinder -nt $init ]]; then
echo -n 'ble.sh: initializing multichar sequence binders... '
ble-decode-bind/cmap/.generate-binder-template >| "$fbinder"
binder=ble-decode-bind/cmap/.emit-bindx source "$fbinder" >| "$fbinder.bind"
Expand Down Expand Up @@ -1731,7 +1731,7 @@ function ble-decode-bind/.generate-source-to-unbind-default/.process {

function ble-decode/bind {
local file=$_ble_base_cache/ble-decode-bind.$_ble_bash.$bleopt_input_encoding.bind
[[ $file -nt $_ble_base/bind.sh ]] || source "$_ble_base/bind.sh"
[[ -s $file && $file -nt $_ble_base/bind.sh ]] || source "$_ble_base/bind.sh"

# * 一時的に 'set convert-meta off' にする。
#
Expand Down
3 changes: 2 additions & 1 deletion keymap/emacs.sh
Expand Up @@ -244,7 +244,8 @@ function ble-decode/keymap:emacs/define {

function ble-decode/keymap:emacs/initialize {
local fname_keymap_cache=$_ble_base_cache/keymap.emacs
if [[ $fname_keymap_cache -nt $_ble_base/keymap/emacs.sh &&
if [[ -s $fname_keymap_cache &&
$fname_keymap_cache -nt $_ble_base/keymap/emacs.sh &&
$fname_keymap_cache -nt $_ble_base/cmap/default.sh ]]; then
source "$fname_keymap_cache" && return
fi
Expand Down
3 changes: 2 additions & 1 deletion keymap/vi.sh
Expand Up @@ -6962,7 +6962,8 @@ function ble-decode/keymap:vi_cmap/define {

function ble-decode/keymap:vi/initialize {
local fname_keymap_cache=$_ble_base_cache/keymap.vi
if [[ $fname_keymap_cache -nt $_ble_base/keymap/vi.sh &&
if [[ -s $fname_keymap_cache &&
$fname_keymap_cache -nt $_ble_base/keymap/vi.sh &&
$fname_keymap_cache -nt $_ble_base/cmap/default.sh ]]; then
source "$fname_keymap_cache" && return
fi
Expand Down
3 changes: 2 additions & 1 deletion keymap/vi_digraph.sh
Expand Up @@ -49,7 +49,8 @@ function ble-decode/keymap:vi_digraph/define {

function ble-decode/keymap:vi_digraph/initialize {
local fname_keymap_cache=$_ble_base_cache/keymap.vi_digraph
if [[ $fname_keymap_cache -nt $_ble_base/keymap/vi_digraph.sh &&
if [[ -s $fname_keymap_cache &&
$fname_keymap_cache -nt $_ble_base/keymap/vi_digraph.sh &&
$fname_keymap_cache -nt $_ble_base/keymap/vi_digraph.txt ]]; then
source "$fname_keymap_cache"
return
Expand Down

0 comments on commit d7130d5

Please sign in to comment.