diff --git a/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.coffee b/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.coffee index cdeab6c3b9..53b3eac261 100644 --- a/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.coffee +++ b/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.coffee @@ -157,8 +157,6 @@ define [ if lastTwoChars.match(/^\\[^a-zA-Z]$/) @editor?.completer?.detach?() return - if commandName in ['begin', 'end'] - return # Check that this change was made by us, not a collaborator # (Cursor is still one place behind) # NOTE: this is also the case when a user backspaces over a highlighted region diff --git a/services/web/public/js/ace-1.2.5/mode-latex.js b/services/web/public/js/ace-1.2.5/mode-latex.js index df84725189..2f4c3d3211 100644 --- a/services/web/public/js/ace-1.2.5/mode-latex.js +++ b/services/web/public/js/ace-1.2.5/mode-latex.js @@ -4,7 +4,7 @@ ace.define("ace/mode/latex_highlight_rules",["require","exports","module","ace/l var oop = require("../lib/oop"); var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var LatexHighlightRules = function() { +var LatexHighlightRules = function() { this.$rules = { "start" : [{ @@ -47,9 +47,9 @@ var LatexHighlightRules = function() { token : "constant.character.escape", regex : "\\\\(?:[^a-zA-Z]|[a-zA-Z]+)" }, { - token : "error", - regex : "^\\s*$", - next : "start" + token : "error", + regex : "^\\s*$", + next : "start" }, { defaultToken : "string" }] @@ -76,16 +76,16 @@ oop.inherits(FoldMode, BaseFoldMode); (function() { - this.foldingStartMarker = /^\s*\\(begin)|(section|subsection|paragraph)\b|{\s*$/; + this.foldingStartMarker = /^\s*\\(begin|section|subsection|subsubsection|paragraph|part|chapter)\b|{\s*$/; this.foldingStopMarker = /^\s*\\(end)\b|^\s*}/; this.getFoldWidgetRange = function(session, foldStyle, row) { var line = session.doc.getLine(row); var match = this.foldingStartMarker.exec(line); if (match) { - if (match[1]) + if (match[1] === "begin") return this.latexBlock(session, row, match[0].length - 1); - if (match[2]) + else if (match[1]) return this.latexSection(session, row, match[0].length - 1); return this.openingBracketBlock(session, "{", row, match.index); @@ -153,7 +153,7 @@ oop.inherits(FoldMode, BaseFoldMode); }; this.latexSection = function(session, row, column) { - var keywords = ["\\subsection", "\\section", "\\begin", "\\end", "\\paragraph"]; + var keywords = ["\\subsection", "\\section", "\\begin", "\\end", "\\paragraph", "\\part", "\\chapter"]; var stream = new TokenIterator(session, row, column); var token = stream.getCurrentToken();