Skip to content

Commit

Permalink
rename $pure_color_prompt_on_error as $pure_color_prompt_on_error
Browse files Browse the repository at this point in the history
  • Loading branch information
edouard-lopez committed Jan 15, 2019
1 parent e347171 commit 7de59a3
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ You can tweak pretty much everything in `pure` by overriding variables in your `
| Option | Description | Default value |
| :------------------------------ | :------------- | :-------------------- |
| **`pure_symbol_prompt`** | Prompt symbol. | `` |
| **`pure_color_symbol_error`** | | `$pure_color_danger` |
| **`pure_color_prompt_on_error`** | | `$pure_color_danger` |
| **`pure_color_symbol_success`** | | `$pure_color_success` |

### Git
Expand Down
2 changes: 1 addition & 1 deletion conf.d/pure.fish
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ _pure_set_default pure_color_ssh_host $pure_color_mute
_pure_set_default pure_color_ssh_separator $pure_color_mute
_pure_set_default pure_color_ssh_user_normal $pure_color_mute
_pure_set_default pure_color_ssh_user_root $pure_color_light
_pure_set_default pure_color_symbol_error $pure_color_danger
_pure_set_default pure_color_prompt_on_error $pure_color_danger
_pure_set_default pure_color_symbol_success $pure_color_success
_pure_set_default pure_color_virtualenv $pure_color_mute

Expand Down
4 changes: 2 additions & 2 deletions functions/_pure_prompt_symbol.fish
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ function _pure_prompt_symbol \

set --local color_symbol $pure_color_symbol_success # default pure symbol color
if test $exit_code -ne 0
set color_symbol $pure_color_symbol_error # different pure symbol color when previous command failed
set color_symbol $pure_color_prompt_on_error # different pure symbol color when previous command failed

if test $pure_separate_prompt_on_error = true
set color_symbol "$pure_color_symbol_error$pure_symbol_prompt$pure_color_symbol_success"
set color_symbol "$pure_color_prompt_on_error$pure_symbol_prompt$pure_color_symbol_success"
end
end

Expand Down
6 changes: 3 additions & 3 deletions tests/_pure.test.fish
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,11 @@ test "configure: pure_color_ssh_user_root"
) = (set_color white)
end

test "configure: pure_color_symbol_error"
test "configure: pure_color_prompt_on_error"
(
set --erase pure_color_symbol_error
set --erase pure_color_prompt_on_error
source $DIRNAME/../conf.d/pure.fish
echo $pure_color_symbol_error
echo $pure_color_prompt_on_error
) = (set_color red)
end

Expand Down
2 changes: 1 addition & 1 deletion tests/_pure_prompt.test.fish
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ end

test "_pure_prompt: print prompt after failing command"
(
set pure_color_symbol_error (set_color red)
set pure_color_prompt_on_error (set_color red)
set pure_symbol_prompt '>' # using default ❯ break following tests
set --local last_command $failed

Expand Down
4 changes: 2 additions & 2 deletions tests/_pure_prompt_symbol.test.fish
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ test "_pure_prompt_symbol: colorizes prompt in red when last command failed"
(
set --local last_command $fail
set pure_symbol_prompt '>' # using default ❯ break following tests
set pure_color_symbol_error (set_color red)
set pure_color_prompt_on_error (set_color red)

_pure_prompt_symbol $last_command
) = (set_color red)'>'
Expand All @@ -38,7 +38,7 @@ test "_pure_prompt_symbol: add a magenta prompt when pure_separate_prompt_on_err
(
set --local last_command $fail
set pure_symbol_prompt '>' # using default ❯ break following tests
set pure_color_symbol_error (set_color red)
set pure_color_prompt_on_error (set_color red)
set pure_color_symbol_success (set_color magenta)
set pure_separate_prompt_on_error true

Expand Down

0 comments on commit 7de59a3

Please sign in to comment.