]> Sergey Matveev's repositories - zk.zsh.git/blobdiff - zk.zsh
Require []-brackets and more simple code because of that
[zk.zsh.git] / zk.zsh
diff --git a/zk.zsh b/zk.zsh
index 6073bb1edd5533ae450d23f65f2ed446de2d47d5..b8de2b3b8d050b8d7a9f630c1b760b8398066baf 100755 (executable)
--- a/zk.zsh
+++ b/zk.zsh
@@ -27,7 +27,8 @@ typeset -A links
 typeset -A backs
 for p (${(k)pages}) {
     for w (`< $p`) {
-        [[ $w =~ "^[([{].*" ]] && w=${MATCH[2,-2]}
+        [[ $w =~ "\[(.*)\]" ]] || continue
+        w=${match[1]}
         [[ ${pages[$w]} ]] || continue
         links[$p]="$w ${links[$p]}"
     }