subnixr / minimal

A minimal zsh theme
GNU General Public License v3.0
259 stars 23 forks source link

Fix unknown file attribute error #17

Closed aaronlna closed 6 years ago

aaronlna commented 6 years ago

Older versions of ZSH (pre 5.1) are unable to define local arrays in single lines.

Reproducing the issue locally:

$ zsh --version
zsh 5.0.7 (x86_64-unknown-linux-gnu)
$ source ~/.zshrc
_mnml_bind_widgets:3: unknown file attribute: z

In order to fix this I just modified all local arrays to be initialized on a previous line. This also seems forwards compatible and works for my other host which is running zsh 5.2 (x86_64-apple-darwin16.0)

# before
local to_bind=(zle-line-init zle-keymap-select buffer-empty)
# after
local -a to_bind
to_bind=(zle-line-init zle-keymap-select buffer-empty)

Sources:

subnixr commented 6 years ago

This is sweet, thanks for the PR!