root-highlighter: use EUID instead of id -u command

No need to fork every time.
This commit is contained in:
m0viefreak 2016-03-28 14:55:56 +02:00 committed by Daniel Shahaf
parent b52a485c5c
commit 38c8fbea2d

View file

@ -40,5 +40,5 @@ _zsh_highlight_root_highlighter_predicate()
# root highlighting function.
_zsh_highlight_root_highlighter()
{
if [[ $(command id -u) -eq 0 ]] { region_highlight+=("0 $#BUFFER $ZSH_HIGHLIGHT_STYLES[root]") }
if (( EUID == 0 )) { region_highlight+=("0 $#BUFFER $ZSH_HIGHLIGHT_STYLES[root]") }
}