fix(beancount): hangs when completion cache is empty

This commit is contained in:
Henrik Lissner
2025-05-22 21:15:19 +02:00
parent 5df769e994
commit cfea950e60

View File

@ -63,8 +63,9 @@ will theirs, recursively)."
(with-current-buffer (let ((win (minibuffer-selected-window)))
(if (window-live-p win) (window-buffer win)
(current-buffer)))
(with-memoization (alist-get context +beancount--completion-cache)
(+beancount--collect-unique-recursive regexp n context))
(unless (assq context +beancount--completion-cache)
(with-memoization (alist-get context +beancount--completion-cache)
(+beancount--collect-unique-recursive regexp n context)))
(complete-with-action
action (sort (hash-table-keys
(alist-get context +beancount--completion-cache))