emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 75e21f6 045/173: company-css: Support web-mode


From: Dmitry Gutov
Subject: [elpa] master 75e21f6 045/173: company-css: Support web-mode
Date: Thu, 23 Jun 2016 00:28:37 +0000 (UTC)

branch: master
commit 75e21f6ddc2a826c6ec74312d2e725a1a827385e
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    company-css: Support web-mode
    
    Closes #363
---
 company-css.el |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/company-css.el b/company-css.el
index ec48653..28f6c2d 100644
--- a/company-css.el
+++ b/company-css.el
@@ -26,6 +26,8 @@
 (require 'company)
 (require 'cl-lib)
 
+(declare-function web-mode-language-at-pos "web-mode" (&optional pos))
+
 (defconst company-css-property-alist
   ;; see http://www.w3.org/TR/CSS21/propidx.html
   '(("azimuth" angle "left-side" "far-left" "left" "center-left" "center"
@@ -415,7 +417,9 @@ Returns \"\" if no property found, but feasible at this 
position."
   (interactive (list 'interactive))
   (cl-case command
     (interactive (company-begin-backend 'company-css))
-    (prefix (and (derived-mode-p 'css-mode)
+    (prefix (and (or (derived-mode-p 'css-mode)
+                     (and (derived-mode-p 'web-mode)
+                          (string= (web-mode-language-at-pos) "css")))
                  (or (company-grab company-css-tag-regexp 1)
                      (company-grab company-css-pseudo-regexp 1)
                      (company-grab company-css-property-value-regexp 2)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]