(defcustom company-tooltip-minimum-width 0
"The minimum width of the tooltip's inner area.
This doesn't include the margins and the scroll bar."
- :type 'integer)
+ :type 'integer
+ :package-version '(company . "0.8.0"))
(defcustom company-tooltip-margin 1
"Width of margin columns to show around the toolip."
(defcustom company-tooltip-align-annotations nil
"When non-nil, align annotations to the right tooltip border."
- :type 'boolean)
+ :type 'boolean
+ :package-version '(company . "0.7.1"))
(defcustom company-tooltip-flip-when-above nil
"Whether to flip the tooltip when it's above the current line."
"If enabled, cancel a manually started completion when the prefix gets
shorter than both `company-minimum-prefix-length' and the length of the
prefix it was started from."
- :type 'boolean)
+ :type 'boolean
+ :package-version '(company . "0.8.0"))
(defcustom company-require-match 'company-explicit-action-p
"If enabled, disallow non-matching input.
(define-key keymap [tab] 'company-complete-common)
(define-key keymap (kbd "TAB") 'company-complete-common)
(define-key keymap (kbd "<f1>") 'company-show-doc-buffer)
+ (define-key keymap (kbd "C-h") 'company-show-doc-buffer)
(define-key keymap "\C-w" 'company-show-location)
(define-key keymap "\C-s" 'company-search-candidates)
(define-key keymap "\C-\M-s" 'company-filter-candidates)
(mod selection company-candidates-length)
(max 0 (min (1- company-candidates-length) selection))))
(when (or force-update (not (equal selection company-selection)))
+ (company-update-group-lighter (nth selection company-candidates))
(setq company-selection selection
company-selection-changed t)
(company-call-frontends 'update)))
+(defun company-update-group-lighter (candidate)
+ (when (listp company-backend)
+ (let ((backend (or (get-text-property 0 'company-backend candidate)
+ (car company-backend))))
+ (when (and backend (symbolp backend))
+ (let ((name (replace-regexp-in-string "company-\\|-company" ""
+ (symbol-name backend))))
+ (setq company-lighter (format " company-<%s>" name)))))))
+
(defun company-apply-predicate (candidates predicate)
(let (new)
(dolist (c candidates)
(message "No completion found"))
(when company--manual-action
(setq company--manual-prefix prefix))
- (when (symbolp backend)
- (setq company-lighter (concat " " (symbol-name backend))))
+ (if (symbolp backend)
+ (setq company-lighter (concat " " (symbol-name backend)))
+ (company-update-group-lighter (car c)))
(company-update-candidates c)
(run-hook-with-args 'company-completion-started-hook
(company-explicit-action-p))
(company-pseudo-tooltip-show (1+ row) col company-selection)))
(defun company-pseudo-tooltip-edit (selection)
- (let ((height (overlay-get company-pseudo-tooltip-overlay 'company-height)))
+ (let* ((height (overlay-get company-pseudo-tooltip-overlay 'company-height))
+ (lines (company--create-lines selection (abs height))))
+ (overlay-put company-pseudo-tooltip-overlay 'company-width
+ (string-width (car lines)))
(overlay-put company-pseudo-tooltip-overlay 'company-after
(apply 'company--replacement-string
- (company--create-lines selection (abs height))
+ lines
(overlay-get company-pseudo-tooltip-overlay
'company-replacement-args)))))