diff options
author | Bozhidar Batsov <bozhidar@batsov.com> | 2016-03-02 20:45:47 +0200 |
---|---|---|
committer | Bozhidar Batsov <bozhidar@batsov.com> | 2016-03-02 20:45:47 +0200 |
commit | cbd0666ab65936646833ce7f4f1b7cb44c65a2fe (patch) | |
tree | da015f54cec5fb519a6d8ad99420eb0d759cd8c2 | |
parent | a0cf94b078451f6ca734e958f98bdf714aaf31e0 (diff) |
[Fix #1570] Handle properly rest params in eldoc
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | cider-eldoc.el | 9 |
2 files changed, 6 insertions, 4 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 42f707b6..5997c534 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,7 @@ and try to associate the created connection with this project automatically. * [#707](https://github.com/clojure-emacs/cider/issues/707): Better support clojure.test/with-test. * Fix namespace navigation in the namespace browser. * [#1565](https://github.com/clojure-emacs/cider/issues/1565): Fix font-locking in apropos buffers. +* [#1570](https://github.com/clojure-emacs/cider/issues/1570): Handle properly rest params in eldoc. ## 0.10.2 / 2016-01-27 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. |