fix(emacs/lean-company): override company--window-width

Override 'company--window-width' to be 0.95 * window-body-width.
This partially solves the problem of issue #137.
This commit is contained in:
Soonho Kong 2014-09-05 23:06:02 -07:00
parent bd17d07ebc
commit 0476591992

View file

@ -35,6 +35,7 @@ triggers a completion immediately."
(let ((line-number (line-number-at-pos)))
(lean-server-send-cmd-sync (lean-cmd-findp line-number prefix)
(lambda (candidates)
(lean-server-debug "executing continuation for FINDP")
(-map 'company-lean--make-candidate candidates)))))
(defun company-lean--location (arg)
@ -72,4 +73,9 @@ triggers a completion immediately."
(location (company-lean--location arg))
(sorted t)))
(defadvice company--window-width
(after lean-company--window-width activate)
(when (eq major-mode 'lean-mode)
(setq ad-return-value (truncate (* 0.95 (window-body-width))))))
(provide 'lean-company)