* lisp/textmodes/css-mode.el (css--complete-property-value): Be less
eager by looking for a colon after the property which values are being
completed for.
* test/lisp/textmodes/css-mode-tests.el (css-test-complete-property):
Add a test case ensuring that properties that are prefixes of other
properties don't hinder further completion.
(let ((property
(save-excursion
(re-search-backward ":[^/]" (line-beginning-position) t)
- (let ((property-end (point)))
- (skip-chars-backward "-[:alnum:]")
- (let ((property (buffer-substring (point) property-end)))
- (car (member property css-property-ids)))))))
+ (when (eq (char-after) ?:)
+ (let ((property-end (point)))
+ (skip-chars-backward "-[:alnum:]")
+ (let ((prop (buffer-substring (point) property-end)))
+ (car (member prop css-property-ids))))))))
(when property
(let ((end (point)))
(save-excursion
(insert "body { f")
(let ((completions (css-mode-tests--completions)))
(should (member "filter" completions))
- (should-not (member "position" completions)))))
+ (should-not (member "position" completions))))
+ ;; Bug#27392
+ (with-temp-buffer
+ (css-mode)
+ (insert "html { grid")
+ (should (> (length (css-mode-tests--completions)) 0))))
(ert-deftest css-test-foreign-completions ()
(let ((other-buffer-1 (generate-new-buffer "1"))