mirror of
https://github.com/lotabout/skim.git
synced 2026-09-10 07:16:23 -04:00
[shell] make awk regex compatible with macOS default awk (#845)
Unlike GNU awk (gawk), the default awk on macOS does not support \s, making the previous expression not truly equivalent to the original perl command. This change replaces the entire first column with an empty string, achieving the same substitution effect in a portable way. refs https://github.com/junegunn/fzf/pull/2906
This commit is contained in:
parent
96b25952a4
commit
59f4f48395
|
|
@ -133,7 +133,7 @@ bindkey '\ec' skim-cd-widget
|
|||
skim-history-widget() {
|
||||
local selected num
|
||||
setopt localoptions noglobsubst noposixbuiltins pipefail no_aliases 2> /dev/null
|
||||
local awk_filter='{ cmd=$0; sub(/^\s*[0-9]+\**\s+/, "", cmd); if (!seen[cmd]++) print $0 }' # filter out duplicates
|
||||
local awk_filter='{ cmd=$0; sub(/^[ \t]*[0-9]+\**[ \t]+/, "", cmd); if (!seen[cmd]++) print $0 }' # filter out duplicates
|
||||
local n=2 fc_opts=''
|
||||
if [[ -o extended_history ]]; then
|
||||
local today=$(date +%Y-%m-%d)
|
||||
|
|
|
|||
Loading…
Reference in a new issue