[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 11/21: Render company-preview-frontend after the cursor
From: |
Dmitry Gutov |
Subject: |
[elpa] 11/21: Render company-preview-frontend after the cursor |
Date: |
Mon, 03 Feb 2014 17:36:17 +0000 |
dgutov pushed a commit to branch master
in repository elpa.
commit 9b0d457335957532ae65118cdc76d9126658ae42
Author: Dmitry Gutov <address@hidden>
Date: Sat Feb 1 05:12:09 2014 +0200
Render company-preview-frontend after the cursor
---
NEWS.md | 1 +
company.el | 8 +++++---
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/NEWS.md b/NEWS.md
index 309b915..8957912 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -2,6 +2,7 @@
## Next
+* `company-preview-frontend` renders itself after the cursor.
* New user option `company-transformers`.
* First transformer, `company-sort-by-occurrence`.
* New user options controlling `company-dabbrev` and `company-dabbrev-code`.
diff --git a/company.el b/company.el
index 2d68059..e43dd74 100644
--- a/company.el
+++ b/company.el
@@ -2120,9 +2120,9 @@ Returns a negative number if the tooltip should be
displayed above point."
(defun company-preview-show-at-point (pos)
(company-preview-hide)
- (setq company-preview-overlay (make-overlay pos pos))
+ (setq company-preview-overlay (make-overlay pos (1+ pos)))
- (let ((completion(nth company-selection company-candidates)))
+ (let ((completion (nth company-selection company-candidates)))
(setq completion (propertize completion 'face 'company-preview))
(add-text-properties 0 (length company-common)
'(face company-preview-common) completion)
@@ -2141,7 +2141,9 @@ Returns a negative number if the tooltip should be
displayed above point."
(not (equal completion ""))
(add-text-properties 0 1 '(cursor t) completion))
- (overlay-put company-preview-overlay 'after-string completion)
+ (overlay-put company-preview-overlay 'display
+ (concat completion (unless (eq pos (point-max))
+ (buffer-substring pos (1+ pos)))))
(overlay-put company-preview-overlay 'window (selected-window))))
(defun company-preview-hide ()
- [elpa] branch master updated (6265448 -> 7d682e9), Dmitry Gutov, 2014/02/03
- [elpa] 05/21: company-sort-by-occurrence: handle cons prefixes, Dmitry Gutov, 2014/02/03
- [elpa] 03/21: Lower dabbrev time limits, Dmitry Gutov, 2014/02/03
- [elpa] 07/21: company-sort-by-occurrence: update the docstring, Dmitry Gutov, 2014/02/03
- [elpa] 09/21: company-transformers: improve the defcustom widget, Dmitry Gutov, 2014/02/03
- [elpa] 08/21: Add new option, company-dabbrev-minimum-length, Dmitry Gutov, 2014/02/03
- [elpa] 10/21: Don't generate bogus event in Emacs 24.4, Dmitry Gutov, 2014/02/03
- [elpa] 06/21: Fix #54, Dmitry Gutov, 2014/02/03
- [elpa] 11/21: Render company-preview-frontend after the cursor,
Dmitry Gutov <=
- [elpa] 12/21: company-preview* faces: inherit from company-tooltip-[common-]selection, Dmitry Gutov, 2014/02/03
- [elpa] 15/21: Remove NEWS entry for 9b0d457, it's a bugfix, Dmitry Gutov, 2014/02/03
- [elpa] 17/21: company-capf: strip duplicates, Dmitry Gutov, 2014/02/03
- [elpa] 01/21: company-begin-commands: add `org-self-insert-command', Dmitry Gutov, 2014/02/03
- [elpa] 21/21: Merge commit '67ab56a5469f16652e73667ec3b4f76ff6befee6' from company, Dmitry Gutov, 2014/02/03
- [elpa] 16/21: Don't "transform" twice, Dmitry Gutov, 2014/02/03
- [elpa] 20/21: Remove outdated comment, Dmitry Gutov, 2014/02/03
- [elpa] 02/21: Make dabbrev and dabbrev-code more customizable, Dmitry Gutov, 2014/02/03
- [elpa] 19/21: Fix #56, Dmitry Gutov, 2014/02/03
- [elpa] 04/21: Add company-transformers, Dmitry Gutov, 2014/02/03