From 6685aac42cf1feb0c686ef84516c97e1113678a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 10 Nov 2016 19:46:15 +0100 Subject: [PATCH] dircycle: fix error on insert-cycledleft if dirstack is empty --- plugins/dircycle/dircycle.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/dircycle/dircycle.plugin.zsh b/plugins/dircycle/dircycle.plugin.zsh index 2f32277cf..8c58cab4c 100644 --- a/plugins/dircycle/dircycle.plugin.zsh +++ b/plugins/dircycle/dircycle.plugin.zsh @@ -9,6 +9,8 @@ # pushd -N: start counting from right of `dirs' output switch-to-dir () { + [[ ${#dirstack} -eq 0 ]] && return + while ! builtin pushd -q $1 &>/dev/null; do # We found a missing directory: pop it out of the dir stack builtin popd -q $1