forked from VimPlug/emmet-vim
Add support for CSS in JS annotations like css` and styled.*`
This commit is contained in:
@@ -404,6 +404,8 @@ function! emmet#getFileType(...) abort
|
||||
let type = 'typescript'
|
||||
elseif type =~? '^xml'
|
||||
let type = 'xml'
|
||||
elseif type == 'styledEmmetAbbreviation'
|
||||
let type = 'styled'
|
||||
else
|
||||
let types = split(&filetype, '\.')
|
||||
for part in types
|
||||
@@ -1680,6 +1682,9 @@ let s:emmet_settings = {
|
||||
\ 'css.drupal': {
|
||||
\ 'extends': 'css',
|
||||
\ },
|
||||
\ 'styled': {
|
||||
\ 'extends': 'css',
|
||||
\ },
|
||||
\ 'html': {
|
||||
\ 'snippets': {
|
||||
\ '!': "html:5",
|
||||
|
||||
@@ -23,7 +23,7 @@ function! emmet#lang#css#parseIntoTree(abbr, type) abort
|
||||
" emmet
|
||||
let tokens = split(abbr, '+\ze[^+)!]')
|
||||
let block = emmet#util#searchRegion('{', '}')
|
||||
if abbr !~# '^@' && emmet#getBaseType(type) ==# 'css' && type !=# 'sass' && block[0] ==# [0,0] && block[1] ==# [0,0]
|
||||
if abbr !~# '^@' && emmet#getBaseType(type) ==# 'css' && type !=# 'sass' && type !=# 'styled' && block[0] ==# [0,0] && block[1] ==# [0,0]
|
||||
let current = emmet#newNode()
|
||||
let current.snippet = substitute(abbr, '\s\+$', '', '') . " {\n" . indent . "${cursor}\n}"
|
||||
let current.name = ''
|
||||
|
||||
Reference in New Issue
Block a user