[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master ec1e879 10/78: company-tng: Don't highlight tooltip when u
From: |
Dmitry Gutov |
Subject: |
[elpa] master ec1e879 10/78: company-tng: Don't highlight tooltip when unselected |
Date: |
Sun, 18 Feb 2018 07:40:12 -0500 (EST) |
branch: master
commit ec1e879b4e662ead5699c153e28dc2573169259d
Author: Nikita Leshenko <address@hidden>
Commit: Nikita Leshenko <address@hidden>
company-tng: Don't highlight tooltip when unselected
This is a visual adjustment to avoid highlighting the first candidate when
it
wasn't made explicitly.
This is an advice and not an internal configuration variable because we
would
like to keep company-tng a separate package for it's unusual semantics.
---
company-tng.el | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/company-tng.el b/company-tng.el
index fbb8aa6..f01462c 100644
--- a/company-tng.el
+++ b/company-tng.el
@@ -54,7 +54,8 @@ confirm the selection and finish the completion."
(let ((ov (make-overlay (point) (point))))
(setq company-tng--overlay ov)
(overlay-put ov 'priority 2))
- (advice-add 'company-select-next :before-until
'company-tng--allow-unselected))
+ (advice-add 'company-select-next :before-until
'company-tng--allow-unselected)
+ (advice-add 'company-fill-propertize :filter-args
'company-tng--adjust-tooltip-highlight))
(update
(let ((ov company-tng--overlay)
(selected (nth company-selection company-candidates))
@@ -64,7 +65,8 @@ confirm the selection and finish the completion."
(hide
(when company-tng--overlay
(delete-overlay company-tng--overlay))
- (advice-remove 'company-select-next 'company-tng--allow-unselected))
+ (advice-remove 'company-select-next 'company-tng--allow-unselected)
+ (advice-remove 'company-fill-propertize
'company-tng--adjust-tooltip-highlight))
(pre-command
(when (and company-selection-changed
(not (company--company-command-p (this-command-keys))))
@@ -103,5 +105,13 @@ There is no need to advice `company-select-previous'
because it calls
t)
)))
+(defun company-tng--adjust-tooltip-highlight (args)
+ "Prevent the tooltip from highlighting the current selection if it wasn't
+made explicitly (i.e. `company-selection-changed' is true)"
+ (unless company-selection-changed
+ ;; The 4th arg of `company-fill-propertize' is selected
+ (setf (nth 3 args) nil))
+ args)
+
(provide 'company-tng)
;;; company-tng.el ends here
- [elpa] master updated (32f6323 -> e65aa3f), Dmitry Gutov, 2018/02/18
- [elpa] master c280e64 01/78: company-safe-substring: Honor the current buffer-invisibility-spec, Dmitry Gutov, 2018/02/18
- [elpa] master ff295e8 02/78: add golang keywords, Dmitry Gutov, 2018/02/18
- [elpa] master ab2937a 04/78: Fix the warnings, Dmitry Gutov, 2018/02/18
- [elpa] master aefac09 05/78: Force the prefix call to synchronous everywhere, Dmitry Gutov, 2018/02/18
- [elpa] master 191fc01 03/78: Merge pull request #694 from ycz0926/master, Dmitry Gutov, 2018/02/18
- [elpa] master 5df6abf 12/78: company-tng: Usage instructions, Dmitry Gutov, 2018/02/18
- [elpa] master ec1e879 10/78: company-tng: Don't highlight tooltip when unselected,
Dmitry Gutov <=
- [elpa] master 91fc865 07/78: Unread whole command instead of last input, Dmitry Gutov, 2018/02/18
- [elpa] master c0098af 06/78: Introduce company-tooltip-maximum-width, Dmitry Gutov, 2018/02/18
- [elpa] master fe20376 11/78: company-tng: Function to give sensible default configuration, Dmitry Gutov, 2018/02/18
- [elpa] master e27f0f4 13/78: NEWS: Entry for company-tng, Dmitry Gutov, 2018/02/18
- [elpa] master 0295c8f 20/78: And more, Dmitry Gutov, 2018/02/18
- [elpa] master b07eaf9 17/78: Move the entry up, Dmitry Gutov, 2018/02/18
- [elpa] master 74d85d1 09/78: company-tng: Advice company-select-next to allow unselected state, Dmitry Gutov, 2018/02/18
- [elpa] master 4240367 08/78: company-tng: Implement visualisation and completion, Dmitry Gutov, 2018/02/18
- [elpa] master 1a9f0b8 14/78: company-tng: Kill local overlay variable after completion is done, Dmitry Gutov, 2018/02/18
- [elpa] master a528433 21/78: Fix the link text, Dmitry Gutov, 2018/02/18