Skip to content

Commit d4c1ab8

Browse files
committed
fix: strictly equal instead of loosely
1 parent 4067512 commit d4c1ab8

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/layer/text.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ var Text = function(parentEl) {
103103

104104
this.highlightIndentGuides = true;
105105
this.setHighlightIndentGuides = function (highlight) {
106-
if (this.displayIndentGuides == false) return false;
107-
if (this.highlightIndentGuides == highlight) return false;
106+
if (this.displayIndentGuides === false) return false;
107+
if (this.highlightIndentGuides === highlight) return false;
108108

109109
this.highlightIndentGuides = highlight;
110110
return highlight;
@@ -449,7 +449,7 @@ var Text = function(parentEl) {
449449
if (bracketHighlight) {
450450
var ranges = this.session.$bracketHighlight.ranges;
451451
for (var i = 0; i < ranges.length; i++) {
452-
if (cursor.row != ranges[i].start.row) {
452+
if (cursor.row !== ranges[i].start.row) {
453453
this.$highlightIndentGuideMarker.end = ranges[i].start.row;
454454
if (cursor.row > ranges[i].start.row) {
455455
this.$highlightIndentGuideMarker.dir = -1;
@@ -468,7 +468,7 @@ var Text = function(parentEl) {
468468
for (var i = cursor.row + 1; i < lines.length; i++) {
469469
var line = lines[i];
470470
var currentIndent = /^\s*/.exec(line)[0].length;
471-
if (line != '') {
471+
if (line !== '') {
472472
this.$highlightIndentGuideMarker.end = i;
473473
if (currentIndent <= initialIndent) break;
474474
}
@@ -486,7 +486,7 @@ var Text = function(parentEl) {
486486
var childNodes = cell.element.childNodes;
487487
if (childNodes.length > 0) {
488488
for (var j = 0; j < childNodes.length; j++) {
489-
if (childNodes[j].className && childNodes[j].className.search("ace_indent-guide-active") != -1) {
489+
if (childNodes[j].className && childNodes[j].className.search("ace_indent-guide-active") !== -1) {
490490
childNodes[j].className = childNodes[j].className.replace(
491491
"ace_indent-guide-active", "ace_indent-guide");
492492
}
@@ -497,7 +497,7 @@ var Text = function(parentEl) {
497497

498498
this.$setIndentGuideActive = function (cell, indentLevel) {
499499
var line = this.session.doc.getLine(cell.row);
500-
if (line != "") {
500+
if (line !== "") {
501501
var childNodes = cell.element.childNodes;
502502
if (childNodes && childNodes[indentLevel - 1] && childNodes[indentLevel - 1].className) {
503503
childNodes[indentLevel - 1].className = childNodes[indentLevel - 1].className.replace(
@@ -511,8 +511,8 @@ var Text = function(parentEl) {
511511
var cells = this.$lines.cells;
512512
this.$clearActiveIndentGuide();
513513
var indentLevel = this.$highlightIndentGuideMarker.indentLevel;
514-
if (indentLevel != 0) {
515-
if (this.$highlightIndentGuideMarker.dir == 1) {
514+
if (indentLevel !== 0) {
515+
if (this.$highlightIndentGuideMarker.dir === 1) {
516516
for (var i = 0; i < cells.length; i++) {
517517
var cell = cells[i];
518518
if (this.$highlightIndentGuideMarker.end && cell.row >= this.$highlightIndentGuideMarker.start

0 commit comments

Comments
 (0)