hlissner / zsh-autopair

Auto-close and delete matching delimiters in zsh
MIT License
509 stars 37 forks source link

Variable localization #10

Closed disarmer closed 7 years ago

disarmer commented 7 years ago

Hi! I found some minor issue with autopair, it's using variable "i" for iterator, but it's not local. So it warns with WARN_CREATE_GLOBAL and may change global variable:

% setopt WARN_CREATE_GLOBAL; . ~/sh/zsh/autopair.zsh
autopair-init:5: scalar parameter i created globally in function autopair-init

If i define "local i" at line 143, it works perfectly

hlissner commented 7 years ago

Good catch! I'll fix this as soon as i get home tonight.