branch: externals/company
commit 2ca3e29abf87392714bc2b26e50e1c0f4b9f4e2c
Author: Dmitry Gutov <[email protected]>
Commit: Dmitry Gutov <[email protected]>
company-preview-show-at-point: Support completions containing newlines
Fixes #1367
---
company.el | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/company.el b/company.el
index 11f8b06767..9e98f6a90f 100644
--- a/company.el
+++ b/company.el
@@ -3741,6 +3741,10 @@ Delay is determined by `company-tooltip-idle-delay'."
(company-strip-prefix completion)
completion))
+ (when (string-prefix-p "\n" completion)
+ (setq completion (concat (propertize " " 'face 'company-preview) "\n"
+ (substring completion 1))))
+
(and (equal pos (point))
(not (equal completion ""))
(add-text-properties 0 1 '(cursor 1) completion))