From 9bd6a6da90aa6fde06563f60e6cdc3661c20f46d Mon Sep 17 00:00:00 2001 From: Frank LENORMAND Date: Fri, 31 Jul 2015 18:34:53 +0300 Subject: [PATCH] Set the maximum recursion depth to one to avoid unecessary high CPU usage --- rc/autorestore.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/autorestore.kak b/rc/autorestore.kak index ae9ace65..e66a3793 100644 --- a/rc/autorestore.kak +++ b/rc/autorestore.kak @@ -7,7 +7,7 @@ def -hidden _autorestore-restore-buffer %{ buffer_dirname=$(dirname "${kak_bufname}") ## Find the name of the latest backup created for the buffer that was open - latest_backup_path=$(find "${buffer_dirname}" -type f -readable -name ".${buffer_basename}.kak.*" -printf '%A@/%p\n' 2>/dev/null \ + latest_backup_path=$(find "${buffer_dirname}" -maxdepth 1 -type f -readable -name ".${buffer_basename}.kak.*" -printf '%A@/%p\n' 2>/dev/null \ | sort -n -t. -k1 | sed -nr 's/^.+\///;$p') test ! -z "${latest_backup_path}" || exit