mirror of
https://github.com/wfxr/forgit.git
synced 2026-09-10 07:16:23 -04:00
fix: fix copy without newline (#141)
Don't known why `tr -d '\n'` inner fzf options doesn't work. Use `tr -d '[:space:]'` instead. It's OK for this scenario.
This commit is contained in:
parent
304a5aa268
commit
15383e6b4d
|
|
@ -42,7 +42,7 @@ function forgit::log -d "git commit viewer"
|
|||
$FORGIT_FZF_DEFAULT_OPTS
|
||||
+s +m --tiebreak=index
|
||||
--bind=\"enter:execute($cmd |env LESS='-r' less)\"
|
||||
--bind=\"ctrl-y:execute-silent(echo {} |grep -Eo '[a-f0-9]+' | head -1 | tr -d '\n' | $copy_cmd)\"
|
||||
--bind=\"ctrl-y:execute-silent(echo {} |grep -Eo '[a-f0-9]+' | head -1 | tr -d '[:space:]' |$copy_cmd)\"
|
||||
$FORGIT_LOG_FZF_OPTS
|
||||
"
|
||||
|
||||
|
|
@ -259,7 +259,7 @@ function forgit::rebase -d "git rebase "
|
|||
set opts "
|
||||
$FORGIT_FZF_DEFAULT_OPTS
|
||||
+s +m --tiebreak=index
|
||||
--bind=\"ctrl-y:execute-silent(echo {} |grep -Eo '[a-f0-9]+' | head -1 | tr -d '\n' |$copy_cmd)\"
|
||||
--bind=\"ctrl-y:execute-silent(echo {} |grep -Eo '[a-f0-9]+' | head -1 | tr -d '[:space:]' |$copy_cmd)\"
|
||||
$FORGIT_REBASE_FZF_OPTS
|
||||
"
|
||||
eval "$cmd" | FZF_DEFAULT_OPTS="$opts" fzf --preview="$preview" |
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ forgit::log() {
|
|||
$FORGIT_FZF_DEFAULT_OPTS
|
||||
+s +m --tiebreak=index
|
||||
--bind=\"enter:execute($cmd | LESS='-r' less)\"
|
||||
--bind=\"ctrl-y:execute-silent(echo {} |grep -Eo '[a-f0-9]+' | head -1 | tr -d '\n' |${FORGIT_COPY_CMD:-pbcopy})\"
|
||||
--bind=\"ctrl-y:execute-silent(echo {} |grep -Eo '[a-f0-9]+' | head -1 | tr -d '[:space:]' |${FORGIT_COPY_CMD:-pbcopy})\"
|
||||
$FORGIT_LOG_FZF_OPTS
|
||||
"
|
||||
graph=--graph
|
||||
|
|
@ -174,7 +174,7 @@ forgit::rebase() {
|
|||
opts="
|
||||
$FORGIT_FZF_DEFAULT_OPTS
|
||||
+s +m --tiebreak=index
|
||||
--bind=\"ctrl-y:execute-silent(echo {} |grep -Eo '[a-f0-9]+' | head -1 | tr -d '\n' |${FORGIT_COPY_CMD:-pbcopy})\"
|
||||
--bind=\"ctrl-y:execute-silent(echo {} |grep -Eo '[a-f0-9]+' | head -1 | tr -d '[:space:]' |${FORGIT_COPY_CMD:-pbcopy})\"
|
||||
$FORGIT_REBASE_FZF_OPTS
|
||||
"
|
||||
commit=$(eval "$cmd" | FZF_DEFAULT_OPTS="$opts" fzf --preview="$preview" |
|
||||
|
|
|
|||
Loading…
Reference in a new issue