From 175ed3618b48bdfa07c2491aaa0b0bb748c3fbbe Mon Sep 17 00:00:00 2001 From: nightwing Date: Tue, 23 Oct 2012 09:48:18 +0400 Subject: [PATCH 1/5] #1054 Opera indent bug --- lib/ace/mode/behaviour/cstyle.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ace/mode/behaviour/cstyle.js b/lib/ace/mode/behaviour/cstyle.js index 8397e79c..346b5867 100644 --- a/lib/ace/mode/behaviour/cstyle.js +++ b/lib/ace/mode/behaviour/cstyle.js @@ -116,7 +116,7 @@ var CstyleBehaviour = function () { }; } } - } else if (text == "\n") { + } else if (text == "\n" || text == "\r\n") { var cursor = editor.getCursorPosition(); var line = session.doc.getLine(cursor.row); var rightChar = line.substring(cursor.column, cursor.column + 1); From 2983fcb9b6f7051eb362c03c1b7801f7c5b218fe Mon Sep 17 00:00:00 2001 From: nightwing Date: Tue, 23 Oct 2012 21:21:46 +0400 Subject: [PATCH 2/5] #1061: Problem optimizing ace sources with requirejs optimizer --- lib/ace/lib/useragent.js | 56 +++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/lib/ace/lib/useragent.js b/lib/ace/lib/useragent.js index e1f9be7a..14f0ee9b 100644 --- a/lib/ace/lib/useragent.js +++ b/lib/ace/lib/useragent.js @@ -31,6 +31,36 @@ define(function(require, exports, module) { "use strict"; +/* + * I hate doing this, but we need some way to determine if the user is on a Mac + * The reason is that users have different expectations of their key combinations. + * + * Take copy as an example, Mac people expect to use CMD or APPLE + C + * Windows folks expect to use CTRL + C + */ +exports.OS = { + LINUX: "LINUX", + MAC: "MAC", + WINDOWS: "WINDOWS" +}; + +/* + * Return an exports.OS constant + */ +exports.getOS = function() { + if (exports.isMac) { + return exports.OS.MAC; + } else if (exports.isLinux) { + return exports.OS.LINUX; + } else { + return exports.OS.WINDOWS; + } +}; + +// this can be called in non browser environments (e.g. from ace/requirejs/text) +if (typeof navigator != "object") + return; + var os = (navigator.platform.match(/mac|win|linux/i) || ["other"])[0].toLowerCase(); var ua = navigator.userAgent; @@ -69,30 +99,4 @@ exports.isIPad = ua.indexOf("iPad") >= 0; exports.isTouchPad = ua.indexOf("TouchPad") >= 0; -/* - * I hate doing this, but we need some way to determine if the user is on a Mac - * The reason is that users have different expectations of their key combinations. - * - * Take copy as an example, Mac people expect to use CMD or APPLE + C - * Windows folks expect to use CTRL + C - */ -exports.OS = { - LINUX: "LINUX", - MAC: "MAC", - WINDOWS: "WINDOWS" -}; - -/* - * Return an exports.OS constant - */ -exports.getOS = function() { - if (exports.isMac) { - return exports.OS.MAC; - } else if (exports.isLinux) { - return exports.OS.LINUX; - } else { - return exports.OS.WINDOWS; - } -}; - }); From c4c8b2ec7e4c9ea5ef4db4be46982215d6419e4f Mon Sep 17 00:00:00 2001 From: nightwing Date: Wed, 24 Oct 2012 11:14:11 +0400 Subject: [PATCH 3/5] fix typo --- demo/kitchen-sink/token_tooltip.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo/kitchen-sink/token_tooltip.js b/demo/kitchen-sink/token_tooltip.js index 61977335..b16966c2 100644 --- a/demo/kitchen-sink/token_tooltip.js +++ b/demo/kitchen-sink/token_tooltip.js @@ -146,7 +146,7 @@ var TokenTooltip = function(editor) { var st = tooltipNode.style; if (x + 10 + this.tooltipWidth > this.maxWidth) x = innerWidth - this.tooltipWidth - 10; - if (y > innerHeight * 0.75 || y + 20 + this.tooltipHeight > this.maxHeight); + if (y > innerHeight * 0.75 || y + 20 + this.tooltipHeight > this.maxHeight) y = y - this.tooltipHeight - 30; st.left = x + 10 + "px"; From f02db6ff62dff53b52edba2023fb9b7a81281179 Mon Sep 17 00:00:00 2001 From: nightwing Date: Fri, 26 Oct 2012 14:37:45 +0400 Subject: [PATCH 4/5] fix vim zz --- lib/ace/keyboard/vim/commands.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ace/keyboard/vim/commands.js b/lib/ace/keyboard/vim/commands.js index 78dc4fa7..a9b24aa3 100644 --- a/lib/ace/keyboard/vim/commands.js +++ b/lib/ace/keyboard/vim/commands.js @@ -74,13 +74,13 @@ var actions = exports.actions = { fn: function(editor, range, count, param) { switch (param) { case "z": - editor.alignCursor(null, 0.5); + editor.renderer.alignCursor(null, 0.5); break; case "t": - editor.alignCursor(null, 0); + editor.renderer.alignCursor(null, 0); break; case "b": - editor.alignCursor(null, 1); + editor.renderer.alignCursor(null, 1); break; } } From c0841aa843e2fdecbc8f77b98da2817c34f58821 Mon Sep 17 00:00:00 2001 From: nightwing Date: Sun, 4 Nov 2012 17:28:20 +0400 Subject: [PATCH 5/5] add missing else --- lib/ace/layer/marker.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/ace/layer/marker.js b/lib/ace/layer/marker.js index e09a3c9b..c68d3964 100644 --- a/lib/ace/layer/marker.js +++ b/lib/ace/layer/marker.js @@ -80,17 +80,14 @@ var Marker = function(parentEl) { var top = this.$getTop(range.start.row, config); var left = this.$padding + range.start.column * config.characterWidth; marker.renderer(html, range, left, top, config); - } - if (marker.type == "fullLine") { + } else if (marker.type == "fullLine") { this.drawFullLineMarker(html, range, marker.clazz, config); - } - else if (range.isMultiLine()) { + } else if (range.isMultiLine()) { if (marker.type == "text") this.drawTextMarker(html, range, marker.clazz, config); else this.drawMultiLineMarker(html, range, marker.clazz, config); - } - else { + } else { this.drawSingleLineMarker(html, range, marker.clazz + " ace_start", config); } }