diff --git a/src/language/HTMLUtils.js b/src/language/HTMLUtils.js index 7f167562dba..38478222694 100644 --- a/src/language/HTMLUtils.js +++ b/src/language/HTMLUtils.js @@ -407,7 +407,7 @@ define(function (require, exports, module) { // Check to see if this is the closing of a tag (either the start or end) closing tag if (ctx.token.string.charAt(0) === "<" && ctx.token.string.charAt(1) === "/") { - return createTagInfo(CLOSING_TAG, offset + 2, ctx.token.string.slice(2)); + return createTagInfo(CLOSING_TAG, offset - 2, ctx.token.string.slice(2)); } // Make sure the cursor is not after an equal sign or a quote before we report the context as a tag. diff --git a/test/spec/CodeHintUtils-test.js b/test/spec/CodeHintUtils-test.js index 02e33c8b2ac..34c92fb2ce0 100644 --- a/test/spec/CodeHintUtils-test.js +++ b/test/spec/CodeHintUtils-test.js @@ -186,14 +186,14 @@ define(function (require, exports, module) { expect(tag).toEqual(HTMLUtils.createTagInfo(HTMLUtils.TAG_NAME)); }); - it("should hint tagname for a closing tag", function () { + it("should not hint anything inside a closing tag", function () { var pos = {"ch": 0, "line": 0}; setContentAndUpdatePos(pos, ["", "
", ""], ""); var tag = HTMLUtils.getTagInfo(myEditor, pos); - expect(tag).toEqual(HTMLUtils.createTagInfo(HTMLUtils.CLOSING_TAG, 6, "html")); + expect(tag).toEqual(HTMLUtils.createTagInfo(HTMLUtils.CLOSING_TAG, 2, "html")); }); it("should find the tagname of the current tag if two tags are right next to each other", function () { diff --git a/test/spec/InlineEditorProviders-test-files/test1.html b/test/spec/InlineEditorProviders-test-files/test1.html index b5bc8734841..8035194a733 100644 --- a/test/spec/InlineEditorProviders-test-files/test1.html +++ b/test/spec/InlineEditorProviders-test-files/test1.html @@ -8,6 +8,6 @@