Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Commit

Permalink
Merge branch 'master' into fix-124
Browse files Browse the repository at this point in the history
  • Loading branch information
matchai authored Jan 9, 2019
2 parents 547df80 + 1b95e0b commit d837fb6
Show file tree
Hide file tree
Showing 25 changed files with 284 additions and 273 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# [2.0.0](https://github.com/matchai/spacefish/compare/v1.12.4...v2.0.0) (2019-01-09)


### Bug Fixes

* remove color from prefix/suffix ([#133](https://github.com/matchai/spacefish/issues/133)) ([319f0b0](https://github.com/matchai/spacefish/commit/319f0b0))


### BREAKING CHANGES

* Because prefix and suffix colors are no longer set to #fff, the color of prefix and suffix will be set to the default foreground color of your shell.
2 changes: 1 addition & 1 deletion fish_prompt.fish
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function fish_prompt
# Store the exit code of the last command
set -g sf_exit_code $status
set -g SPACEFISH_VERSION 1.12.4
set -g SPACEFISH_VERSION 2.0.0

# ------------------------------------------------------------------------------
# Configuration
Expand Down
4 changes: 2 additions & 2 deletions functions/__sf_lib_section.fish
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function __sf_lib_section -a color prefix content suffix

if test "$sf_prompt_opened" = "true" -a "$SPACEFISH_PROMPT_PREFIXES_SHOW" = "true"
# Echo prefixes in bold white
set_color --bold fff
set_color --bold
echo -e -n -s $prefix
set_color normal
end
Expand All @@ -21,7 +21,7 @@ function __sf_lib_section -a color prefix content suffix

if test "$SPACEFISH_PROMPT_SUFFIXES_SHOW" = "true"
# Echo suffixes in bold white
set_color --bold fff
set_color --bold
echo -e -n -s $suffix
set_color normal
end
Expand Down
2 changes: 1 addition & 1 deletion functions/__sf_section_dir.fish
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function __sf_section_dir -d "Display the current truncated directory"
set dir (__sf_util_truncate_dir $tmp $SPACEFISH_DIR_TRUNC)

if [ $SPACEFISH_DIR_LOCK_SHOW = true -a ! -w . ]
set DIR_LOCK_SYMBOL (set_color $SPACEFISH_DIR_LOCK_COLOR)" $SPACEFISH_DIR_LOCK_SYMBOL"(set_color --bold fff)
set DIR_LOCK_SYMBOL (set_color $SPACEFISH_DIR_LOCK_COLOR)" $SPACEFISH_DIR_LOCK_SYMBOL"(set_color --bold)
end

__sf_lib_section \
Expand Down
26 changes: 13 additions & 13 deletions tests/__sf_lib_section.test.fish
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@ end

test "Displays only the colored content when 2 arguments are passed"
(
set_color --bold fff
set_color --bold
echo -n ""
set_color normal
set_color --bold red
echo -n "test content"
set_color normal
set_color --bold fff
set_color --bold
echo -n ""
set_color normal
) = (__sf_lib_section red "test content")
end

test "Displays the prefix, colored content and suffix when 4 arguments are passed"
(
set_color --bold fff
set_color --bold
echo -n "prefix"
set_color normal
set_color --bold red
echo -n "test content"
set_color normal
set_color --bold fff
set_color --bold
echo -n "suffix"
set_color normal
) = (__sf_lib_section red prefix "test content" suffix)
Expand All @@ -36,13 +36,13 @@ test "Displays the prefix if prefixes are enabled"
(
set SPACEFISH_PROMPT_PREFIXES_SHOW true

set_color --bold fff
set_color --bold
echo -n "prefix"
set_color normal
set_color --bold red
echo -n "test content"
set_color normal
set_color --bold fff
set_color --bold
echo -n "suffix"
set_color normal
) = (__sf_lib_section red prefix "test content" suffix)
Expand All @@ -55,7 +55,7 @@ test "Doesn't display the prefix if prefixes are disabled"
set_color --bold red
echo -n "test content"
set_color normal
set_color --bold fff
set_color --bold
echo -n "suffix"
set_color normal
) = (__sf_lib_section red prefix "test content" suffix)
Expand All @@ -65,13 +65,13 @@ test "Displays the suffix if suffixes are enabled"
(
set SPACEFISH_PROMPT_SUFFIXES_SHOW true

set_color --bold fff
set_color --bold
echo -n "prefix"
set_color normal
set_color --bold red
echo -n "test content"
set_color normal
set_color --bold fff
set_color --bold
echo -n "suffix"
set_color normal
) = (__sf_lib_section red prefix "test content" suffix)
Expand All @@ -81,7 +81,7 @@ test "Doesn't display the suffix if suffixes are disabled"
(
set SPACEFISH_PROMPT_SUFFIXES_SHOW false

set_color --bold fff
set_color --bold
echo -n "prefix"
set_color normal
set_color --bold red
Expand All @@ -97,17 +97,17 @@ test "Only prints the prefix for the second consecutive section"
set_color --bold red
echo -n "test content 1"
set_color normal
set_color --bold fff
set_color --bold
echo -n "suffix 1"
set_color normal

set_color --bold fff
set_color --bold
echo -n "prefix 2"
set_color normal
set_color --bold red
echo -n "test content 2"
set_color normal
set_color --bold fff
set_color --bold
echo -n "suffix 2"
set_color normal
) = (
Expand Down
16 changes: 8 additions & 8 deletions tests/__sf_section_aws.test.fish
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ end

test "Prints section when AWS_PROFILE is set"
(
set_color --bold fff
set_color --bold
echo -n "using "
set_color normal
set_color --bold ff8700
echo -n "☁️ user1"
set_color normal
set_color --bold fff
set_color --bold
echo -n " "
set_color normal
) = (__sf_section_aws)
Expand All @@ -37,13 +37,13 @@ test "Changing SPACEFISH_AWS_SYMBOL changes the displayed character"
(
set SPACEFISH_AWS_SYMBOL "· "

set_color --bold fff
set_color --bold
echo -n "using "
set_color normal
set_color --bold ff8700
echo -n "· user1"
set_color normal
set_color --bold fff
set_color --bold
echo -n " "
set_color normal
) = (__sf_section_aws)
Expand All @@ -54,13 +54,13 @@ test "Changing SPACEFISH_AWS_PREFIX changes the character prefix"
set sf_exit_code 0
set SPACEFISH_AWS_PREFIX ·

set_color --bold fff
set_color --bold
echo -n "·"
set_color normal
set_color --bold ff8700
echo -n "☁️ user1"
set_color normal
set_color --bold fff
set_color --bold
echo -n " "
set_color normal
) = (__sf_section_aws)
Expand All @@ -71,13 +71,13 @@ test "Changing SPACEFISH_AWS_SUFFIX changes the character suffix"
set sf_exit_code 0
set SPACEFISH_AWS_SUFFIX ·

set_color --bold fff
set_color --bold
echo -n "using "
set_color normal
set_color --bold ff8700
echo -n "☁️ user1"
set_color normal
set_color --bold fff
set_color --bold
echo -n "·"
set_color normal
) = (__sf_section_aws)
Expand Down
20 changes: 10 additions & 10 deletions tests/__sf_section_char.test.fish
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ test "Displays default char with status code 0"
(
set sf_exit_code 0

set_color --bold fff
set_color --bold
echo -n ""
set_color normal
set_color --bold green
echo -n ""
set_color normal
set_color --bold fff
set_color --bold
echo -n " "
set_color normal
) = (__sf_section_char)
Expand All @@ -24,13 +24,13 @@ test "Displays default char with status code 1"
(
set sf_exit_code 1

set_color --bold fff
set_color --bold
echo -n ""
set_color normal
set_color --bold red
echo -n ""
set_color normal
set_color --bold fff
set_color --bold
echo -n " "
set_color normal
) = (__sf_section_char)
Expand All @@ -41,13 +41,13 @@ test "Changing SPACEFISH_CHAR_SYMBOL changes the displayed character"
set sf_exit_code 0
set SPACEFISH_CHAR_SYMBOL ·

set_color --bold fff
set_color --bold
echo -n ""
set_color normal
set_color --bold green
echo -n "·"
set_color normal
set_color --bold fff
set_color --bold
echo -n " "
set_color normal
) = (__sf_section_char)
Expand All @@ -58,13 +58,13 @@ test "Changing SPACEFISH_CHAR_PREFIX changes the character prefix"
set sf_exit_code 0
set SPACEFISH_CHAR_PREFIX ·

set_color --bold fff
set_color --bold
echo -n "·"
set_color normal
set_color --bold green
echo -n ""
set_color normal
set_color --bold fff
set_color --bold
echo -n " "
set_color normal
) = (__sf_section_char)
Expand All @@ -75,13 +75,13 @@ test "Changing SPACEFISH_CHAR_SYMBOL changes the character suffix"
set sf_exit_code 0
set SPACEFISH_CHAR_SUFFIX ·

set_color --bold fff
set_color --bold
echo -n ""
set_color normal
set_color --bold green
echo -n ""
set_color normal
set_color --bold fff
set_color --bold
echo -n "·"
set_color normal
) = (__sf_section_char)
Expand Down
12 changes: 6 additions & 6 deletions tests/__sf_section_conda.test.fish
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ test "Prints section when conda is installed and CONDA_DEFAULT_ENV is set"
(
set -g CONDA_DEFAULT_ENV some-env

set_color --bold fff
set_color --bold
echo -n "via "
set_color normal
set_color --bold blue
echo -n "🅒 v$LOCAL_CONDA_VERSION"
set_color normal
set_color --bold fff
set_color --bold
echo -n " "
set_color normal
) = (__sf_section_conda)
Expand All @@ -37,13 +37,13 @@ test "Changing SPACEFISH_CONDA_SYMBOL changes the displayed character"
set SPACEFISH_CONDA_SYMBOL "· "
set -g CONDA_DEFAULT_ENV some-env

set_color --bold fff
set_color --bold
echo -n "via "
set_color normal
set_color --bold blue
echo -n "· v$LOCAL_CONDA_VERSION"
set_color normal
set_color --bold fff
set_color --bold
echo -n " "
set_color normal
) = (__sf_section_conda)
Expand All @@ -54,13 +54,13 @@ test "Changing SPACEFISH_CONDA_PREFIX changes the character prefix"
set SPACEFISH_CONDA_PREFIX ·
set -g CONDA_DEFAULT_ENV some-env

set_color --bold fff
set_color --bold
echo -n "·"
set_color normal
set_color --bold blue
echo -n "🅒 v$LOCAL_CONDA_VERSION"
set_color normal
set_color --bold fff
set_color --bold
echo -n " "
set_color normal
) = (__sf_section_conda)
Expand Down
Loading

0 comments on commit d837fb6

Please sign in to comment.