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
Zzull committed Nov 10, 2023
1 parent 3d001d7 commit 959e5d3
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 @@ -638,16 +638,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 959e5d3

Please sign in to comment.