@@ -194,9 +194,6 @@ CIDER 1.7."
194
194
This property value must be unique to avoid having adjacent inputs be
195
195
joined together." )
196
196
197
- (defvar-local cider-repl-input-history-items-added 0
198
- " Variable counting the items added in the current session." )
199
-
200
197
(defvar-local cider-repl-output-start nil
201
198
" Marker for the start of output.
202
199
Currently its only purpose is to facilitate `cider-repl-clear-buffer' ." )
@@ -1473,8 +1470,7 @@ WIN, BUFFER and POS are the window, buffer and point under mouse position."
1473
1470
Empty strings and duplicates are ignored."
1474
1471
(unless (or (equal string " " )
1475
1472
(equal string (car cider-repl-input-history)))
1476
- (push string cider-repl-input-history)
1477
- (cl-incf cider-repl-input-history-items-added)))
1473
+ (push string cider-repl-input-history)))
1478
1474
1479
1475
(defun cider-repl-delete-current-input ()
1480
1476
" Delete all text after the prompt."
@@ -1647,11 +1643,9 @@ The value of `cider-repl-input-history' is set by this function."
1647
1643
" Write history to FILENAME.
1648
1644
Currently coding system for writing the contents is hardwired to
1649
1645
utf-8-unix."
1650
- (let* ((mhist (cider-repl--histories-merge cider-repl-input-history
1651
- cider-repl-input-history-items-added
1652
- (cider-repl--history-read filename)))
1646
+ (let* ((end (min (length cider-repl-input-history) cider-repl-history-size))
1653
1647
; ; newest items are at the beginning of the list, thus 0
1654
- (hist (cl-subseq mhist 0 ( min ( length mhist) cider-repl-history-size) )))
1648
+ (hist (cl-subseq cider-repl-input-history 0 end )))
1655
1649
(unless (file-writable-p filename)
1656
1650
(error (format " History file not writable: %s " filename)))
1657
1651
(let ((print-length nil ) (print-level nil ))
@@ -1683,16 +1677,6 @@ constructs."
1683
1677
(when (equal major-mode 'cider-repl-mode )
1684
1678
(cider-repl-history-just-save)))))
1685
1679
1686
- ; ; SLIME has different semantics and will not save any duplicates.
1687
- ; ; we keep track of how many items were added to the history in the
1688
- ; ; current session in `cider-repl--add-to-input-history' and merge only the
1689
- ; ; new items with the current history found in the file, which may
1690
- ; ; have been changed in the meantime by another session.
1691
- (defun cider-repl--histories-merge (session-hist n-added-items file-hist )
1692
- " Merge histories from SESSION-HIST adding N-ADDED-ITEMS into FILE-HIST."
1693
- (append (cl-subseq session-hist 0 n-added-items)
1694
- file-hist))
1695
-
1696
1680
1697
1681
; ;; REPL shortcuts
1698
1682
(defcustom cider-repl-shortcut-dispatch-char ?\,
0 commit comments