Skip to content

Commit 27ee872

Browse files
committed
lispy-inline.el (lispy--describe-inline): Add pos arg
1 parent d66bf60 commit 27ee872

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

lispy-inline.el

+14-13
Original file line numberDiff line numberDiff line change
@@ -218,19 +218,15 @@ The caller of `lispy--show' might use a substitute e.g. `describe-function'."
218218

219219
(declare-function geiser-doc-symbol-at-point "geiser-doc")
220220

221-
(defun lispy--describe-inline (str)
221+
(defun lispy--describe-inline (str pos)
222222
"Toggle the overlay hint."
223223
(condition-case nil
224-
(let ((new-hint-pos (lispy--hint-pos)))
225-
(if (and (eq lispy-hint-pos new-hint-pos)
226-
(overlayp lispy-overlay))
227-
(lispy--cleanup-overlay)
228-
(save-excursion
229-
(when (= 0 (count-lines (window-start) (point)))
230-
(recenter 1))
231-
(setq lispy-hint-pos new-hint-pos)
232-
(goto-char lispy-hint-pos)
233-
(lispy--show (propertize str 'face 'lispy-face-hint)))))
224+
(save-excursion
225+
(when (= 0 (count-lines (window-start) (point)))
226+
(recenter 1))
227+
(setq lispy-hint-pos pos)
228+
(goto-char lispy-hint-pos)
229+
(lispy--show (propertize str 'face 'lispy-face-hint)))
234230
(error
235231
(lispy--cleanup-overlay))))
236232

@@ -315,8 +311,13 @@ The caller of `lispy--show' might use a substitute e.g. `describe-function'."
315311
((eq major-mode 'scheme-mode)
316312
(geiser-doc-symbol-at-point))
317313
(t
318-
(lispy--describe-inline
319-
(lispy--docstring (lispy--current-function))))))
314+
(let ((new-hint-pos (lispy--hint-pos)))
315+
(if (and (eq lispy-hint-pos new-hint-pos)
316+
(overlayp lispy-overlay))
317+
(lispy--cleanup-overlay)
318+
(lispy--describe-inline
319+
(lispy--docstring (lispy--current-function))
320+
new-hint-pos))))))
320321

321322
(declare-function lispy--python-docstring "le-python")
322323
(declare-function lispy--python-arglist "le-python")

0 commit comments

Comments
 (0)