;;
;;; Change Log:
;;
+;; Fixed issues with tabbar-mode and line-spacing.
;; Performance enhancements.
;;
;; 2009-04-12 (0.3)
(point)))
""))
-(defun company-in-string-or-comment (&optional point)
- (let ((pos (syntax-ppss)))
- (or (nth 3 pos) (nth 4 pos) (nth 7 pos))))
+(defun company-in-string-or-comment ()
+ (let ((ppss (syntax-ppss)))
+ (or (nth 3 ppss) (nth 4 ppss) (nth 7 ppss))))
;;; completion mechanism ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
"Non-nil, if explicit completion took place.")
(make-variable-buffer-local 'company--explicit-action)
+(defvar company--this-command nil)
+
(defvar company-point nil)
(make-variable-buffer-local 'company-point)
(defsubst company-should-complete (prefix)
(and (eq company-idle-delay t)
(or (eq t company-begin-commands)
- (memq this-command company-begin-commands)
+ (memq company--this-command company-begin-commands)
(and (symbolp this-command) (get this-command 'company-begin)))
(not (and transient-mark-mode mark-active))
(>= (length prefix) company-minimum-prefix-length)))
(unless (company-keep this-command)
(condition-case err
(progn
+ (setq company--this-command this-command)
(unless (equal (point) company-point)
(company-begin))
(when company-candidates
"Select the candidate picked by the mouse."
(interactive "e")
(when (nth 4 (event-start event))
- (company-set-selection (- (cdr (posn-col-row (event-start event)))
- (cdr (posn-col-row (posn-at-point)))
+ (company-set-selection (- (cdr (posn-actual-col-row (event-start event)))
+ (cdr (posn-actual-col-row (posn-at-point)))
1))
t))
`(when (company-manual-begin)
(save-window-excursion
(let ((height (window-height))
- (row (cdr (posn-col-row (posn-at-point)))))
+ (row (cdr (posn-actual-col-row (posn-at-point)))))
,@body
(and (< (window-height) height)
(< (- (window-height) row 2) company-tooltip-limit)
(defun company-buffer-lines (beg end)
(goto-char beg)
- (let ((row (cdr (posn-col-row (posn-at-point))))
+ (let ((row (cdr (posn-actual-col-row (posn-at-point))))
lines)
(while (and (equal (move-to-window-line (incf row)) row)
(<= (point) end))
(overlay-put company-pseudo-tooltip-overlay 'window (selected-window)))))
(defun company-pseudo-tooltip-show-at-point (pos)
- (let ((col-row (posn-col-row (posn-at-point pos))))
- (company-pseudo-tooltip-show (1+ (cdr col-row)) (car col-row) company-selection)))
+ (let ((col-row (posn-actual-col-row (posn-at-point pos))))
+ (company-pseudo-tooltip-show (1+ (cdr col-row)) (car col-row)
+ company-selection)))
(defun company-pseudo-tooltip-edit (lines selection)
(let* ((old-string (overlay-get company-pseudo-tooltip-overlay 'company-old))