From 3a843cb1b183bd853b843fbaef89af27b726ac25 Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Fri, 14 Feb 2014 19:34:49 -0500 Subject: [PATCH] Add arglists to the omnicomplete preview window When you use omnicomplete the arglists of functions are shown in the popup menu and the docstrings in the preview window. This patch adds the arglists into the preview window too. This is handy because once you select a completion you'll still be able to see the arglists as you write the rest of the form. --- plugin/fireplace.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/fireplace.vim b/plugin/fireplace.vim index 9527c9f..7a4e766 100644 --- a/plugin/fireplace.vim +++ b/plugin/fireplace.vim @@ -87,8 +87,8 @@ function! fireplace#omnicomplete(findstart, base) abort return col('.') - strlen(matchstr(line, '\k\+$')) - 1 else try - let omnifier = '(fn [[k v]] (let [m (meta v)]' . - \ ' {:word k :menu (pr-str (:arglists m (symbol ""))) :info (str " " (:doc m)) :kind (if (:arglists m) "f" "v")}))' + let omnifier = '(fn [[k v]] (let [{:keys [arglists] :as m} (meta v)]' . + \ ' {:word k :menu (pr-str (or arglists (symbol ""))) :info (str (when arglists (str arglists "\n")) " " (:doc m)) :kind (if arglists "f" "v")}))' let ns = fireplace#ns()