]> code.delx.au - gnu-emacs-elpa/blobdiff - company-css.el
Fix incremental cache from empty string.
[gnu-emacs-elpa] / company-css.el
index 524c481b6a545cff9234bbd095a9d0ffe1dc9a24..2e972a6ebfa0288ef6465dacc661f742c8bd6484 100644 (file)
@@ -2,7 +2,7 @@
 ;;
 ;; Copyright (C) 2009 Nikolaj Schumacher
 ;;
-;; This file is part of company.
+;; This file is part of company 0.3.1.
 ;;
 ;; This program is free software; you can redistribute it and/or
 ;; modify it under the terms of the GNU General Public License
   "Return the CSS property before point, if any.
 Returns \"\" if no property found, but feasible at this position."
   (when (company-css-inside-braces-p)
-    (or (company-grab "\\_<[[:alpha:]-]+\\_>\\=")
-        (company-grab "{\\|[[:space:]]" 1))))
+    (company-grab-symbol)))
 
 ;;; values
 (defconst company-css-property-value-regexp
   "\\_<\\([[:alpha:]-]+\\):\\(?:[^};]*[[:space:]]+\\)?\\([^};]*\\_>\\|\\)\\="
   "A regular expression matching CSS tags")
 
+;;;###autoload
 (defun company-css (command &optional arg &rest ignored)
   "A `company-mode' completion back-end for `css-mode'."
+  (interactive (list 'interactive))
   (case command
+    ('interactive (company-begin-backend 'company-css))
     ('prefix (and (eq major-mode 'css-mode)
                   (or (company-grab company-css-tag-regexp 1)
                       (company-grab company-css-pseudo-regexp 1)