emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] 16/52: Introduce company-tooltip-flip-when-above


From: Dmitry Gutov
Subject: [elpa] 16/52: Introduce company-tooltip-flip-when-above
Date: Tue, 01 Jul 2014 11:53:12 +0000

dgutov pushed a commit to branch master
in repository elpa.

commit 660b65e552ae1da305e3cd3f14ebc6fbc4f9cbc4
Author: Dmitry Gutov <address@hidden>
Date:   Thu May 29 02:54:09 2014 +0300

    Introduce company-tooltip-flip-when-above
    
    Closes #116
---
 NEWS.md    |    1 +
 company.el |    7 +++++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/NEWS.md b/NEWS.md
index 6206a36..6db3e21 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -3,6 +3,7 @@
 ## Next
 
 * `company-clang` uses the standard header search paths by default.
+* New user option `company-tooltip-flip-when-above`.
 
 ## 2014-04-19 (0.8.0)
 
diff --git a/company.el b/company.el
index 580304e..bbe15c1 100644
--- a/company.el
+++ b/company.el
@@ -264,6 +264,10 @@ This doesn't include the margins and the scroll bar."
   "When non-nil, align annotations to the right tooltip border."
   :type 'boolean)
 
+(defcustom company-tooltip-flip-when-above nil
+  "Whether to flip the tooltip when it's above the current line."
+  :type 'boolean)
+
 (defvar company-safe-backends
   '((company-abbrev . "Abbrev")
     (company-bbdb . "BBDB")
@@ -2121,6 +2125,9 @@ If SHOW-VERSION is non-nil, show the version in the echo 
area."
 (defun company--replacement-string (lines old column nl &optional align-top)
   (cl-decf column company-tooltip-margin)
 
+  (when (and align-top company-tooltip-flip-when-abovex)
+    (setq lines (reverse lines)))
+
   (let ((width (length (car lines)))
         (remaining-cols (- (+ (company--window-width) (window-hscroll))
                            column)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]