update packages
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
|
||||
;; Author: Lars Andersen <expez@expez.com>
|
||||
;; URL: https://www.github.com/expez/company-quickhelp
|
||||
;; Package-Version: 20201208.2308
|
||||
;; Package-Commit: b13ff1ba0d6176825f165920b17625948f1256c5
|
||||
;; Package-Version: 20211115.1335
|
||||
;; Package-Commit: 3ca2708b4e5190205aca01d65fe1b391963a53f9
|
||||
;; Keywords: company popup documentation quickhelp
|
||||
;; Version: 2.2.0
|
||||
;; Package-Requires: ((emacs "24.3") (company "0.8.9") (pos-tip "0.4.6"))
|
||||
@@ -46,7 +46,7 @@
|
||||
"Documentation popups for `company-mode'"
|
||||
:group 'company)
|
||||
|
||||
(defcustom company-quickhelp-use-propertized-text nil
|
||||
(defcustom company-quickhelp-use-propertized-text t
|
||||
"Allow the text to have properties like color, font size, etc."
|
||||
:type '(choice (boolean :tag "Allow"))
|
||||
:group 'company-quickhelp)
|
||||
@@ -130,14 +130,14 @@ resolve ambiguous documentation requests. Instead of failing we
|
||||
just grab the first candidate and press forward."
|
||||
(car candidates))
|
||||
|
||||
(defun company-quickhelp--fetch-docstring (backend)
|
||||
"Fetch docstring from BACKEND."
|
||||
(let ((quickhelp-str (company-call-backend 'quickhelp-string backend)))
|
||||
(defun company-quickhelp--fetch-docstring (selected)
|
||||
"Fetch docstring from the current backend for SELECTED string."
|
||||
(let ((quickhelp-str (company-call-backend 'quickhelp-string selected)))
|
||||
(if (stringp quickhelp-str)
|
||||
(with-temp-buffer
|
||||
(insert quickhelp-str)
|
||||
(company-quickhelp--docstring-from-buffer (point-min)))
|
||||
(let ((doc (company-call-backend 'doc-buffer backend)))
|
||||
(let ((doc (company-call-backend 'doc-buffer selected)))
|
||||
(when doc
|
||||
;; The company backend can either return a buffer with the doc or a
|
||||
;; cons containing the doc buffer and a position at which to start
|
||||
@@ -148,15 +148,16 @@ just grab the first candidate and press forward."
|
||||
(company-quickhelp--docstring-from-buffer (or doc-begin (point-min))))))))))
|
||||
|
||||
(defun company-quickhelp--doc (selected)
|
||||
(cl-letf (((symbol-function 'completing-read)
|
||||
#'company-quickhelp--completing-read))
|
||||
(let* ((doc-and-meta (company-quickhelp--fetch-docstring selected))
|
||||
(truncated (plist-get doc-and-meta :truncated))
|
||||
(doc (plist-get doc-and-meta :doc)))
|
||||
(unless (member doc '(nil ""))
|
||||
(if truncated
|
||||
(concat doc "\n\n[...]")
|
||||
doc)))))
|
||||
(let ((message-log-max nil) (inhibit-message t))
|
||||
(cl-letf (((symbol-function 'completing-read)
|
||||
#'company-quickhelp--completing-read))
|
||||
(let* ((doc-and-meta (company-quickhelp--fetch-docstring selected))
|
||||
(truncated (plist-get doc-and-meta :truncated))
|
||||
(doc (plist-get doc-and-meta :doc)))
|
||||
(unless (member doc '(nil ""))
|
||||
(if truncated
|
||||
(concat doc "\n\n[...]")
|
||||
doc))))))
|
||||
|
||||
(defun company-quickhelp-manual-begin ()
|
||||
"Manually trigger the `company-quickhelp' popup for the
|
||||
@@ -206,7 +207,7 @@ currently active `company' completion candidate."
|
||||
(w-h (pos-tip-string-width-height doc)))
|
||||
(cond
|
||||
((> (car w-h) width)
|
||||
(setq doc (pos-tip-fill-string doc width nil 'none nil max-height)
|
||||
(setq doc (pos-tip-fill-string doc width nil nil nil max-height)
|
||||
w-h (pos-tip-string-width-height doc)))
|
||||
((or (> (car w-h) max-width)
|
||||
(> (cdr w-h) max-height))
|
||||
@@ -221,7 +222,7 @@ currently active `company' completion candidate."
|
||||
|
||||
(defun company-quickhelp--set-timer ()
|
||||
(when (or (null company-quickhelp--timer)
|
||||
(eq this-command #'company-quickhelp-manual-begin))
|
||||
(eq this-command #'company-quickhelp-manual-begin))
|
||||
(setq company-quickhelp--timer
|
||||
(run-with-idle-timer company-quickhelp-delay nil
|
||||
'company-quickhelp--show))))
|
||||
|
||||
Reference in New Issue
Block a user