From 427a18c1ea35fd8b0ec06707b68ffca579ae50cf Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Tue, 25 Jun 2019 15:06:26 +0200 Subject: [PATCH] fish_git_prompt: Add a way to use the informative chars $__fish_git_prompt_use_informative_chars will use the informative chars without requiring informative mode (which is really frickin' slow!). See #5726. [ci skip] --- CHANGELOG.md | 1 + share/functions/fish_git_prompt.fish | 6 ++++-- sphinx_doc_src/cmds/fish_git_prompt.rst | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03103e527..220409049 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,7 @@ - `bosh` - `vagrant` - The git prompt in informative mode now shows the number of stashes if enabled. +- The git prompt now has an option ($__fish_git_prompt_use_informative_chars) to use the (more modern) informative characters without enabling informative mode. - The nextd and prevd functions no longer print "Hit end of history", instead using a BEL. - If fish_mode_prompt exists, vi-mode will only execute it on mode-switch instead of the entire prompt. This should make it much more responsive with slow prompts (#5783). - The path-component bindings (like ctrl-w) now also stop at ":" and "@" because those are used to denote user and host in ssh-likes (#5841). diff --git a/share/functions/fish_git_prompt.fish b/share/functions/fish_git_prompt.fish index 16b4e4a48..d3820bc67 100644 --- a/share/functions/fish_git_prompt.fish +++ b/share/functions/fish_git_prompt.fish @@ -689,7 +689,9 @@ function __fish_git_prompt_set_char end if set -q argv[3] - and set -q __fish_git_prompt_show_informative_status + and begin set -q __fish_git_prompt_show_informative_status + or set -q __fish_git_prompt_use_informative_chars + end set char $argv[3] end @@ -792,7 +794,7 @@ function __fish_git_prompt_validate_colors --description "fish_git_prompt helper end set -l varargs -for var in repaint describe_style show_informative_status showdirtystate showstashstate showuntrackedfiles showupstream +for var in repaint describe_style show_informative_status use_informative_chars showdirtystate showstashstate showuntrackedfiles showupstream set -a varargs --on-variable __fish_git_prompt_$var end function __fish_git_prompt_repaint $varargs --description "Event handler, repaints prompt when functionality changes" diff --git a/sphinx_doc_src/cmds/fish_git_prompt.rst b/sphinx_doc_src/cmds/fish_git_prompt.rst index 2bd1a914b..a89dd7bae 100644 --- a/sphinx_doc_src/cmds/fish_git_prompt.rst +++ b/sphinx_doc_src/cmds/fish_git_prompt.rst @@ -50,7 +50,7 @@ There are numerous customization options, which can be controlled with git optio - ``$__fish_git_prompt_showcolorhints`` can be set to enable coloring for the branch name and status symbols. -A number of variables set characters and color used as indicators. Many of these have a different default if used with informative status enabled. The usual default is given first, then the informative default (if it is different). If no default for the colors is given, they default to ``$__fish_git_prompt_color``. +A number of variables set characters and color used as indicators. Many of these have a different default if used with informative status enabled, or ``$__fish_git_prompt_use_informative_chars`` set. The usual default is given first, then the informative default (if it is different). If no default for the colors is given, they default to ``$__fish_git_prompt_color``. - ``$__fish_git_prompt_char_stateseparator`` (' ', `|`) - ``$__fish_git_prompt_color`` ('')