Skip to content

Commit

Permalink
fix: strictly equal instead of loosely
Browse files Browse the repository at this point in the history
  • Loading branch information
mkslanc committed Aug 12, 2022
1 parent 4067512 commit d4c1ab8
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/layer/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ var Text = function(parentEl) {

this.highlightIndentGuides = true;
this.setHighlightIndentGuides = function (highlight) {
if (this.displayIndentGuides == false) return false;
if (this.highlightIndentGuides == highlight) return false;
if (this.displayIndentGuides === false) return false;
if (this.highlightIndentGuides === highlight) return false;

this.highlightIndentGuides = highlight;
return highlight;
Expand Down Expand Up @@ -449,7 +449,7 @@ var Text = function(parentEl) {
if (bracketHighlight) {
var ranges = this.session.$bracketHighlight.ranges;
for (var i = 0; i < ranges.length; i++) {
if (cursor.row != ranges[i].start.row) {
if (cursor.row !== ranges[i].start.row) {
this.$highlightIndentGuideMarker.end = ranges[i].start.row;
if (cursor.row > ranges[i].start.row) {
this.$highlightIndentGuideMarker.dir = -1;
Expand All @@ -468,7 +468,7 @@ var Text = function(parentEl) {
for (var i = cursor.row + 1; i < lines.length; i++) {
var line = lines[i];
var currentIndent = /^\s*/.exec(line)[0].length;
if (line != '') {
if (line !== '') {
this.$highlightIndentGuideMarker.end = i;
if (currentIndent <= initialIndent) break;
}
Expand All @@ -486,7 +486,7 @@ var Text = function(parentEl) {
var childNodes = cell.element.childNodes;
if (childNodes.length > 0) {
for (var j = 0; j < childNodes.length; j++) {
if (childNodes[j].className && childNodes[j].className.search("ace_indent-guide-active") != -1) {
if (childNodes[j].className && childNodes[j].className.search("ace_indent-guide-active") !== -1) {
childNodes[j].className = childNodes[j].className.replace(
"ace_indent-guide-active", "ace_indent-guide");
}
Expand All @@ -497,7 +497,7 @@ var Text = function(parentEl) {

this.$setIndentGuideActive = function (cell, indentLevel) {
var line = this.session.doc.getLine(cell.row);
if (line != "") {
if (line !== "") {
var childNodes = cell.element.childNodes;
if (childNodes && childNodes[indentLevel - 1] && childNodes[indentLevel - 1].className) {
childNodes[indentLevel - 1].className = childNodes[indentLevel - 1].className.replace(
Expand All @@ -511,8 +511,8 @@ var Text = function(parentEl) {
var cells = this.$lines.cells;
this.$clearActiveIndentGuide();
var indentLevel = this.$highlightIndentGuideMarker.indentLevel;
if (indentLevel != 0) {
if (this.$highlightIndentGuideMarker.dir == 1) {
if (indentLevel !== 0) {
if (this.$highlightIndentGuideMarker.dir === 1) {
for (var i = 0; i < cells.length; i++) {
var cell = cells[i];
if (this.$highlightIndentGuideMarker.end && cell.row >= this.$highlightIndentGuideMarker.start
Expand Down

0 comments on commit d4c1ab8

Please sign in to comment.