diff --git a/lib/ace/edit_session/folding.js b/lib/ace/edit_session/folding.js index 1735e6f9..3aefea84 100644 --- a/lib/ace/edit_session/folding.js +++ b/lib/ace/edit_session/folding.js @@ -273,7 +273,7 @@ function Folding() { // --- Some checking --- if (!(startRow < endRow || - startRow == endRow && startColumn < endColumn - 2)) + startRow == endRow && startColumn <= endColumn - 2)) throw "The range has to be at least 2 characters width"; var startFold = this.getFoldAt(startRow, startColumn, 1); diff --git a/lib/ace/mode/_test/tokens_batchfile.json b/lib/ace/mode/_test/tokens_batchfile.json index d685d835..0f1f138c 100644 --- a/lib/ace/mode/_test/tokens_batchfile.json +++ b/lib/ace/mode/_test/tokens_batchfile.json @@ -14,16 +14,12 @@ ["text"," "], ["keyword.command.dosbatch","set"], ["text"," var1="], - ["markup.list","%"], - ["constant.other","cd"], - ["markup.list","%"] + ["constant.numeric","%cd%"] ],[ "start", ["keyword.command.dosbatch","echo"], ["text"," unhide everything in "], - ["markup.list","%"], - ["constant.other","var1"], - ["markup.list","%"], + ["constant.numeric","%var1%"], ["text","!"] ],[ "start" @@ -46,19 +42,13 @@ "start", ["keyword.command.dosbatch","echo"], ["text"," "], - ["markup.list","%"], - ["constant.other","var1"], - ["markup.list","%"], - ["constant.numeric","%%G"] + ["constant.numeric","%var1%%%G"] ],[ "start", ["keyword.command.dosbatch","attrib"], ["text"," -r -a -h -s "], ["punctuation.definition.string.begin.shell","\""], - ["markup.list","%"], - ["constant.other","var1"], - ["markup.list","%"], - ["constant.numeric","%%G"], + ["constant.numeric","%var1%%%G"], ["punctuation.definition.string.end.shell","\""], ["text"," /D /S"] ],[ diff --git a/lib/ace/mouse/mouse_handler.js b/lib/ace/mouse/mouse_handler.js index a0afd3b4..a30fe76b 100644 --- a/lib/ace/mouse/mouse_handler.js +++ b/lib/ace/mouse/mouse_handler.js @@ -50,8 +50,10 @@ var MouseHandler = function(editor) { event.addListener(mouseTarget, "click", this.onMouseEvent.bind(this, "click")); event.addListener(mouseTarget, "mousemove", this.onMouseMove.bind(this, "mousemove")); event.addMultiMouseDownListener(mouseTarget, [300, 300, 250], this, "onMouseEvent"); - event.addMultiMouseDownListener(editor.renderer.scrollBarV.inner, [300, 300, 250], this, "onMouseEvent"); - event.addMultiMouseDownListener(editor.renderer.scrollBarH.inner, [300, 300, 250], this, "onMouseEvent"); + if (editor.renderer.scrollBarV) { + event.addMultiMouseDownListener(editor.renderer.scrollBarV.inner, [300, 300, 250], this, "onMouseEvent"); + event.addMultiMouseDownListener(editor.renderer.scrollBarH.inner, [300, 300, 250], this, "onMouseEvent"); + } event.addMouseWheelListener(editor.container, this.onMouseWheel.bind(this, "mousewheel")); var gutterEl = editor.renderer.$gutter;