1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-12-26 13:02:01 +03:00

Fix autorestore script when we have multiple restore files

This commit is contained in:
Maxime Coste 2017-01-30 00:10:31 +00:00
parent 632e05d830
commit 159c143757

View File

@ -19,10 +19,13 @@ def autorestore-restore-buffer -docstring "Restore the backup for the current fi
exit
fi
# Only get the most recent one
backup_path=$(ls -t $backup_path | head -n1)
printf %s\\n "
## Replace the content of the buffer with the content of the backup file
exec -draft %{ %d!cat<space>${backup_path}<ret>d }
echo -color Information 'Backup restored'
eval -client %val{client} echo -color Information 'Backup restored'
## If the backup file has to be removed, issue the command once
## the current buffer has been saved