Skip to content

Commit 4ee70ab

Browse files
committed
Don't overwrite config with default values
otherwise users are obliged to set the config values *after* sourcing the plugin. They're not able to do it before. Also, re-sourcing the plugin will reset the values to the defaults again. A similar change was done in zsh-autosuggestions in the past: zsh-users/zsh-autosuggestions@9e4d3c3
1 parent 4f2f17c commit 4ee70ab

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ Configuration
115115
------------------------------------------------------------------------------
116116

117117
This script defines the following global variables. You may override their
118-
default values only after having loaded this script into your ZSH session.
118+
default values.
119119

120120
* `HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND` is a global variable that defines
121121
how the query should be highlighted inside a matching command. Its default

zsh-history-substring-search.zsh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@
4343
# declare global configuration variables
4444
#-----------------------------------------------------------------------------
4545

46-
typeset -g HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND='bg=magenta,fg=white,bold'
47-
typeset -g HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND='bg=red,fg=white,bold'
48-
typeset -g HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS='i'
49-
typeset -g HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE=''
50-
typeset -g HISTORY_SUBSTRING_SEARCH_FUZZY=''
51-
typeset -g HISTORY_SUBSTRING_SEARCH_PREFIX=''
46+
: ${HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND='bg=magenta,fg=white,bold'}
47+
: ${HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND='bg=red,fg=white,bold'}
48+
: ${HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS='i'}
49+
: ${HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE=''}
50+
: ${HISTORY_SUBSTRING_SEARCH_FUZZY=''}
51+
: ${HISTORY_SUBSTRING_SEARCH_PREFIX=''}
5252

5353
#-----------------------------------------------------------------------------
5454
# declare internal global variables

0 commit comments

Comments
 (0)