diff --git a/rc/extra/autorestore.kak b/rc/extra/autorestore.kak index c0f6b08a..400c4e96 100644 --- a/rc/extra/autorestore.kak +++ b/rc/extra/autorestore.kak @@ -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${backup_path}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