Make emacs-bookmark.zsh work on older versions of zsh
This commit is contained in:
parent
7c85a1d3ee
commit
b5c3ea0edb
@ -151,7 +151,7 @@ function bm {
|
||||
if (( ${#__bm_res} != 0 )) && [[ -e "${bm_loc}" ]]; then
|
||||
if [[ -d "${target}" ]]; then
|
||||
cd "${target}"
|
||||
(( "${BM_CWD_LS:-0}" )) && ls || true
|
||||
[[ "${BM_CWD_LS}" == 'true' ]] && ls || true
|
||||
elif [[ -e "${bm_loc}" ]]; then
|
||||
let offset="${__bm_res[2]}"
|
||||
local rowcol=(${(0)"$(__bm_offset_to_row_col "${bm_loc}" "${offset}")"})
|
||||
@ -289,7 +289,7 @@ compdef _bmrm bmrm
|
||||
|
||||
function __bm_precmd_hook {
|
||||
# Auto reload
|
||||
if (( "${BM_AUTO_RELOAD:-0}" )) &&
|
||||
if [[ "${BM_AUTO_RELOAD}" == 'true' ]] &&
|
||||
(( ${__bm_last_read_time} < "$(zstat +mtime "${BM_BOOKMARK_PATH}")" )); then
|
||||
__bm_update_bookmark_list
|
||||
fi
|
||||
|
4
init.zsh
4
init.zsh
@ -272,9 +272,9 @@ fi
|
||||
|
||||
# Bookmarks
|
||||
if cmd_exists emacs; then
|
||||
[[ -v BM_CWD_LS ]] || BM_CWD_LS=1
|
||||
[[ -v BM_CWD_LS ]] || BM_CWD_LS=true
|
||||
[[ -v BM_MODE ]] || BM_MODE=daemon
|
||||
[[ -v BM_AUTO_RELOAD ]] || BM_AUTO_RELOAD=1
|
||||
[[ -v BM_AUTO_RELOAD ]] || BM_AUTO_RELOAD=true
|
||||
source "${ZSH_CONFIG_DIR}/emacs-bookmark.zsh"
|
||||
fi
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user