From cbd0666ab65936646833ce7f4f1b7cb44c65a2fe Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Wed, 2 Mar 2016 20:45:47 +0200 Subject: [Fix #1570] Handle properly rest params in eldoc --- cider-eldoc.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'cider-eldoc.el') 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. -- cgit v1.2.3