Fix wrong file deleted after partial selection (#76)
It was deleting the file before the partial selection because `last_filename` was saved before filename was actually ready (so was actually saving the one before the last). Fixes #75.
This commit is contained in:
parent
d82337d226
commit
95cf774b0d
|
@ -181,9 +181,6 @@ while true; do
|
|||
rm -- "${last_filename[$selection]}"
|
||||
fi
|
||||
|
||||
last_data[$selection]=$data
|
||||
last_filename[$selection]=$filename
|
||||
|
||||
first_line=$(get_first_line "$data")
|
||||
|
||||
debug "New clipboard entry on $selection selection: \"$first_line\""
|
||||
|
@ -191,6 +188,9 @@ while true; do
|
|||
cache_file_output="$(date +%s%N) $first_line"
|
||||
filename="$cache_dir/$(cksum <<< "$first_line")"
|
||||
|
||||
last_data[$selection]=$data
|
||||
last_filename[$selection]=$filename
|
||||
|
||||
# Recover without restart if we deleted the entire clip dir.
|
||||
# It's ok that this only applies to the final directory.
|
||||
# shellcheck disable=SC2174
|
||||
|
|
Loading…
Reference in a new issue