Skip to content

Commit

Permalink
refactor pure_separate_prompt_on_error as a boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
edouard-lopez committed Jan 2, 2019
1 parent 3405626 commit 74f028d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ set pure_root_color $pure_color_red
set pure_user_host_location 1
# Show exit code of last command as a separate prompt character. As described here: https://github.com/sindresorhus/pure/wiki#show-exit-code-of-last-command-as-a-separate-prompt-character
# 0 - single prompt character, default
# 1 - separate prompt character
# false - single prompt character, default
# true - separate prompt character
# Any other value defaults to the default behaviour
set pure_separate_prompt_on_error 1
set pure_separate_prompt_on_error true
# Max execution time of a process before its run time is shown when it exits
set pure_command_max_exec_time 5
Expand Down
6 changes: 3 additions & 3 deletions conf.d/pure.fish
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ _pure_set_default pure_root_color $pure_color_normal
_pure_set_default pure_user_host_location 0

# Show exit code of last command as a separate prompt character. As described here: https://github.com/sindresorhus/pure/wiki#show-exit-code-of-last-command-as-a-separate-prompt-character
# 0 - single prompt character, default
# 1 - separate prompt character
# false - single prompt character, default
# true - separate prompt character
# Any other value defaults to the default behaviour
_pure_set_default pure_separate_prompt_on_error 0
_pure_set_default pure_separate_prompt_on_error false

# Max execution time of a process before its run time is shown when it exits
_pure_set_default pure_command_max_exec_time 5
2 changes: 1 addition & 1 deletion functions/_pure_prompt_symbol.fish
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function _pure_prompt_symbol --argument-names exit_code
if test $exit_code -ne 0
set color_symbol $pure_color_red # pure symbol is red when previous command failed

if test $pure_separate_prompt_on_error -eq 1
if test $pure_separate_prompt_on_error = true
set color_symbol "$pure_color_red$pure_symbol_prompt$pure_color_magenta"
end
end
Expand Down
2 changes: 1 addition & 1 deletion tests/_pure_prompt_symbol.test.fish
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ test "add a magenta prompt when pure_separate_prompt_on_error is enable and last
set pure_symbol_prompt '>' # using default ❯ break following tests
set pure_color_red (set_color red)
set pure_color_magenta (set_color magenta)
set pure_separate_prompt_on_error 1
set pure_separate_prompt_on_error true


_pure_prompt_symbol $last_command
Expand Down

0 comments on commit 74f028d

Please sign in to comment.