;; Even though pseudo-elements should be prefixed by ::, a
;; single colon is accepted for backward compatibility.
"\\(?:\\(:" (regexp-opt (append css-pseudo-class-ids
- css-pseudo-element-ids) t)
+ css-pseudo-element-ids)
+ t)
"\\|\\::" (regexp-opt css-pseudo-element-ids t) "\\)"
"\\(?:([^)]+)\\)?"
(if (not sassy)
(seq-let (prop-beg prop-end prop-table) (css--complete-property)
(seq-let (sel-beg sel-end sel-table) (css--complete-selector)
(when (or prop-table sel-table)
+ ;; FIXME: If both prop-table and sel-table are set but
+ ;; prop-beg/prop-end is different from sel-beg/sel-end
+ ;; we have a problem!
`(,@(if prop-table
(list prop-beg prop-end)
(list sel-beg sel-end))
- ,(completion-table-merge prop-table sel-table)))))))
+ ,(completion-table-merge prop-table sel-table)
+ :exit-function
+ ,(lambda (string status)
+ (and (eq status 'finished)
+ prop-table
+ (test-completion string prop-table)
+ (not (and sel-table
+ (test-completion string sel-table)))
+ (progn (insert ": ;")
+ (forward-char -1))))))))))
;;;###autoload
(define-derived-mode css-mode prog-mode "CSS"