Merge pull request #1723 from ajaxorg/misc

fix several small bugs
This commit is contained in:
Lennart Kats 2013-12-25 07:11:00 -08:00
commit c612dac355
22 changed files with 3407 additions and 1006 deletions

View file

@ -44,8 +44,8 @@ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
var unicode = require("../unicode");
var Mode = function(opts) {
var inline = opts && opts.inline;
var HighlightRules = inline ? PhpLangHighlightRules : PhpHighlightRules;
this.inlinePhp = opts && opts.inline;
var HighlightRules = this.inlinePhp ? PhpLangHighlightRules : PhpHighlightRules;
this.HighlightRules = HighlightRules;
this.$outdent = new MatchingBraceOutdent();
this.$behaviour = new CstyleBehaviour();
@ -117,6 +117,9 @@ oop.inherits(Mode, TextMode);
this.createWorker = function(session) {
var worker = new WorkerClient(["ace"], "ace/mode/php_worker", "PhpWorker");
worker.attachToDocument(session.getDocument());
if (this.inlinePhp)
worker.call("setOptions", [{inline: true}]);
worker.on("error", function(e) {
session.setAnnotations(e.data);