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

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

[elpa] externals/company 9c3fce6 3/4: Never cut off the margin since it


From: ELPA Syncer
Subject: [elpa] externals/company 9c3fce6 3/4: Never cut off the margin since it can contain useful info now
Date: Sun, 28 Mar 2021 22:57:07 -0400 (EDT)

branch: externals/company
commit 9c3fce68486481363bcf2c57c46a91b214248bb9
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>

    Never cut off the margin since it can contain useful info now
    
    #756
---
 company.el | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/company.el b/company.el
index cb64777..29182c1 100644
--- a/company.el
+++ b/company.el
@@ -2835,6 +2835,8 @@ If SHOW-VERSION is non-nil, show the version in the echo 
area."
 (defun company--replacement-string (lines column-offset old column nl 
&optional align-top)
   (cl-decf column column-offset)
 
+  (when (< column 0) (setq column 0))
+
   (when (and align-top company-tooltip-flip-when-above)
     (setq lines (reverse lines)))
 
@@ -2844,24 +2846,18 @@ If SHOW-VERSION is non-nil, show the version in the 
echo area."
     (when (> width remaining-cols)
       (cl-decf column (- width remaining-cols))))
 
-  (let ((offset (and (< column 0) (- column)))
-        new)
-    (when offset
-      (setq column 0))
+  (let (new)
     (when align-top
       ;; untouched lines first
       (dotimes (_ (- (length old) (length lines)))
         (push (pop old) new)))
     ;; length into old lines.
     (while old
-      (push (company-modify-line (pop old)
-                                 (company--offset-line (pop lines) offset)
-                                 column)
+      (push (company-modify-line (pop old) (pop lines) column)
             new))
     ;; Append whole new lines.
     (while lines
-      (push (concat (company-space-string column)
-                    (company--offset-line (pop lines) offset))
+      (push (concat (company-space-string column) (pop lines))
             new))
 
     ;; XXX: Also see branch 'more-precise-extend'.
@@ -2881,11 +2877,6 @@ If SHOW-VERSION is non-nil, show the version in the echo 
area."
       (when nl (put-text-property 0 1 'cursor t str))
       str)))
 
-(defun company--offset-line (line offset)
-  (if (and offset line)
-      (substring line offset)
-    line))
-
 (defun company--create-lines (selection limit)
   (let ((len company-candidates-length)
         (window-width (company--window-width))



reply via email to

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