diff --git a/lib/ace/mode/php.js b/lib/ace/mode/php.js index aeea09c6..a73f3e84 100644 --- a/lib/ace/mode/php.js +++ b/lib/ace/mode/php.js @@ -98,16 +98,29 @@ oop.inherits(Mode, TextMode); var tokenizedLine = this.$tokenizer.getLineTokens(line, state); var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + if (tokens.length && tokens[tokens.length-1].type == "comment") { return indent; } - if (state == "start") { + if (state == "php-start") { var match = line.match(/^.*[\{\(\[\:]\s*$/); if (match) { indent += tab; } + } else if (state == "php-doc-start") { + if (endState != "php-doc-start") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } } return indent;