autoindent from start of tag

This commit is contained in:
Adam Jimenez 2014-10-29 10:13:20 +00:00
commit 5e724c5ebd

View file

@ -34,6 +34,7 @@ define(function(require, exports, module) {
var oop = require("../../lib/oop");
var Behaviour = require("../behaviour").Behaviour;
var TokenIterator = require("../../token_iterator").TokenIterator;
var lang = require("../../lib/lang");
function is(token, type) {
return token.type.lastIndexOf(type + ".xml") > -1;
@ -164,6 +165,7 @@ var XmlBehaviour = function () {
}
var tag = token.value;
var column = iterator.getCurrentTokenColumn()-1;
//don't indent after closing tag
token = iterator.stepBackward();
@ -173,7 +175,7 @@ var XmlBehaviour = function () {
if (this.voidElements && !this.voidElements[tag]) {
var nextToken = session.getTokenAt(cursor.row, cursor.column+1);
var next_indent = this.$getIndent(line);
var next_indent = lang.stringRepeat(" ", column);
var indent = next_indent + session.getTabString();
if (nextToken && nextToken.value === "</") {