Skip to content

Commit 0a68995

Browse files
committed
fix: emmet preferences enable/disable not working
1 parent 046c08c commit 0a68995

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

src/extensionsIntegrated/Emmet/main.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -243,19 +243,20 @@ define(function (require, exports, module) {
243243
}
244244

245245
EmmetMarkupHints.prototype.hasHints = function (editor, implicitChar) {
246+
if (enabled) {
247+
this.editor = editor;
246248

247-
this.editor = editor;
249+
const wordObj = getWordBeforeCursor(editor);
250+
const config = createConfig(editor);
251+
if (config && config.syntax === "html") {
248252

249-
const wordObj = getWordBeforeCursor(editor);
250-
const config = createConfig(editor);
251-
if (config && config.syntax === "html") {
253+
// make sure we donot have empty spaces
254+
if (wordObj.word.trim()) {
252255

253-
// make sure we donot have empty spaces
254-
if (wordObj.word.trim()) {
255-
256-
const expandedAbbr = isExpandable(editor, wordObj.word, config);
257-
if (expandedAbbr) {
258-
return true;
256+
const expandedAbbr = isExpandable(editor, wordObj.word, config);
257+
if (expandedAbbr) {
258+
return true;
259+
}
259260
}
260261
}
261262
}
@@ -611,6 +612,9 @@ define(function (require, exports, module) {
611612
}
612613

613614
// the word must be either in markupSnippetsList, htmlList or it must have a positive symbol
615+
// convert to lowercase only for `htmlTags` because HTML tag names are case-insensitive,
616+
// but `markupSnippetsList` expands abbreviations in a non-tag manner,
617+
// where the expanded abbreviation is already in lowercase.
614618
if (markupSnippetsList.includes(word) ||
615619
htmlTags.includes(word.toLowerCase()) ||
616620
positiveSymbols.some(symbol => word.includes(symbol))) {

src/nls/root/strings.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,6 +1264,9 @@ define({
12641264
"DESCRIPTION_HIDE_FIRST": "true to show the first Indent Guide line else false.",
12651265
"DESCRIPTION_CSS_COLOR_PREVIEW": "true to display color previews in the gutter, else false.",
12661266

1267+
// Emmet
1268+
"DESCRIPTION_EMMET": "true to enable Emmet, else false.",
1269+
12671270
// Git extension
12681271
"ENABLE_GIT": "Enable Git",
12691272
"ACTION": "Action",

0 commit comments

Comments
 (0)