diff --git a/README.md b/README.md index dcb90e2..9f8dfa6 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,9 @@ HSMW is **FAST** – highlighting 20 concurrent complex history entries does not # News +* 27-01-2017 + - Input-driven case-sensivity of search – if your query contains capital latin letters, search will be case-sensitive + * 12-11-2016 - HSMW can now show context of selected history entry! Just hit `Ctrl-K`, [video](https://asciinema.org/a/92516) - More performance optimizations diff --git a/history-search-multi-word b/history-search-multi-word index 1573f84..e4624eb 100644 --- a/history-search-multi-word +++ b/history-search-multi-word @@ -96,9 +96,13 @@ _hsmw_main() { if [[ "${#__hsmw_hcw_found[@]}" -eq "0" ]]; then # The repeat will make the matching work on a fresh heap arena repeat 1; do - # Tip: these are equal: - #__hsmw_hcw_found=( "${(@M)history:#(#i)*$~search_pattern*}" ) - [[ -z "$search_pattern" ]] && __hsmw_hcw_found=( ${(@)history} ) || __hsmw_hcw_found=( "${(@)history[(R)(#i)*$~search_pattern*]}" ) + if [[ "$search_pattern" != *[A-Z]* ]]; then + # Tip: these are equal: + #__hsmw_hcw_found=( "${(@M)history:#(#i)*$~search_pattern*}" ) + [[ -z "$search_pattern" ]] && __hsmw_hcw_found=( ${(@)history} ) || __hsmw_hcw_found=( "${(@)history[(R)(#i)*$~search_pattern*]}" ) + else + __hsmw_hcw_found=( "${(@)history[(R)*$~search_pattern*]}" ) + fi done fi