Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit 6e8c643

Browse files
committed
Merge pull request #8526 from adobe/dangoor/remove-lineheight
Removes line height setting
2 parents 8251e93 + 03368b9 commit 6e8c643

File tree

5 files changed

+2
-92
lines changed

5 files changed

+2
-92
lines changed

src/htmlContent/themes-settings.html

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,6 @@ <h1 class="dialog-title">Themes Settings</h1>
4040
<input type="text" data-target="fontFamily" value="{{settings.fontFamily}}">
4141
</div>
4242
</div>
43-
44-
<div class="control-group">
45-
<label class="control-label">{{Strings.LINE_HEIGHT}}:</label>
46-
<div class="controls">
47-
<input type="text" data-target="lineHeight" value="{{settings.lineHeight}}">
48-
</div>
49-
</div>
5043
</form>
5144
</div>
5245
<div class="modal-footer">

src/styles/brackets_codemirror_override.less

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,6 @@
7575
border-bottom: 2px solid #78B2F2;
7676
}
7777

78-
/**
79-
* These classes are set to inline-block because they are spans and they need block dimension properties when
80-
* when calculation height and width.
81-
*/
82-
.CodeMirror-searching,
83-
.CodeMirror-matchingtag,
84-
.CodeMirror-matchingbracket {
85-
display: inline-block;
86-
}
87-
8878
span.cm-keyword {color: @accent-keyword;}
8979
span.cm-atom {color: @accent-atom;}
9080
span.cm-number {color: @accent-number;}

src/styles/brackets_theme_default.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@
144144
*/
145145
.code-font() {
146146
color: @content-color;
147+
line-height: 1.25;
147148
}
148149

149150
.code-font-win() {

src/view/ThemeSettings.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ define(function (require, exports, module) {
7070

7171
result.fontFamily = ViewCommandHandlers.getFontFamily();
7272
result.fontSize = ViewCommandHandlers.getFontSize();
73-
result.lineHeight = ViewCommandHandlers.getLineHeight();
7473
return result;
7574
}
7675

src/view/ViewCommandHandlers.js

Lines changed: 1 addition & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,6 @@ define(function (require, exports, module) {
6060
*/
6161
var DYNAMIC_FONT_FAMILY_ID = "codemirror-dynamic-font-family";
6262

63-
/**
64-
* @const
65-
* @type {string}
66-
*/
67-
var DYNAMIC_LINE_HEIGHT_ID = "codemirror-dynamic-line-height";
68-
6963
/**
7064
* @const
7165
* @private
@@ -90,14 +84,6 @@ define(function (require, exports, module) {
9084
*/
9185
var DEFAULT_FONT_SIZE = 12;
9286

93-
/**
94-
* @const
95-
* @private
96-
* The default line height
97-
* @type {number}
98-
*/
99-
var DEFAULT_LINE_HEIGHT = 1.25;
100-
10187
/**
10288
* @const
10389
* @private
@@ -168,23 +154,6 @@ define(function (require, exports, module) {
168154
_addDynamicProperty(DYNAMIC_FONT_FAMILY_ID, "font-family", fontFamily);
169155
}
170156

171-
/**
172-
* @private
173-
* Removes the styles used to update the font family
174-
*/
175-
function _removeDynamicLineHeight() {
176-
_removeDynamicProperty(DYNAMIC_LINE_HEIGHT_ID);
177-
}
178-
179-
/**
180-
* @private
181-
* Add the styles used to update the line height
182-
* @param {string} lineHeight A string with the line height with size unit
183-
*/
184-
function _addDynamicLineHeight(lineHeight) {
185-
_addDynamicProperty(DYNAMIC_LINE_HEIGHT_ID, "line-height", lineHeight, true, ".CodeMirror-lines > div");
186-
}
187-
188157
/**
189158
* @private
190159
* Sets the font size and restores the scroll position as best as possible.
@@ -286,43 +255,6 @@ define(function (require, exports, module) {
286255
}
287256

288257

289-
/**
290-
* Line height setter to set the line height of the document editor
291-
* @param {string} lineHeight The line height. The value is in 'em'.
292-
*/
293-
function setLineHeight(lineHeight) {
294-
var editor = EditorManager.getCurrentFullEditor(),
295-
oldValue = prefs.get("lineHeight");
296-
297-
// Make sure the incoming value is a number... Strip off any size units
298-
lineHeight = parseFloat(lineHeight);
299-
300-
if (oldValue === lineHeight) {
301-
return;
302-
}
303-
304-
_removeDynamicLineHeight();
305-
if (lineHeight) {
306-
_addDynamicLineHeight(lineHeight);
307-
}
308-
309-
$(exports).triggerHandler("lineHeightChange", [lineHeight, oldValue]);
310-
prefs.set("lineHeight", lineHeight);
311-
312-
if (editor) {
313-
editor.refreshAll();
314-
}
315-
}
316-
317-
/**
318-
* Line height getter to get the line height for the document editor
319-
* @return {string} The line height with size unit as 'em' for the document editor
320-
*/
321-
function getLineHeight() {
322-
return prefs.get("lineHeight");
323-
}
324-
325-
326258
/**
327259
* @private
328260
* Increases or decreases the editor's font size.
@@ -397,7 +329,6 @@ define(function (require, exports, module) {
397329
function init() {
398330
_addDynamicFontFamily(prefs.get("fontFamily"));
399331
_addDynamicFontSize(prefs.get("fontSize"));
400-
_addDynamicLineHeight(prefs.get("lineHeight"));
401332
_updateUI();
402333
}
403334

@@ -427,12 +358,11 @@ define(function (require, exports, module) {
427358
}
428359

429360
/**
430-
* Restores the font size, font family, and line height back to factory settings.
361+
* Restores the font size and font family back to factory settings.
431362
*/
432363
function restoreFonts() {
433364
setFontFamily(DEFAULT_FONT_FAMILY);
434365
setFontSize(DEFAULT_FONT_SIZE + "px");
435-
setLineHeight(DEFAULT_LINE_HEIGHT);
436366
}
437367

438368

@@ -553,7 +483,6 @@ define(function (require, exports, module) {
553483
PreferencesManager.convertPreferences(module, {"fontSizeAdjustment": "user"}, true, _convertToNewViewState);
554484

555485
prefs.definePreference("fontSize", "string", DEFAULT_FONT_SIZE + "px");
556-
prefs.definePreference("lineHeight", "number", DEFAULT_LINE_HEIGHT);
557486
prefs.definePreference("fontFamily", "string", DEFAULT_FONT_FAMILY);
558487

559488
// Update UI when opening or closing a document
@@ -568,6 +497,4 @@ define(function (require, exports, module) {
568497
exports.setFontSize = setFontSize;
569498
exports.getFontFamily = getFontFamily;
570499
exports.setFontFamily = setFontFamily;
571-
exports.getLineHeight = getLineHeight;
572-
exports.setLineHeight = setLineHeight;
573500
});

0 commit comments

Comments
 (0)