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

Commit 5ed4ee4

Browse files
author
Marcel Gerber
committed
Code review changes
1 parent 43844fc commit 5ed4ee4

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/extensions/default/InlineColorEditor/InlineColorEditor.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ define(function (require, exports, module) {
150150
self.hostEditor.setSelection(range.start, range.end); // workaround for #2805
151151
self.hostEditor.document.replaceRange(colorString, range.start, range.end, self._origin);
152152
self.hostEditor.setSelection(range.start, endPos);
153+
self._marker.clear();
153154
self._marker = self.hostEditor._codeMirror.markText(range.start, endPos);
154155
});
155156
this._isOwnChange = false;

src/extensions/default/InlineColorEditor/unittests.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,12 +242,12 @@ define(function (require, exports, module) {
242242
});
243243
});
244244

245-
it("should close itself if edit is made that destroys end bookmark and leaves color invalid", function () {
245+
it("should close itself if edit is made that destroys end textmark and leaves color invalid", function () {
246246
makeColorEditor({line: 1, ch: 18});
247247
runs(function () {
248248
spyOn(inline, "close");
249249

250-
// Replace everything including the semicolon, so it crosses the bookmark boundary.
250+
// Replace everything including the semicolon, so it crosses the textmark boundary.
251251
testDocument.replaceRange("rgb(255, 25", {line: 1, ch: 16}, {line: 1, ch: 24});
252252
expect(inline.close).toHaveBeenCalled();
253253
});
@@ -266,7 +266,7 @@ define(function (require, exports, module) {
266266
});
267267
});
268268

269-
it("should not update the end bookmark and the color shown to a shorter valid match if the bookmark still exists and the color becomes invalid", function () {
269+
it("should not update the end textmark and the color shown to a shorter valid match if the marker still exists and the color becomes invalid", function () {
270270
makeColorEditor({line: 1, ch: 18});
271271
runs(function () {
272272
testDocument.replaceRange("", {line: 1, ch: 22}, {line: 1, ch: 23});
@@ -275,7 +275,7 @@ define(function (require, exports, module) {
275275
});
276276
});
277277

278-
it("should not update the end bookmark and the color shown to a shorter valid match if the bookmark no longer exists and the color becomes invalid", function () {
278+
it("should not update the end textmark and the color shown to a shorter valid match if the marker no longer exists and the color becomes invalid", function () {
279279
makeColorEditor({line: 1, ch: 18});
280280
runs(function () {
281281
testDocument.replaceRange("", {line: 1, ch: 22}, {line: 1, ch: 24});

0 commit comments

Comments
 (0)