Skip to content

Commit cbd0666

Browse files
committed
[Fix #1570] Handle properly rest params in eldoc
1 parent a0cf94b commit cbd0666

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ and try to associate the created connection with this project automatically.
5353
* [#707](https://github.com/clojure-emacs/cider/issues/707): Better support clojure.test/with-test.
5454
* Fix namespace navigation in the namespace browser.
5555
* [#1565](https://github.com/clojure-emacs/cider/issues/1565): Fix font-locking in apropos buffers.
56+
* [#1570](https://github.com/clojure-emacs/cider/issues/1570): Handle properly rest params in eldoc.
5657

5758
## 0.10.2 / 2016-01-27
5859

cider-eldoc.el

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
(require 'cider-compat)
3636
(require 'cider-util)
3737

38-
(require 'cl-lib)
38+
(require 'seq)
3939

4040
(require 'eldoc)
4141

@@ -60,11 +60,12 @@ POS is the index of the currently highlighted argument."
6060
(mapconcat
6161
(lambda (arg)
6262
(let ((argstr (format "%s" arg)))
63-
(if (eq arg '&)
63+
(if (string= arg "&")
6464
argstr
6565
(prog1
6666
(if (or (= (1+ i) pos)
67-
(and rest-pos (> (+ 1 i) rest-pos)
67+
(and rest-pos
68+
(> (+ 1 i) rest-pos)
6869
(> pos rest-pos)))
6970
(propertize argstr 'face
7071
'eldoc-highlight-function-argument)
@@ -73,7 +74,7 @@ POS is the index of the currently highlighted argument."
7374

7475
(defun cider--find-rest-args-position (arglist)
7576
"Find the position of & in the ARGLIST vector."
76-
(cl-position '& (append arglist ())))
77+
(seq-position arglist "&"))
7778

7879
(defun cider-highlight-arglist (arglist pos)
7980
"Format the ARGLIST for eldoc.

0 commit comments

Comments
 (0)