summaryrefslogtreecommitdiff
path: root/cider-eldoc.el
diff options
context:
space:
mode:
authorBozhidar Batsov <bozhidar@batsov.com>2016-03-02 20:45:47 +0200
committerBozhidar Batsov <bozhidar@batsov.com>2016-03-02 20:45:47 +0200
commitcbd0666ab65936646833ce7f4f1b7cb44c65a2fe (patch)
treeda015f54cec5fb519a6d8ad99420eb0d759cd8c2 /cider-eldoc.el
parenta0cf94b078451f6ca734e958f98bdf714aaf31e0 (diff)
[Fix #1570] Handle properly rest params in eldoc
Diffstat (limited to 'cider-eldoc.el')
-rw-r--r--cider-eldoc.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/cider-eldoc.el b/cider-eldoc.el
index a94b396d..38f957a6 100644
--- a/cider-eldoc.el
+++ b/cider-eldoc.el
@@ -35,7 +35,7 @@
(require 'cider-compat)
(require 'cider-util)
-(require 'cl-lib)
+(require 'seq)
(require 'eldoc)
@@ -60,11 +60,12 @@ POS is the index of the currently highlighted argument."
(mapconcat
(lambda (arg)
(let ((argstr (format "%s" arg)))
- (if (eq arg '&)
+ (if (string= arg "&")
argstr
(prog1
(if (or (= (1+ i) pos)
- (and rest-pos (> (+ 1 i) rest-pos)
+ (and rest-pos
+ (> (+ 1 i) rest-pos)
(> pos rest-pos)))
(propertize argstr 'face
'eldoc-highlight-function-argument)
@@ -73,7 +74,7 @@ POS is the index of the currently highlighted argument."
(defun cider--find-rest-args-position (arglist)
"Find the position of & in the ARGLIST vector."
- (cl-position '& (append arglist ())))
+ (seq-position arglist "&"))
(defun cider-highlight-arglist (arglist pos)
"Format the ARGLIST for eldoc.