Skip to content

Commit

Permalink
Add missing function _force_rehash()
Browse files Browse the repository at this point in the history
This fixes the error output `command not found: _force_rehash`
Refer to http://zshwiki.org/home/examples/compsys/general

增加缺失的函数 `_force_rehash()`
此提交修复错误输出 `未找到命令: _force_rehash`
参见 http://zshwiki.org/home/examples/compsys/general
  • Loading branch information
Firef0x committed Jan 14, 2015
1 parent bc05504 commit d69300a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions shell/pinyin-comp.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ function _pinyin_comp()
reply=($(pinyin-comp 0 $*))
}

# force rehash when command not found
# Refer to http://zshwiki.org/home/examples/compsys/general
_force_rehash() {
(( CURRENT == 1 )) && rehash
return 1 # Because we did not really complete anything
}

# pinyin-comp is performed as one part of user-expand
zstyle ':completion:*' user-expand _pinyin_comp

Expand Down

0 comments on commit d69300a

Please sign in to comment.