]> code.delx.au - gnu-emacs-elpa/blobdiff - company-capf.el
company-dabbrev--search-buffer: Speed up
[gnu-emacs-elpa] / company-capf.el
index 6554782d1de48014e282d5866891b44836578938..9eeb2482a0a4d075c2175cecab7656e72b25e1d0 100644 (file)
     (`prefix
      (let ((res (company--capf-data)))
        (when res
-         (let* ((f (plist-get (nthcdr 4 res) :company-prefix-length))
-                (beg (nth 1 res))
-                (end (nth 2 res))
-                (length (and f (funcall f beg (point))))
-                (prefix (buffer-substring-no-properties beg (point))))
+         (let ((length (plist-get (nthcdr 4 res) :company-prefix-length))
+               (prefix (buffer-substring-no-properties (nth 1 res) (point))))
            (cond
-            ((> end (point)) 'stop)
+            ((> (nth 2 res) (point)) 'stop)
             (length (cons prefix length))
             (t prefix))))))
     (`candidates