Skip to content

Commit

Permalink
[closetag addon] Fix false positive close situation
Browse files Browse the repository at this point in the history
Closes #1844
  • Loading branch information
marijnh committed Oct 1, 2013
1 parent cfb624d commit 5681dd0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addon/edit/closetag.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
function autoCloseSlash(cm) {
var pos = cm.getCursor(), tok = cm.getTokenAt(pos);
var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state;
if (tok.string.charAt(0) != "<" || inner.mode.name != "xml") return CodeMirror.Pass;
if (tok.string.charAt(0) != "<" || tok.start != pos.ch - 1 || inner.mode.name != "xml") return CodeMirror.Pass;

var tagName = state.context && state.context.tagName;
if (tagName) cm.replaceSelection("/" + tagName + ">", "end");
Expand Down

0 comments on commit 5681dd0

Please sign in to comment.