Skip to content

Commit 5ac6a14

Browse files
committed
chore: emmet-markup now use same emmet preference used by emmet-css
1 parent 05ddcd7 commit 5ac6a14

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

src/extensionsIntegrated/Emmet/main.js

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@
1818
* along with this program. If not, see https://opensource.org/licenses/AGPL-3.0.
1919
*/
2020

21+
/* Emmet for stylesheet is present inside `src/extensions/default/CSSCodeHints/main.js` */
2122

2223
define(function (require, exports, module) {
2324
const AppInit = require("utils/AppInit");
2425
const PreferencesManager = require("preferences/PreferencesManager");
25-
const Strings = require("strings");
2626
const CodeHintManager = require("editor/CodeHintManager");
27+
const AllPreferences = require("preferences/AllPreferences");
28+
2729
const {
2830
markupSnippets,
2931
htmlTags,
@@ -36,6 +38,8 @@ define(function (require, exports, module) {
3638
* The Emmet api's
3739
*/
3840
const EXPAND_ABBR = Phoenix.libs.Emmet.expand;
41+
42+
// (leaving this for future, as we might need this when we extend the functionality of Emmet)
3943
// const EMMET = Phoenix.libs.Emmet.module;
4044

4145

@@ -48,14 +52,7 @@ define(function (require, exports, module) {
4852
const markupSnippetsList = Object.keys(markupSnippets);
4953

5054

51-
// For preferences settings, to toggle this feature on/off
52-
const PREFERENCES_EMMET = "emmet";
53-
let enabled = true; // by default:- on
54-
55-
PreferencesManager.definePreference(PREFERENCES_EMMET, "boolean", enabled, {
56-
description: Strings.DESCRIPTION_EMMET
57-
});
58-
55+
let enabled = true; // whether Emmet is enabled or not in preferences
5956

6057
/**
6158
* @constructor
@@ -520,16 +517,15 @@ define(function (require, exports, module) {
520517

521518

522519
/**
523-
* Checks for preference changes, to enable/disable the feature
520+
* Checks for preference changes, to enable/disable Emmet
524521
*/
525522
function preferenceChanged() {
526-
const value = PreferencesManager.get(PREFERENCES_EMMET);
527-
enabled = value;
523+
enabled = PreferencesManager.get(AllPreferences.EMMET);
528524
}
529525

530526
AppInit.appReady(function () {
531-
// Set up preferences
532-
PreferencesManager.on("change", PREFERENCES_EMMET, preferenceChanged);
527+
528+
PreferencesManager.on("change", AllPreferences.EMMET, preferenceChanged);
533529
preferenceChanged();
534530

535531
var emmetMarkupHints = new EmmetMarkupHints();

src/styles/brackets_patterns_override.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,7 @@ a:focus {
725725
.dark& {
726726
color: @dark-css-codehint-icon !important;
727727
}
728+
}
728729

729730
.emmet-code-hint {
730731
position: absolute;

0 commit comments

Comments
 (0)