Browse Source

Prefer evaluation over test for arithmetic expression

Usage of `(( ... ))` over `[[ ... ]]` is preferred for arithmetic expression
since the former is less error prone.

Also, unset local variable whenever possible.
master
Indrajit Raychaudhuri 7 years ago committed by Kaleb Elwert
parent
commit
3f99519021
  1. 1
      CONTRIBUTING.md
  2. 5
      modules/completion/init.zsh

1
CONTRIBUTING.md

@ -30,6 +30,7 @@ there are a number of additional things to keep in mind.
- Local variables should be used whenever possible. - Local variables should be used whenever possible.
- Prefer `zstyle` over environment variables for configuration. - Prefer `zstyle` over environment variables for configuration.
- Prefer (( ... )) over [[ ... ]] for arithmetic expression.
- Use the function keyword to define functions. - Use the function keyword to define functions.
- The 80 character hard limit can be waved for readability. - The 80 character hard limit can be waved for readability.

5
modules/completion/init.zsh

@ -32,12 +32,13 @@ unsetopt FLOW_CONTROL # Disable start/stop characters in shell editor.
# cache time of 20 hours, so it should almost always regenerate the first time a # cache time of 20 hours, so it should almost always regenerate the first time a
# shell is opened each day. # shell is opened each day.
autoload -Uz compinit autoload -Uz compinit
compfiles=(${ZDOTDIR:-$HOME}/.zcompdump(Nm-20)) _comp_files=(${ZDOTDIR:-$HOME}/.zcompdump(Nm-20))
if [[ $#compfiles > 0 ]]; then if (( $#_comp_files )); then
compinit -i -C compinit -i -C
else else
compinit -i compinit -i
fi fi
unset _comp_files
# #
# Styles # Styles

Loading…
Cancel
Save