victorteokw / ac-html

Emacs auto complete source for html.
22 stars 9 forks source link

attribute auto complete fired wrongly when attribute value has space. #15

Closed victorteokw closed 9 years ago

victorteokw commented 9 years ago

screen shot 2014-12-05 at 7 05 25 pm

osv commented 9 years ago

I dont know how to prevent complete of attributes in not defined attribute's value (like here - "class").

Need a way to check that we are not in "string-face" to fire attribute-complete

But you still can change ac-source order, put ac-source-html-attribute-value at begin of source list.

             ac-source-html-attribute-value
                     ac-source-html-tag
                     ac-source-html-attribute

and now if value is AVAILABLE, it fire first than attribute try press space after "screen "

     <link media="screen "
osv commented 9 years ago

I will update readme and header of .el for source ORDER

victorteokw commented 9 years ago

:-)

victorteokw commented 9 years ago

I will add tests for these.

victorteokw commented 9 years ago

So afterwards, we can just check if tests are pass. ;D

osv commented 9 years ago

source order is a trick, need better way, forexample checking where we are, in string or not

victorteokw commented 9 years ago

Yup.

osv commented 9 years ago

added check for string face

(defun ac-html--attribute-candidates (source)
  (unless (eq (get-text-property (point) 'face)
          'font-lock-string-face)