-
-
Notifications
You must be signed in to change notification settings - Fork 410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use empty string and 0
for HTML-like type, not HTML default
#434
base: master
Are you sure you want to change the base?
Conversation
In HTML-like type, `settings.html.*` is used as default setting if `settings.(type).*` is not set. But in HTML type and types extending HTML, `settings.html` is merged into `settings.(type)` and no need to use `settings.html` as explicit default. Before this change, `param<C-y>,` expands to `<param name="" value=""></param>` because `xml` type extends `html` by default, and `html` has default attributes for `param` element. With this change and `g:user_emmet_settings.xml.extends = ""`, users can disable HTML defaults in XML files. So then `param<C-y>,` expands to `<param></param>`.
3185aad
to
51d68cd
Compare
I think syntax and defaults should be separate. Currently
|
If empty_elements / block_elements / inline_elements are specified as empty string, those are not merged. If the type does not have those keys, those will be merged. How about this idea?
|
Sounds good, it enables users to explicitly discard default. 😄 |
function! emmet#getResourceIfExists(type, name, default) abort
if !has_key(s:emmet_settings, a:type) || !has_key(s:emmet_settings[a:type], a:name)
return a:default
endif
return emmet#getResource(type, name, default)
endfunction |
It would work for string and integer type values ( It is caused by Lines 336 to 352 in 7a4bf34
(↑ I want to configurably disable this part for dictinaries and lists, e.g. default_attributes , expandos , aliases .)
|
In HTML-like type,
settings.html.*
is used as default setting ifsettings.(type).*
is not set.But in HTML type and types extending HTML,
settings.html
is mergedinto
settings.(type)
and no need to usesettings.html
as explicitdefault.
Before this change,
param<C-y>,
expands to<param name="" value=""></param>
becausexml
type extendshtml
bydefault, and
html
has default attributes forparam
element.With this change and
g:user_emmet_settings.xml.extends = ""
, userscan disable HTML defaults in XML files.
So then
param<C-y>,
expands to<param></param>
.