Skip to content

Commit

Permalink
Calculate the length of the history only once
Browse files Browse the repository at this point in the history
  • Loading branch information
Baptiste Strazzulla committed Nov 21, 2024
1 parent ea60298 commit 7ba6e2c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions cider-repl-history.el
Original file line number Diff line number Diff line change
Expand Up @@ -636,16 +636,17 @@ HISTORY-BUF is the history, and optional arg REGEXP is a filter."
#'cider-repl-history-update-highlighted-entry
nil t))
(message
(let ((entry (if (= 1 (length cider-command-history))
"entry"
"entries")))
(let* ((history-length (length cider-command-history))
(entry (if (= 1 history-length)
"entry"
"entries")))
(concat
(if (and (not regexp)
cider-repl-history-display-duplicates)
(format "%s %s in the command history."
(length cider-command-history) entry)
history-length entry)
(format "%s (of %s) %s in the command history shown."
(length items) (length cider-command-history) entry))
(length items) history-length entry))
(substitute-command-keys
(concat " Type \\[cider-repl-history-quit] to quit. "
"\\[describe-mode] for help.")))))
Expand Down

0 comments on commit 7ba6e2c

Please sign in to comment.