[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 02/16: Fix popup when prefix is split by line continuation
From: |
Dmitry Gutov |
Subject: |
[elpa] 02/16: Fix popup when prefix is split by line continuation |
Date: |
Sat, 26 Jul 2014 04:53:18 +0000 |
dgutov pushed a commit to branch master
in repository elpa.
commit c9b3a62d54118300910bb18e476d43d1acc731e8
Author: Dmitry Gutov <address@hidden>
Date: Mon Jul 14 05:56:17 2014 +0300
Fix popup when prefix is split by line continuation
#149
---
company-tests.el | 4 ++--
company.el | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/company-tests.el b/company-tests.el
index 14b18bc..8bc8572 100644
--- a/company-tests.el
+++ b/company-tests.el
@@ -461,7 +461,7 @@
(cdr (assoc arg '(("123" . "(4)")))))))
(company-candidates '("123" "45"))
company-tooltip-align-annotations)
- (company-pseudo-tooltip-show-at-point (point))
+ (company-pseudo-tooltip-show-at-point (point) 0)
(let ((ov company-pseudo-tooltip-overlay))
;; With margins.
(should (eq (overlay-get ov 'company-width) 8))
@@ -482,7 +482,7 @@
("67" . "(891011)")))))))
(company-candidates '("123" "45" "67"))
(company-tooltip-align-annotations t))
- (company-pseudo-tooltip-show-at-point (point))
+ (company-pseudo-tooltip-show-at-point (point) 0)
(let ((ov company-pseudo-tooltip-overlay))
;; With margins.
(should (eq (overlay-get ov 'company-width) 13))
diff --git a/company.el b/company.el
index f6c5265..8049e37 100644
--- a/company.el
+++ b/company.el
@@ -2387,9 +2387,10 @@ Returns a negative number if the tooltip should be
displayed above point."
(overlay-put ov 'company-column column)
(overlay-put ov 'company-height height)))))
-(defun company-pseudo-tooltip-show-at-point (pos)
+(defun company-pseudo-tooltip-show-at-point (pos column-offset)
(let ((row (company--row pos))
- (col (company--column pos)))
+ (col (- (company--column pos) column-offset)))
+ (when (< col 0) (setq col 0))
(company-pseudo-tooltip-show (1+ row) col company-selection)))
(defun company-pseudo-tooltip-edit (selection)
@@ -2445,8 +2446,7 @@ Returns a negative number if the tooltip should be
displayed above point."
(overlay-get company-pseudo-tooltip-overlay
'company-guard)))
;; Redraw needed.
- (company-pseudo-tooltip-show-at-point (- (point)
- (length company-prefix)))
+ (company-pseudo-tooltip-show-at-point (point) (length company-prefix))
(overlay-put company-pseudo-tooltip-overlay
'company-guard (company-pseudo-tooltip-guard))))
(company-pseudo-tooltip-unhide))
- [elpa] 08/16: company-sort-by-occurrence: allow customizing the weighing logic, (continued)
- [elpa] 08/16: company-sort-by-occurrence: allow customizing the weighing logic, Dmitry Gutov, 2014/07/26
- [elpa] 11/16: company-css-property-value-regexp: prohibit opening curlies, Dmitry Gutov, 2014/07/26
- [elpa] 13/16: Fix company-occurrence-weight-function, Dmitry Gutov, 2014/07/26
- [elpa] 12/16: company-css-property-values: delete duplicates, Dmitry Gutov, 2014/07/26
- [elpa] 10/16: company-capf: get rid of caching last capf-data, Dmitry Gutov, 2014/07/26
- [elpa] 14/16: Fix tests in batch mode, Dmitry Gutov, 2014/07/26
- [elpa] 01/16: company-frontends-set: never modify VALUE destructively, Dmitry Gutov, 2014/07/26
- [elpa] 15/16: Release 0.8.2, Dmitry Gutov, 2014/07/26
- [elpa] 16/16: Merge commit 'b1d019a4c815ac8bdc240d69eaa74eb4e34640e8' from company-master, Dmitry Gutov, 2014/07/26
- [elpa] 04/16: company-pseudo-tooltip-guard: Invalidate after crossing line continuation, Dmitry Gutov, 2014/07/26
- [elpa] 02/16: Fix popup when prefix is split by line continuation,
Dmitry Gutov <=