From de37fac6802286a9aeafb32f3f0b8449e4e360f9 Mon Sep 17 00:00:00 2001 From: Philipp Scheit Date: Tue, 19 Jun 2012 15:26:31 +0300 Subject: [PATCH 01/47] fix trailing "," in object literal --- lib/ace/keyboard/state_handler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ace/keyboard/state_handler.js b/lib/ace/keyboard/state_handler.js index c7efe552..fa7e5d5c 100644 --- a/lib/ace/keyboard/state_handler.js +++ b/lib/ace/keyboard/state_handler.js @@ -105,7 +105,7 @@ StateHandler.prototype = { var bufferObj = { bufferToUse: bufferToUse, - symbolicName: symbolicName, + symbolicName: symbolicName }; if (e) { From 0ae3b0922a65f733883cd6ffe385070efc7a4c71 Mon Sep 17 00:00:00 2001 From: Philipp Scheit Date: Tue, 19 Jun 2012 17:31:22 +0300 Subject: [PATCH 02/47] remove traling comma in object literal --- lib/ace/mode/javascript_highlight_rules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ace/mode/javascript_highlight_rules.js b/lib/ace/mode/javascript_highlight_rules.js index 63348303..ad3efba8 100644 --- a/lib/ace/mode/javascript_highlight_rules.js +++ b/lib/ace/mode/javascript_highlight_rules.js @@ -380,7 +380,7 @@ var JavaScriptHighlightRules = function() { "function_arguments": [ { token: "variable.parameter", - regex: identifierRe, + regex: identifierRe }, { token: "punctuation.operator", regex: "[, ]+", From 21d8ed2fd35f036f1d6ed626a99e73687dbf9f39 Mon Sep 17 00:00:00 2001 From: Giannis Date: Tue, 26 Jun 2012 19:51:05 +0300 Subject: [PATCH 03/47] * update gutter color for themes --- lib/ace/theme/chrome.css | 2 +- lib/ace/theme/clouds.css | 2 +- lib/ace/theme/clouds_midnight.css | 4 ++-- lib/ace/theme/cobalt.css | 4 ++-- lib/ace/theme/crimson_editor.css | 2 +- lib/ace/theme/dawn.css | 2 +- lib/ace/theme/eclipse.css | 4 ++-- lib/ace/theme/idle_fingers.css | 4 ++-- lib/ace/theme/kr_theme.css | 4 ++-- lib/ace/theme/merbivore_soft.css | 4 ++-- lib/ace/theme/mono_industrial.css | 2 +- lib/ace/theme/monokai.css | 2 +- lib/ace/theme/pastel_on_dark.css | 4 ++-- lib/ace/theme/solarized_dark.css | 2 +- lib/ace/theme/solarized_light.css | 2 +- lib/ace/theme/textmate.css | 2 +- lib/ace/theme/tomorrow.css | 4 ++-- lib/ace/theme/tomorrow_night.css | 4 ++-- lib/ace/theme/tomorrow_night_blue.css | 4 ++-- lib/ace/theme/tomorrow_night_bright.css | 4 ++-- lib/ace/theme/tomorrow_night_eighties.css | 4 ++-- lib/ace/theme/twilight.css | 4 ++-- lib/ace/theme/vibrant_ink.css | 4 ++-- 23 files changed, 37 insertions(+), 37 deletions(-) diff --git a/lib/ace/theme/chrome.css b/lib/ace/theme/chrome.css index 3283e127..425071dc 100644 --- a/lib/ace/theme/chrome.css +++ b/lib/ace/theme/chrome.css @@ -7,7 +7,7 @@ } .ace-chrome .ace_gutter { - background: #e8e8e8; + background: #ebebeb; color: #333; overflow : hidden; } diff --git a/lib/ace/theme/clouds.css b/lib/ace/theme/clouds.css index fe19f765..1622cec2 100644 --- a/lib/ace/theme/clouds.css +++ b/lib/ace/theme/clouds.css @@ -8,7 +8,7 @@ } .ace-clouds .ace_gutter { - background: #e8e8e8; + background: #ebebeb; color: #333; } diff --git a/lib/ace/theme/clouds_midnight.css b/lib/ace/theme/clouds_midnight.css index 8f78b84e..f54c7dcb 100644 --- a/lib/ace/theme/clouds_midnight.css +++ b/lib/ace/theme/clouds_midnight.css @@ -8,13 +8,13 @@ } .ace-clouds-midnight .ace_gutter { - background: #e8e8e8; + background: #232323; color: #333; } .ace-clouds-midnight .ace_print_margin { width: 1px; - background: #e8e8e8; + background: #232323; } .ace-clouds-midnight .ace_scroller { diff --git a/lib/ace/theme/cobalt.css b/lib/ace/theme/cobalt.css index 4d4bc633..ad1cd8a2 100644 --- a/lib/ace/theme/cobalt.css +++ b/lib/ace/theme/cobalt.css @@ -8,13 +8,13 @@ } .ace-cobalt .ace_gutter { - background: #e8e8e8; + background: #011e3a; color: #333; } .ace-cobalt .ace_print_margin { width: 1px; - background: #e8e8e8; + background: #011e3a; } .ace-cobalt .ace_scroller { diff --git a/lib/ace/theme/crimson_editor.css b/lib/ace/theme/crimson_editor.css index b10bf3b6..efd0d923 100644 --- a/lib/ace/theme/crimson_editor.css +++ b/lib/ace/theme/crimson_editor.css @@ -7,7 +7,7 @@ } .ace-crimson-editor .ace_gutter { - background: #e8e8e8; + background: #ebebeb; color: #333; overflow : hidden; } diff --git a/lib/ace/theme/dawn.css b/lib/ace/theme/dawn.css index 54763212..94cbd1c3 100644 --- a/lib/ace/theme/dawn.css +++ b/lib/ace/theme/dawn.css @@ -8,7 +8,7 @@ } .ace-dawn .ace_gutter { - background: #e8e8e8; + background: #ebebeb; color: #333; } diff --git a/lib/ace/theme/eclipse.css b/lib/ace/theme/eclipse.css index a45ea999..f02283b2 100644 --- a/lib/ace/theme/eclipse.css +++ b/lib/ace/theme/eclipse.css @@ -7,14 +7,14 @@ } .ace-eclipse .ace_gutter { - background: rgb(227, 227, 227); + background: #ebebeb; border-right: 1px solid rgb(159, 159, 159); color: rgb(136, 136, 136); } .ace-eclipse .ace_print_margin { width: 1px; - background: #b1b4ba; + background: #ebebeb; } .ace-eclipse .ace_fold { diff --git a/lib/ace/theme/idle_fingers.css b/lib/ace/theme/idle_fingers.css index f3fdb2a8..603295eb 100644 --- a/lib/ace/theme/idle_fingers.css +++ b/lib/ace/theme/idle_fingers.css @@ -8,13 +8,13 @@ } .ace-idle-fingers .ace_gutter { - background: #e8e8e8; + background: #3b3b3b; color: #333; } .ace-idle-fingers .ace_print_margin { width: 1px; - background: #e8e8e8; + background: #3b3b3b; } .ace-idle-fingers .ace_scroller { diff --git a/lib/ace/theme/kr_theme.css b/lib/ace/theme/kr_theme.css index 8c8a4da9..3ce6a62b 100644 --- a/lib/ace/theme/kr_theme.css +++ b/lib/ace/theme/kr_theme.css @@ -8,13 +8,13 @@ } .ace-kr-theme .ace_gutter { - background: #e8e8e8; + background: #1c1917; color: #333; } .ace-kr-theme .ace_print_margin { width: 1px; - background: #e8e8e8; + background: #1c1917; } .ace-kr-theme .ace_scroller { diff --git a/lib/ace/theme/merbivore_soft.css b/lib/ace/theme/merbivore_soft.css index 4021c275..90d37bf7 100644 --- a/lib/ace/theme/merbivore_soft.css +++ b/lib/ace/theme/merbivore_soft.css @@ -8,13 +8,13 @@ } .ace-merbivore-soft .ace_gutter { - background: #e8e8e8; + background: #262424; color: #333; } .ace-merbivore-soft .ace_print_margin { width: 1px; - background: #e8e8e8; + background: #262424; } .ace-merbivore-soft .ace_scroller { diff --git a/lib/ace/theme/mono_industrial.css b/lib/ace/theme/mono_industrial.css index dbe006e0..6467a33f 100644 --- a/lib/ace/theme/mono_industrial.css +++ b/lib/ace/theme/mono_industrial.css @@ -8,7 +8,7 @@ } .ace-mono-industrial .ace_gutter { - background: #e8e8e8; + background: #1d2521; color: #333; } diff --git a/lib/ace/theme/monokai.css b/lib/ace/theme/monokai.css index 54d051e2..cae92734 100644 --- a/lib/ace/theme/monokai.css +++ b/lib/ace/theme/monokai.css @@ -8,7 +8,7 @@ } .ace-monokai .ace_gutter { - background: #292a24; + background: #2f3129; color: #f1f1f1; } diff --git a/lib/ace/theme/pastel_on_dark.css b/lib/ace/theme/pastel_on_dark.css index 735da017..3fd17617 100644 --- a/lib/ace/theme/pastel_on_dark.css +++ b/lib/ace/theme/pastel_on_dark.css @@ -8,13 +8,13 @@ } .ace-pastel-on-dark .ace_gutter { - background: #e8e8e8; + background: #353030; color: #333; } .ace-pastel-on-dark .ace_print_margin { width: 1px; - background: #e8e8e8; + background: #353030; } .ace-pastel-on-dark .ace_scroller { diff --git a/lib/ace/theme/solarized_dark.css b/lib/ace/theme/solarized_dark.css index 437bab60..df259e8b 100644 --- a/lib/ace/theme/solarized_dark.css +++ b/lib/ace/theme/solarized_dark.css @@ -8,7 +8,7 @@ } .ace-solarized-dark .ace_gutter { - background: #09222b; + background: #01313f; color: #d0edf7; } diff --git a/lib/ace/theme/solarized_light.css b/lib/ace/theme/solarized_light.css index 1c00cb36..1bd26c83 100644 --- a/lib/ace/theme/solarized_light.css +++ b/lib/ace/theme/solarized_light.css @@ -8,7 +8,7 @@ } .ace-solarized-light .ace_gutter { - background: #e8e8e8; + background: #fbf1d3; color: #333; } diff --git a/lib/ace/theme/textmate.css b/lib/ace/theme/textmate.css index c35c8599..adfefa81 100644 --- a/lib/ace/theme/textmate.css +++ b/lib/ace/theme/textmate.css @@ -7,7 +7,7 @@ } .ace-tm .ace_gutter { - background: #e8e8e8; + background: #f0f0f0; color: #333; } diff --git a/lib/ace/theme/tomorrow.css b/lib/ace/theme/tomorrow.css index 5aef8dc4..ca563c3d 100644 --- a/lib/ace/theme/tomorrow.css +++ b/lib/ace/theme/tomorrow.css @@ -8,13 +8,13 @@ } .ace-tomorrow .ace_gutter { - background: #e8e8e8; + background: #f6f6f6; color: #333; } .ace-tomorrow .ace_print_margin { width: 1px; - background: #e8e8e8; + background: #f6f6f6; } .ace-tomorrow .ace_scroller { diff --git a/lib/ace/theme/tomorrow_night.css b/lib/ace/theme/tomorrow_night.css index a920d173..ab8bc0dd 100644 --- a/lib/ace/theme/tomorrow_night.css +++ b/lib/ace/theme/tomorrow_night.css @@ -8,13 +8,13 @@ } .ace-tomorrow-night .ace_gutter { - background: #e8e8e8; + background: #25282c; color: #333; } .ace-tomorrow-night .ace_print_margin { width: 1px; - background: #e8e8e8; + background: #25282c; } .ace-tomorrow-night .ace_scroller { diff --git a/lib/ace/theme/tomorrow_night_blue.css b/lib/ace/theme/tomorrow_night_blue.css index 068e5bea..1bcc86c3 100644 --- a/lib/ace/theme/tomorrow_night_blue.css +++ b/lib/ace/theme/tomorrow_night_blue.css @@ -8,13 +8,13 @@ } .ace-tomorrow-night-blue .ace_gutter { - background: #022346; + background: #00204b; color: #7388b5; } .ace-tomorrow-night-blue .ace_print_margin { width: 1px; - background: #e8e8e8; + background: #00204b; } .ace-tomorrow-night-blue .ace_scroller { diff --git a/lib/ace/theme/tomorrow_night_bright.css b/lib/ace/theme/tomorrow_night_bright.css index 25f62064..077f6bb2 100644 --- a/lib/ace/theme/tomorrow_night_bright.css +++ b/lib/ace/theme/tomorrow_night_bright.css @@ -8,13 +8,13 @@ } .ace-tomorrow-night-bright .ace_gutter { - background: #e8e8e8; + background: #1a1a1a; color: #333; } .ace-tomorrow-night-bright .ace_print_margin { width: 1px; - background: #e8e8e8; + background: #1a1a1a; } .ace-tomorrow-night-bright .ace_scroller { diff --git a/lib/ace/theme/tomorrow_night_eighties.css b/lib/ace/theme/tomorrow_night_eighties.css index e798393f..001b1ff4 100644 --- a/lib/ace/theme/tomorrow_night_eighties.css +++ b/lib/ace/theme/tomorrow_night_eighties.css @@ -8,13 +8,13 @@ } .ace-tomorrow-night-eighties .ace_gutter { - background: #e8e8e8; + background: #272727; color: #333; } .ace-tomorrow-night-eighties .ace_print_margin { width: 1px; - background: #e8e8e8; + background: #272727; } .ace-tomorrow-night-eighties .ace_scroller { diff --git a/lib/ace/theme/twilight.css b/lib/ace/theme/twilight.css index 02f51284..3bb7ec84 100644 --- a/lib/ace/theme/twilight.css +++ b/lib/ace/theme/twilight.css @@ -8,13 +8,13 @@ } .ace-twilight .ace_gutter { - background: #e8e8e8; + background: #232323; color: #333; } .ace-twilight .ace_print_margin { width: 1px; - background: #e8e8e8; + background: #232323; } .ace-twilight .ace_scroller { diff --git a/lib/ace/theme/vibrant_ink.css b/lib/ace/theme/vibrant_ink.css index 41ca13f6..e07e5913 100644 --- a/lib/ace/theme/vibrant_ink.css +++ b/lib/ace/theme/vibrant_ink.css @@ -8,13 +8,13 @@ } .ace-vibrant-ink .ace_gutter { - background: #e8e8e8; + background: #1a1a1a; color: #333; } .ace-vibrant-ink .ace_print_margin { width: 1px; - background: #e8e8e8; + background: #1a1a1a; } .ace-vibrant-ink .ace_scroller { From 78975a0fc26eda9137b9caf11b63fe6f1ea7283f Mon Sep 17 00:00:00 2001 From: Giannis Date: Wed, 27 Jun 2012 18:26:46 +0300 Subject: [PATCH 04/47] * update gutter font color --- lib/ace/theme/clouds_midnight.css | 2 +- lib/ace/theme/cobalt.css | 2 +- lib/ace/theme/idle_fingers.css | 2 +- lib/ace/theme/kr_theme.css | 2 +- lib/ace/theme/merbivore.css | 4 ++-- lib/ace/theme/merbivore_soft.css | 2 +- lib/ace/theme/mono_industrial.css | 2 +- lib/ace/theme/pastel_on_dark.css | 2 +- lib/ace/theme/tomorrow.css | 2 +- lib/ace/theme/tomorrow_night.css | 2 +- lib/ace/theme/tomorrow_night_bright.css | 2 +- lib/ace/theme/tomorrow_night_eighties.css | 2 +- lib/ace/theme/twilight.css | 2 +- lib/ace/theme/vibrant_ink.css | 2 +- 14 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/ace/theme/clouds_midnight.css b/lib/ace/theme/clouds_midnight.css index f54c7dcb..75d96274 100644 --- a/lib/ace/theme/clouds_midnight.css +++ b/lib/ace/theme/clouds_midnight.css @@ -9,7 +9,7 @@ .ace-clouds-midnight .ace_gutter { background: #232323; - color: #333; + color: #929292; } .ace-clouds-midnight .ace_print_margin { diff --git a/lib/ace/theme/cobalt.css b/lib/ace/theme/cobalt.css index ad1cd8a2..5b82122b 100644 --- a/lib/ace/theme/cobalt.css +++ b/lib/ace/theme/cobalt.css @@ -9,7 +9,7 @@ .ace-cobalt .ace_gutter { background: #011e3a; - color: #333; + color: #fff; } .ace-cobalt .ace_print_margin { diff --git a/lib/ace/theme/idle_fingers.css b/lib/ace/theme/idle_fingers.css index 603295eb..ad0e0840 100644 --- a/lib/ace/theme/idle_fingers.css +++ b/lib/ace/theme/idle_fingers.css @@ -9,7 +9,7 @@ .ace-idle-fingers .ace_gutter { background: #3b3b3b; - color: #333; + color: #fff; } .ace-idle-fingers .ace_print_margin { diff --git a/lib/ace/theme/kr_theme.css b/lib/ace/theme/kr_theme.css index 3ce6a62b..b790ea1b 100644 --- a/lib/ace/theme/kr_theme.css +++ b/lib/ace/theme/kr_theme.css @@ -9,7 +9,7 @@ .ace-kr-theme .ace_gutter { background: #1c1917; - color: #333; + color: #FCFFE0; } .ace-kr-theme .ace_print_margin { diff --git a/lib/ace/theme/merbivore.css b/lib/ace/theme/merbivore.css index e8b62802..09a3bf09 100644 --- a/lib/ace/theme/merbivore.css +++ b/lib/ace/theme/merbivore.css @@ -8,8 +8,8 @@ } .ace-merbivore .ace_gutter { - background: #e8e8e8; - color: #333; + background: #202020; + color: #E6E1DC; } .ace-merbivore .ace_print_margin { diff --git a/lib/ace/theme/merbivore_soft.css b/lib/ace/theme/merbivore_soft.css index 90d37bf7..e4593535 100644 --- a/lib/ace/theme/merbivore_soft.css +++ b/lib/ace/theme/merbivore_soft.css @@ -9,7 +9,7 @@ .ace-merbivore-soft .ace_gutter { background: #262424; - color: #333; + color: #E6E1DC; } .ace-merbivore-soft .ace_print_margin { diff --git a/lib/ace/theme/mono_industrial.css b/lib/ace/theme/mono_industrial.css index 6467a33f..77e8569b 100644 --- a/lib/ace/theme/mono_industrial.css +++ b/lib/ace/theme/mono_industrial.css @@ -9,7 +9,7 @@ .ace-mono-industrial .ace_gutter { background: #1d2521; - color: #333; + color: #fff; } .ace-mono-industrial .ace_print_margin { diff --git a/lib/ace/theme/pastel_on_dark.css b/lib/ace/theme/pastel_on_dark.css index 3fd17617..8c480937 100644 --- a/lib/ace/theme/pastel_on_dark.css +++ b/lib/ace/theme/pastel_on_dark.css @@ -9,7 +9,7 @@ .ace-pastel-on-dark .ace_gutter { background: #353030; - color: #333; + color: #8F938F; } .ace-pastel-on-dark .ace_print_margin { diff --git a/lib/ace/theme/tomorrow.css b/lib/ace/theme/tomorrow.css index ca563c3d..e65d3a5a 100644 --- a/lib/ace/theme/tomorrow.css +++ b/lib/ace/theme/tomorrow.css @@ -9,7 +9,7 @@ .ace-tomorrow .ace_gutter { background: #f6f6f6; - color: #333; + color: #4D4D4C; } .ace-tomorrow .ace_print_margin { diff --git a/lib/ace/theme/tomorrow_night.css b/lib/ace/theme/tomorrow_night.css index ab8bc0dd..a86eb09f 100644 --- a/lib/ace/theme/tomorrow_night.css +++ b/lib/ace/theme/tomorrow_night.css @@ -9,7 +9,7 @@ .ace-tomorrow-night .ace_gutter { background: #25282c; - color: #333; + color: #C5C8C6; } .ace-tomorrow-night .ace_print_margin { diff --git a/lib/ace/theme/tomorrow_night_bright.css b/lib/ace/theme/tomorrow_night_bright.css index 077f6bb2..a2b6a6df 100644 --- a/lib/ace/theme/tomorrow_night_bright.css +++ b/lib/ace/theme/tomorrow_night_bright.css @@ -9,7 +9,7 @@ .ace-tomorrow-night-bright .ace_gutter { background: #1a1a1a; - color: #333; + color: #DEDEDE; } .ace-tomorrow-night-bright .ace_print_margin { diff --git a/lib/ace/theme/tomorrow_night_eighties.css b/lib/ace/theme/tomorrow_night_eighties.css index 001b1ff4..c3d4ce77 100644 --- a/lib/ace/theme/tomorrow_night_eighties.css +++ b/lib/ace/theme/tomorrow_night_eighties.css @@ -9,7 +9,7 @@ .ace-tomorrow-night-eighties .ace_gutter { background: #272727; - color: #333; + color: #CCC; } .ace-tomorrow-night-eighties .ace_print_margin { diff --git a/lib/ace/theme/twilight.css b/lib/ace/theme/twilight.css index 3bb7ec84..e7aeb58c 100644 --- a/lib/ace/theme/twilight.css +++ b/lib/ace/theme/twilight.css @@ -9,7 +9,7 @@ .ace-twilight .ace_gutter { background: #232323; - color: #333; + color: #F8F8F8; } .ace-twilight .ace_print_margin { diff --git a/lib/ace/theme/vibrant_ink.css b/lib/ace/theme/vibrant_ink.css index e07e5913..a1512591 100644 --- a/lib/ace/theme/vibrant_ink.css +++ b/lib/ace/theme/vibrant_ink.css @@ -9,7 +9,7 @@ .ace-vibrant-ink .ace_gutter { background: #1a1a1a; - color: #333; + color: white; } .ace-vibrant-ink .ace_print_margin { From d7ad494a3028d4d7b408bc47fbee1b17ce754600 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Wed, 27 Jun 2012 13:00:16 -0500 Subject: [PATCH 05/47] Add "KeyboardEvent" in window check for old Opera. We've added support for DOM3 Keyboard Events (and cleaned up things) generally--so this workaround won't be needed when those changes land in a stable version of Opera. This change allows older versions of Opera to continue working. --- lib/ace/lib/event.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ace/lib/event.js b/lib/ace/lib/event.js index c4fff32a..bbd35d30 100644 --- a/lib/ace/lib/event.js +++ b/lib/ace/lib/event.js @@ -227,7 +227,7 @@ exports.addMultiMouseDownListener = function(el, timeouts, eventHandler, callbac function normalizeCommandKeys(callback, e, keyCode) { var hashId = 0; - if (useragent.isOpera && useragent.isMac) { + if ((useragent.isOpera && !("KeyboardEvent" in window)) && useragent.isMac) { hashId = 0 | (e.metaKey ? 1 : 0) | (e.altKey ? 2 : 0) | (e.shiftKey ? 4 : 0) | (e.ctrlKey ? 8 : 0); } else { @@ -268,7 +268,7 @@ function normalizeCommandKeys(callback, e, keyCode) { exports.addCommandKeyListener = function(el, callback) { var addListener = exports.addListener; - if (useragent.isOldGecko || useragent.isOpera) { + if (useragent.isOldGecko || useragent.isOpera && !("KeyboardEvent" in window)) { // Old versions of Gecko aka. Firefox < 4.0 didn't repeat the keydown // event if the user pressed the key for a longer time. Instead, the // keydown event was fired once and later on only the keypress event. From d388fe9a8525e75655b097a51ec78319b0bd2e63 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Thu, 28 Jun 2012 14:57:06 -0500 Subject: [PATCH 06/47] Oops, forgot some grouping parens. --- lib/ace/lib/event.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ace/lib/event.js b/lib/ace/lib/event.js index bbd35d30..1afca2a2 100644 --- a/lib/ace/lib/event.js +++ b/lib/ace/lib/event.js @@ -268,7 +268,7 @@ function normalizeCommandKeys(callback, e, keyCode) { exports.addCommandKeyListener = function(el, callback) { var addListener = exports.addListener; - if (useragent.isOldGecko || useragent.isOpera && !("KeyboardEvent" in window)) { + if (useragent.isOldGecko || (useragent.isOpera && !("KeyboardEvent" in window))) { // Old versions of Gecko aka. Firefox < 4.0 didn't repeat the keydown // event if the user pressed the key for a longer time. Instead, the // keydown event was fired once and later on only the keypress event. From b1fca409a88d439799d0892065e5a7f742dafd1e Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Fri, 29 Jun 2012 13:22:49 -0500 Subject: [PATCH 07/47] Tweak github theme Adds grey gutter and yellow highlight Removes bold keywords which cause cursor issues --- lib/ace/theme/github.css | 33 ++++++++++++++++++--------------- lib/ace/theme/github.js | 2 +- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/lib/ace/theme/github.css b/lib/ace/theme/github.css index 31db975c..a501d043 100644 --- a/lib/ace/theme/github.css +++ b/lib/ace/theme/github.css @@ -13,8 +13,13 @@ margin-bottom: 15px; } -.ace-github .ace_keyword { - font-weight: bold; +.ace-github .ace_gutter { + background: #e8e8e8; + color: #AAA; +} + +.ace-github .ace_scroller { + background: #fff; } .ace-github .ace_string { @@ -29,6 +34,14 @@ color: #099; } +.ace-github .ace_constant.ace_buildin { + color: #0086B3; +} + +.ace-github .ace_support.ace_function { + color: #0086B3; +} + .ace-github .ace_comment { color: #998; font-style: italic; @@ -38,15 +51,6 @@ color: #0086B3; } -.ace-github .ace_paren.ace_lparen, -.ace-github .ace_paren.ace_rparen { - font-weight: bold; -} - -.ace-github .ace_constant.ace_language.ace_boolean { - font-weight: bold; -} - .ace-github .ace_string.ace_regexp { color: #009926; font-weight: normal; @@ -56,10 +60,6 @@ color: teal; } -.ace-github .ace_constant.ace_language { - font-weight: bold; -} - .ace-github .ace_text-layer { } @@ -72,6 +72,9 @@ border-bottom: 1px solid black; } +.ace-github .ace_marker-layer .ace_active_line { + background: rgb(255, 255, 204); +} .ace-github .ace_marker-layer .ace_selection { background: rgb(181, 213, 255); } diff --git a/lib/ace/theme/github.js b/lib/ace/theme/github.js index b81731f3..a655724e 100644 --- a/lib/ace/theme/github.js +++ b/lib/ace/theme/github.js @@ -37,7 +37,7 @@ define(function(require, exports, module) { -exports.isDark = true; +exports.isDark = false; exports.cssClass = "ace-github"; exports.cssText = require('ace/requirejs/text!./github.css'); From 9e85280af5bc495e906f071b4a7f45e987cadd82 Mon Sep 17 00:00:00 2001 From: nightwing Date: Fri, 29 Jun 2012 23:14:06 +0400 Subject: [PATCH 08/47] fix gutterline color for dark themes --- lib/ace/theme/clouds_midnight.css | 2 +- lib/ace/theme/cobalt.css | 2 +- lib/ace/theme/idle_fingers.css | 2 +- lib/ace/theme/kr_theme.css | 2 +- lib/ace/theme/merbivore.css | 2 +- lib/ace/theme/merbivore_soft.css | 2 +- lib/ace/theme/mono_industrial.css | 2 +- lib/ace/theme/pastel_on_dark.css | 2 +- lib/ace/theme/tomorrow_night.css | 2 +- lib/ace/theme/tomorrow_night_bright.css | 2 +- lib/ace/theme/tomorrow_night_eighties.css | 2 +- lib/ace/theme/twilight.css | 2 +- lib/ace/theme/vibrant_ink.css | 2 +- tool/Theme.tmpl.css | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/ace/theme/clouds_midnight.css b/lib/ace/theme/clouds_midnight.css index 75d96274..b42113d7 100644 --- a/lib/ace/theme/clouds_midnight.css +++ b/lib/ace/theme/clouds_midnight.css @@ -57,7 +57,7 @@ } .ace-clouds-midnight .ace_gutter_active_line { - background-color : #dcdcdc; + background-color: rgba(215, 215, 215, 0.031); } .ace-clouds-midnight .ace_marker-layer .ace_selected_word { diff --git a/lib/ace/theme/cobalt.css b/lib/ace/theme/cobalt.css index 5b82122b..2a4aaed0 100644 --- a/lib/ace/theme/cobalt.css +++ b/lib/ace/theme/cobalt.css @@ -57,7 +57,7 @@ } .ace-cobalt .ace_gutter_active_line { - background-color : #dcdcdc; + background-color : rgba(0, 0, 0, 0.35); } .ace-cobalt .ace_marker-layer .ace_selected_word { diff --git a/lib/ace/theme/idle_fingers.css b/lib/ace/theme/idle_fingers.css index ad0e0840..ba753f20 100644 --- a/lib/ace/theme/idle_fingers.css +++ b/lib/ace/theme/idle_fingers.css @@ -57,7 +57,7 @@ } .ace-idle-fingers .ace_gutter_active_line { - background-color : #dcdcdc; + background-color: #353637; } .ace-idle-fingers .ace_marker-layer .ace_selected_word { diff --git a/lib/ace/theme/kr_theme.css b/lib/ace/theme/kr_theme.css index b790ea1b..3e5f7332 100644 --- a/lib/ace/theme/kr_theme.css +++ b/lib/ace/theme/kr_theme.css @@ -57,7 +57,7 @@ } .ace-kr-theme .ace_gutter_active_line { - background-color : #dcdcdc; + background-color : #38403D; } .ace-kr-theme .ace_marker-layer .ace_selected_word { diff --git a/lib/ace/theme/merbivore.css b/lib/ace/theme/merbivore.css index 09a3bf09..1048600a 100644 --- a/lib/ace/theme/merbivore.css +++ b/lib/ace/theme/merbivore.css @@ -57,7 +57,7 @@ } .ace-merbivore .ace_gutter_active_line { - background-color : #dcdcdc; + background-color : #333435; } .ace-merbivore .ace_marker-layer .ace_selected_word { diff --git a/lib/ace/theme/merbivore_soft.css b/lib/ace/theme/merbivore_soft.css index e4593535..8e1d24a5 100644 --- a/lib/ace/theme/merbivore_soft.css +++ b/lib/ace/theme/merbivore_soft.css @@ -57,7 +57,7 @@ } .ace-merbivore-soft .ace_gutter_active_line { - background-color : #dcdcdc; + background-color: #333435; } .ace-merbivore-soft .ace_marker-layer .ace_selected_word { diff --git a/lib/ace/theme/mono_industrial.css b/lib/ace/theme/mono_industrial.css index 77e8569b..a8af1bcd 100644 --- a/lib/ace/theme/mono_industrial.css +++ b/lib/ace/theme/mono_industrial.css @@ -57,7 +57,7 @@ } .ace-mono-industrial .ace_gutter_active_line { - background-color : #dcdcdc; + background-color: rgba(12, 13, 12, 0.25); } .ace-mono-industrial .ace_marker-layer .ace_selected_word { diff --git a/lib/ace/theme/pastel_on_dark.css b/lib/ace/theme/pastel_on_dark.css index 8c480937..e220569c 100644 --- a/lib/ace/theme/pastel_on_dark.css +++ b/lib/ace/theme/pastel_on_dark.css @@ -57,7 +57,7 @@ } .ace-pastel-on-dark .ace_gutter_active_line { - background-color : #dcdcdc; + background-color: rgba(255, 255, 255, 0.031); } .ace-pastel-on-dark .ace_marker-layer .ace_selected_word { diff --git a/lib/ace/theme/tomorrow_night.css b/lib/ace/theme/tomorrow_night.css index a86eb09f..3ac694f5 100644 --- a/lib/ace/theme/tomorrow_night.css +++ b/lib/ace/theme/tomorrow_night.css @@ -57,7 +57,7 @@ } .ace-tomorrow-night .ace_gutter_active_line { - background-color : #dcdcdc; + background-color: #282A2E; } .ace-tomorrow-night .ace_marker-layer .ace_selected_word { diff --git a/lib/ace/theme/tomorrow_night_bright.css b/lib/ace/theme/tomorrow_night_bright.css index a2b6a6df..7cee6607 100644 --- a/lib/ace/theme/tomorrow_night_bright.css +++ b/lib/ace/theme/tomorrow_night_bright.css @@ -57,7 +57,7 @@ } .ace-tomorrow-night-bright .ace_gutter_active_line { - background-color : #dcdcdc; + background-color: #2A2A2A; } .ace-tomorrow-night-bright .ace_marker-layer .ace_selected_word { diff --git a/lib/ace/theme/tomorrow_night_eighties.css b/lib/ace/theme/tomorrow_night_eighties.css index c3d4ce77..ce5ef317 100644 --- a/lib/ace/theme/tomorrow_night_eighties.css +++ b/lib/ace/theme/tomorrow_night_eighties.css @@ -57,7 +57,7 @@ } .ace-tomorrow-night-eighties .ace_gutter_active_line { - background-color : #dcdcdc; + background-color: #393939; } .ace-tomorrow-night-eighties .ace_marker-layer .ace_selected_word { diff --git a/lib/ace/theme/twilight.css b/lib/ace/theme/twilight.css index e7aeb58c..28d1ffa6 100644 --- a/lib/ace/theme/twilight.css +++ b/lib/ace/theme/twilight.css @@ -57,7 +57,7 @@ } .ace-twilight .ace_gutter_active_line { - background-color : #dcdcdc; + background-color: rgba(255, 255, 255, 0.031); } .ace-twilight .ace_marker-layer .ace_selected_word { diff --git a/lib/ace/theme/vibrant_ink.css b/lib/ace/theme/vibrant_ink.css index a1512591..3677a28e 100644 --- a/lib/ace/theme/vibrant_ink.css +++ b/lib/ace/theme/vibrant_ink.css @@ -57,7 +57,7 @@ } .ace-vibrant-ink .ace_gutter_active_line { - background-color : #dcdcdc; + background-color: #333333; } .ace-vibrant-ink .ace_marker-layer .ace_selected_word { diff --git a/tool/Theme.tmpl.css b/tool/Theme.tmpl.css index cabcc497..f1579b60 100644 --- a/tool/Theme.tmpl.css +++ b/tool/Theme.tmpl.css @@ -57,7 +57,7 @@ } .%cssClass% .ace_gutter_active_line { - background-color : #dcdcdc; + background-color: %active_line%; } .%cssClass% .ace_marker-layer .ace_selected_word { From fed582bda6aa72acba59e6a95e6f9fd5aeaee473 Mon Sep 17 00:00:00 2001 From: nightwing Date: Fri, 29 Jun 2012 23:16:53 +0400 Subject: [PATCH 09/47] remove undefined editor variable --- demo/kitchen-sink/demo.js | 10 ++-------- lib/ace/editor.js | 6 +++--- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/demo/kitchen-sink/demo.js b/demo/kitchen-sink/demo.js index 76c89025..bdfb3708 100644 --- a/demo/kitchen-sink/demo.js +++ b/demo/kitchen-sink/demo.js @@ -39,7 +39,7 @@ define(function(require, exports, module) { -"never use strict"; +"use strict"; require("ace/lib/fixoldbrowsers"); require("ace/config").init(); @@ -265,7 +265,7 @@ split.on("focus", function(editor) { }); env.split = split; window.env = env; -window.editor = window.ace = env.editor; +window.ace = env.editor; env.editor.setAnimatedScroll(true); var consoleEl = dom.createElement("div"); @@ -339,12 +339,6 @@ commands.addCommand({ exec: function() {alert("Fake Save File");} }); -commands.addCommand({ - name: "print", - bindKey: {win: "Ctrl-P", mac: "Command-P"}, - exec: function(editor) {editor.session.setValue("please,\ndo not waste paper\n");} -}); - var keybindings = { // Null = use "default" keymapping ace: null, diff --git a/lib/ace/editor.js b/lib/ace/editor.js index 1efac5fc..5b387f98 100644 --- a/lib/ace/editor.js +++ b/lib/ace/editor.js @@ -1772,7 +1772,7 @@ var Editor = function(renderer, session) { var range = this.session.getBracketRange(cursor); if (!range) { - range = editor.find({ + range = this.find({ needle: /[{}()\[\]]/g, preventScroll:true, start: {row: cursor.row, column: cursor.column - 1} @@ -1787,10 +1787,10 @@ var Editor = function(renderer, session) { pos = range && range.cursor || pos; if (pos) { if (select) { - if (range && range.isEqual(editor.getSelectionRange())) + if (range && range.isEqual(this.getSelectionRange())) this.clearSelection(); else - this.selection.selectTo(pos.row, pos.column); + this.selection.selectTo(pos.row, pos.column); } else { this.clearSelection(); this.moveCursorTo(pos.row, pos.column); From fa79d72d7ffe361fe0306bcae558642d843ea3cb Mon Sep 17 00:00:00 2001 From: nightwing Date: Sat, 30 Jun 2012 11:37:26 +0400 Subject: [PATCH 10/47] keep bold keywords for static highlighter --- lib/ace/theme/github.css | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/lib/ace/theme/github.css b/lib/ace/theme/github.css index a501d043..5621cbd5 100644 --- a/lib/ace/theme/github.css +++ b/lib/ace/theme/github.css @@ -22,6 +22,10 @@ background: #fff; } +.ace-github .ace_keyword { + font-weight: bold; +} + .ace-github .ace_string { color: #D14; } @@ -51,6 +55,14 @@ color: #0086B3; } +.ace-github .ace_paren { + font-weight: bold; +} + +.ace-github .ace_boolean { + font-weight: bold; +} + .ace-github .ace_string.ace_regexp { color: #009926; font-weight: normal; @@ -60,6 +72,10 @@ color: teal; } +.ace-github .ace_constant.ace_language { + font-weight: bold; +} + .ace-github .ace_text-layer { } @@ -81,4 +97,9 @@ .ace-github.multiselect .ace_selection.start { box-shadow: 0 0 3px 0px white; border-radius: 2px; +} +/* bold keywords cause cursor issues for some fonts */ +/* this disables bold style for editor and keeps for static highlighter */ +.ace-github.ace_editor .ace_line > span { + font-weight: normal !important; } \ No newline at end of file From d23ffd89e4d1b18b3d2d1a3a5ba2c4e9b083225c Mon Sep 17 00:00:00 2001 From: nightwing Date: Fri, 15 Jun 2012 00:16:04 +0400 Subject: [PATCH 11/47] update themes --- lib/ace/theme/crimson_editor.css | 4 ++++ lib/ace/theme/github.css | 28 ++++++++++++++++++++++++++++ lib/ace/theme/textmate.css | 3 ++- 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/lib/ace/theme/crimson_editor.css b/lib/ace/theme/crimson_editor.css index efd0d923..1ed6783a 100644 --- a/lib/ace/theme/crimson_editor.css +++ b/lib/ace/theme/crimson_editor.css @@ -133,6 +133,10 @@ background: rgb(232, 242, 254); } +.ace-crimson-editor .ace_gutter_active_line { + background-color : #dcdcdc; +} + .ace-crimson-editor .ace_meta.ace_tag { color:rgb(28, 2, 255); } diff --git a/lib/ace/theme/github.css b/lib/ace/theme/github.css index 5621cbd5..935990fa 100644 --- a/lib/ace/theme/github.css +++ b/lib/ace/theme/github.css @@ -102,4 +102,32 @@ /* this disables bold style for editor and keeps for static highlighter */ .ace-github.ace_editor .ace_line > span { font-weight: normal !important; +} + +.ace-github .ace_marker-layer .ace_step { + background: rgb(252, 255, 0); +} + +.ace-github .ace_marker-layer .ace_stack { + background: rgb(164, 229, 101); +} + +.ace-github .ace_marker-layer .ace_bracket { + margin: -1px 0 0 -1px; + border: 1px solid rgb(192, 192, 192); +} + +.ace-github .ace_gutter_active_line{ + background-color : rgba(0, 0, 0, 0.07); +} + +.ace-github .ace_marker-layer .ace_selected_word { + background: rgb(250, 250, 255); + border: 1px solid rgb(200, 200, 250); + +} + +.ace-github .ace_print_margin { + width: 1px; + background: #e8e8e8; } \ No newline at end of file diff --git a/lib/ace/theme/textmate.css b/lib/ace/theme/textmate.css index adfefa81..c23c30f1 100644 --- a/lib/ace/theme/textmate.css +++ b/lib/ace/theme/textmate.css @@ -146,7 +146,8 @@ .ace-tm .ace_marker-layer .ace_active_line { background: rgba(0, 0, 0, 0.07); } -.ace-tm .ace_gutter_active_line{ + +.ace-tm .ace_gutter_active_line { background-color : #dcdcdc; } From 7f8892f9a5b8b9079c24e9396395b95b276c2472 Mon Sep 17 00:00:00 2001 From: nightwing Date: Sun, 10 Jun 2012 22:10:35 +0400 Subject: [PATCH 12/47] folds with wrong range shouldn't break renderer --- lib/ace/layer/text.js | 54 +++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/lib/ace/layer/text.js b/lib/ace/layer/text.js index 92683967..e96dff28 100644 --- a/lib/ace/layer/text.js +++ b/lib/ace/layer/text.js @@ -131,7 +131,7 @@ var Text = function(parentEl) { container.appendChild(measureNode); } } - + // Size and width can be null if the editor is not visible or // detached from the document if (!this.element.offsetWidth) @@ -153,7 +153,7 @@ var Text = function(parentEl) { return null; return size; - } + } : function() { if (!this.$measureNode) { var measureNode = this.$measureNode = dom.createElement("div"); @@ -178,7 +178,7 @@ var Text = function(parentEl) { container.appendChild(measureNode); } - + var rect = this.$measureNode.getBoundingClientRect(); var size = { @@ -382,7 +382,7 @@ var Text = function(parentEl) { "lparen": true }; - this.$renderToken = function(stringBuilder, screenColumn, token, value) { + this.$renderToken = function(stringBuilder, screenColumn, token, value) { var self = this; var replaceReg = /\t|&|<|( +)|([\u0000-\u0019\u00a0\u1680\u180E\u2000-\u200b\u2028\u2029\u202F\u205F\u3000\uFEFF])|[\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]/g; var replaceFunc = function(c, a, b, tabIdx, idx4) { @@ -447,7 +447,7 @@ var Text = function(parentEl) { "'>" ); } - + for (var i = 0; i < tokens.length; i++) { var token = tokens[i]; var value = token.value; @@ -461,12 +461,12 @@ var Text = function(parentEl) { else { while (chars + value.length >= splitChars) { screenColumn = self.$renderToken( - stringBuilder, screenColumn, + stringBuilder, screenColumn, token, value.substring(0, splitChars - chars) ); value = value.substring(splitChars - chars); chars = splitChars; - + if (!onlyContents) { stringBuilder.push("", "
Date: Mon, 11 Jun 2012 11:08:24 +0400 Subject: [PATCH 13/47] size multiline markers with "right" instead of "width" --- lib/ace/layer/marker.js | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/lib/ace/layer/marker.js b/lib/ace/layer/marker.js index f5999338..127cf7f3 100644 --- a/lib/ace/layer/marker.js +++ b/lib/ace/layer/marker.js @@ -73,7 +73,7 @@ var Marker = function(parentEl) { var html = []; - for ( var key in this.markers) { + for (var key in this.markers) { var marker = this.markers[key]; if (!marker.range) { @@ -140,29 +140,25 @@ var Marker = function(parentEl) { } }; - // Draws a multi line marker, where lines span the full width - this.drawMultiLineMarker = function(stringBuilder, range, clazz, layerConfig, type) { + // Draws a multi line marker, where lines span the full width + this.drawMultiLineMarker = function(stringBuilder, range, clazz, config, type) { var padding = type === "background" ? 0 : this.$padding; - var layerWidth = layerConfig.width + 2 * this.$padding - padding; // from selection start to the end of the line - var height = layerConfig.lineHeight; - var width = Math.round(layerWidth - (range.start.column * layerConfig.characterWidth)); - var top = this.$getTop(range.start.row, layerConfig); - var left = Math.round( - padding + range.start.column * layerConfig.characterWidth - ); + var height = config.lineHeight; + var top = this.$getTop(range.start.row, config); + var left = Math.round(padding + range.start.column * config.characterWidth); stringBuilder.push( "
" ); // from start of the last line to the selection end - top = this.$getTop(range.end.row, layerConfig); - width = Math.round(range.end.column * layerConfig.characterWidth); + top = this.$getTop(range.end.row, config); + var width = Math.round(range.end.column * config.characterWidth); stringBuilder.push( "
" ); From 3e99b7f4faeaa2781d1c3dca9ee091e00b2d4d86 Mon Sep 17 00:00:00 2001 From: nightwing Date: Mon, 11 Jun 2012 11:12:50 +0400 Subject: [PATCH 14/47] fix folding for c9search (for lines matching /\w:$/) --- lib/ace/edit_session/bracket_match.js | 8 +---- lib/ace/mode/c9search.js | 12 ------- lib/ace/mode/folding/c9search.js | 50 ++++++++++----------------- lib/ace/mode/folding/fold_mode.js | 4 +-- 4 files changed, 21 insertions(+), 53 deletions(-) diff --git a/lib/ace/edit_session/bracket_match.js b/lib/ace/edit_session/bracket_match.js index 83c8f572..4b95c1cd 100644 --- a/lib/ace/edit_session/bracket_match.js +++ b/lib/ace/edit_session/bracket_match.js @@ -194,7 +194,7 @@ function BracketMatch() { return null; }; - this.$findClosingBracket = function(bracket, position, typeRe, allowBlankLine) { + this.$findClosingBracket = function(bracket, position, typeRe) { var closingBracket = this.$brackets[bracket]; var depth = 1; @@ -239,12 +239,6 @@ function BracketMatch() { // whose type matches typeRe do { token = iterator.stepForward(); - if (allowBlankLine) { - // if you've reached the doc end, or, you match a new content line - if (token === null || token.type == "string") { - return {row: iterator.getCurrentTokenRow() + (token === null ? 1 : -1), column: 0}; - } - } } while (token && !typeRe.test(token.type)); if (token == null) diff --git a/lib/ace/mode/c9search.js b/lib/ace/mode/c9search.js index cff2b22a..37a89aab 100644 --- a/lib/ace/mode/c9search.js +++ b/lib/ace/mode/c9search.js @@ -56,18 +56,6 @@ oop.inherits(Mode, TextMode); this.getNextLineIndent = function(state, line, tab) { var indent = this.$getIndent(line); - - // ignore braces in comments - var tokens = this.$tokenizer.getLineTokens(line, state).tokens; - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - var match = line.match(/^.*\{\s*$/); - if (match) { - indent += tab; - } - return indent; }; diff --git a/lib/ace/mode/folding/c9search.js b/lib/ace/mode/folding/c9search.js index 406222b6..056f731d 100644 --- a/lib/ace/mode/folding/c9search.js +++ b/lib/ace/mode/folding/c9search.js @@ -48,46 +48,32 @@ oop.inherits(FoldMode, BaseFoldMode); (function() { - this.foldingStartMarker = /[a-zA-Z](:)\s*$/; - this.foldingStopMarker = /^(\s*)$/; + this.foldingStartMarker = /^(\w.*\:|Searching for.*)$/; + this.foldingStopMarker = /^(\s+|Found.*)$/; this.getFoldWidgetRange = function(session, foldStyle, row) { var line = session.getLine(row); - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; + var level1 = /^(Found.*|Searching for.*)$/; + var level2 = /^(\w.*\:|\s+)$/; + var re = level1.test(line) ? level1 : level2; - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i, false, true); - - var range = session.getCommentFoldRange(row, i + match[0].length); - range.end.column -= 2; - return range; - } - - if (foldStyle !== "markbeginend") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[2]) { - var range = session.getCommentFoldRange(row, i); - range.end.column -= 2; - return range; + if (this.foldingStartMarker.test(line)) { + for (var i = row + 1, l = session.getLength(); i < l; i++) { + if (re.test(session.getLine(i))) + break; } - var end = {row: row, column: i}; - var start = session.$findOpeningBracket(match[1], end); - - if (!start) - return; + return new Range(row, line.length, i, 0); + } - start.column++; - end.column--; + if (this.foldingStopMarker.test(line)) { + for (var i = row - 1; i >= 0; i--) { + line = session.getLine(i); + if (re.test(line)) + break; + } - return Range.fromPoints(start, end); + return new Range(i, line.length, row, 0); } }; diff --git a/lib/ace/mode/folding/fold_mode.js b/lib/ace/mode/folding/fold_mode.js index 849526c7..0e7aaa52 100644 --- a/lib/ace/mode/folding/fold_mode.js +++ b/lib/ace/mode/folding/fold_mode.js @@ -91,9 +91,9 @@ var FoldMode = exports.FoldMode = function() {}; } }; - this.openingBracketBlock = function(session, bracket, row, column, typeRe, allowBlankLine) { + this.openingBracketBlock = function(session, bracket, row, column, typeRe) { var start = {row: row, column: column + 1}; - var end = session.$findClosingBracket(bracket, start, typeRe, allowBlankLine); + var end = session.$findClosingBracket(bracket, start, typeRe); if (!end) return; From 3d93ad43c3293a2b9af597b0d62abf29778c2854 Mon Sep 17 00:00:00 2001 From: nightwing Date: Wed, 20 Jun 2012 13:33:47 +0400 Subject: [PATCH 15/47] fix coffeescript folding for "[#{}" --- lib/ace/mode/folding/c9search.js | 2 +- lib/ace/mode/folding/fold_mode.js | 2 +- lib/ace/mode/folding/pythonic.js | 2 +- lib/ace/mode/folding/pythonic_test.js | 7 +++++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/ace/mode/folding/c9search.js b/lib/ace/mode/folding/c9search.js index 056f731d..2c9828de 100644 --- a/lib/ace/mode/folding/c9search.js +++ b/lib/ace/mode/folding/c9search.js @@ -54,7 +54,7 @@ oop.inherits(FoldMode, BaseFoldMode); this.getFoldWidgetRange = function(session, foldStyle, row) { var line = session.getLine(row); var level1 = /^(Found.*|Searching for.*)$/; - var level2 = /^(\w.*\:|\s+)$/; + var level2 = /^(\w.*\:|\s*)$/; var re = level1.test(line) ? level1 : level2; if (this.foldingStartMarker.test(line)) { diff --git a/lib/ace/mode/folding/fold_mode.js b/lib/ace/mode/folding/fold_mode.js index 0e7aaa52..9dcbda13 100644 --- a/lib/ace/mode/folding/fold_mode.js +++ b/lib/ace/mode/folding/fold_mode.js @@ -101,7 +101,7 @@ var FoldMode = exports.FoldMode = function() {}; if (fw == null) fw = this.getFoldWidget(session, end.row); - if (fw == "start") { + if (fw == "start" && end.row > start.row) { end.row --; end.column = session.getLine(end.row).length; } diff --git a/lib/ace/mode/folding/pythonic.js b/lib/ace/mode/folding/pythonic.js index 90ab2aad..529cc797 100644 --- a/lib/ace/mode/folding/pythonic.js +++ b/lib/ace/mode/folding/pythonic.js @@ -42,7 +42,7 @@ var oop = require("../../lib/oop"); var BaseFoldMode = require("./fold_mode").FoldMode; var FoldMode = exports.FoldMode = function(markers) { - this.foldingStartMarker = new RegExp("(?:([\\[{])|(" + markers + "))(?:\\s*)(?:#.*)?$"); + this.foldingStartMarker = new RegExp("([\\[{])(?:\\s*)$|(" + markers + ")(?:\\s*)(?:#.*)?$"); }; oop.inherits(FoldMode, BaseFoldMode); diff --git a/lib/ace/mode/folding/pythonic_test.js b/lib/ace/mode/folding/pythonic_test.js index 6cfb1f77..ca853715 100644 --- a/lib/ace/mode/folding/pythonic_test.js +++ b/lib/ace/mode/folding/pythonic_test.js @@ -49,11 +49,12 @@ module.exports = { "test: bracket folding": function() { var session = new EditSession([ - '[ #-', + '[ ', 'stuff', ']', '[ ', - '{ ' + '{ ', + '[ #-', ]); var mode = new PythonMode(); @@ -65,9 +66,11 @@ module.exports = { assert.equal(session.getFoldWidget(2), ""); assert.equal(session.getFoldWidget(3), "start"); assert.equal(session.getFoldWidget(4), "start"); + assert.equal(session.getFoldWidget(5), ""); assert.range(session.getFoldWidgetRange(0), 0, 1, 2, 0); assert.equal(session.getFoldWidgetRange(3), null); + assert.equal(session.getFoldWidgetRange(5), null); }, "test: indentation folding": function() { From 927cc4755b8a31b2d2caa3db3a5252cfaaaa7070 Mon Sep 17 00:00:00 2001 From: nightwing Date: Fri, 15 Jun 2012 14:23:04 +0400 Subject: [PATCH 16/47] fix #809 coffeeScript operator highlighting --- lib/ace/mode/coffee_highlight_rules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ace/mode/coffee_highlight_rules.js b/lib/ace/mode/coffee_highlight_rules.js index 2772edf3..d3fe7884 100644 --- a/lib/ace/mode/coffee_highlight_rules.js +++ b/lib/ace/mode/coffee_highlight_rules.js @@ -153,7 +153,7 @@ define(function(require, exports, module) { regex : "\\?|\\:|\\,|\\." }, { token : "keyword.operator", - regex : "(?:[\\-=]>|[-+*/%<>&|^!?=]=|>>>=?|\\-\\-|\\+\\+|::|&&=|\\|\\|=|<<=|>>=|\\?\\.|\\.{2,3}|\\!)" + regex : "(?:[\\-=]>|[-+*/%<>&|^!?=]=|>>>=?|\\-\\-|\\+\\+|::|&&=|\\|\\|=|<<=|>>=|\\?\\.|\\.{2,3}|[!*+-=><])" }, { token : "paren.lparen", regex : "[({[]" From 38eb07df67459c0a9b2e42612159c5820e8ba938 Mon Sep 17 00:00:00 2001 From: nightwing Date: Sat, 16 Jun 2012 13:51:18 +0400 Subject: [PATCH 17/47] better folding for coffeescript --- lib/ace/mode/coffee.js | 2 +- lib/ace/mode/folding/coffee.js | 127 ++++++++++++++++++++++++++ lib/ace/mode/folding/coffee_test.js | 108 ++++++++++++++++++++++ lib/ace/mode/folding/fold_mode.js | 24 ++--- lib/ace/mode/folding/pythonic_test.js | 2 +- lib/ace/test/all_browser.js | 1 + 6 files changed, 251 insertions(+), 13 deletions(-) create mode 100644 lib/ace/mode/folding/coffee.js create mode 100644 lib/ace/mode/folding/coffee_test.js diff --git a/lib/ace/mode/coffee.js b/lib/ace/mode/coffee.js index 4afc2896..9d265b67 100644 --- a/lib/ace/mode/coffee.js +++ b/lib/ace/mode/coffee.js @@ -41,7 +41,7 @@ define(function(require, exports, module) { var Tokenizer = require("../tokenizer").Tokenizer; var Rules = require("./coffee_highlight_rules").CoffeeHighlightRules; var Outdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var PythonFoldMode = require("./folding/pythonic").FoldMode; +var PythonFoldMode = require("./folding/coffee").FoldMode; var Range = require("../range").Range; var TextMode = require("./text").Mode; var WorkerClient = require("../worker/worker_client").WorkerClient; diff --git a/lib/ace/mode/folding/coffee.js b/lib/ace/mode/folding/coffee.js new file mode 100644 index 00000000..b502afc4 --- /dev/null +++ b/lib/ace/mode/folding/coffee.js @@ -0,0 +1,127 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define(function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var BaseFoldMode = require("./fold_mode").FoldMode; +var Range = require("../../range").Range; + +var FoldMode = exports.FoldMode = function() {}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.getFoldWidgetRange = function(session, foldStyle, row) { + var range = this.indentationBlock(session, row); + if (range) + return range; + + var re = /\S/; + var line = session.getLine(row); + var startLevel = line.search(re); + if (startLevel == -1 || line[startLevel] != "#") + return; + + var startColumn = line.length; + var maxRow = session.getLength(); + var startRow = row; + var endRow = row; + + while (++row < maxRow) { + line = session.getLine(row); + var level = line.search(re); + + if (level == -1) + continue; + + if (line[level] != "#") + break; + + endRow = row; + } + + if (endRow > startRow) { + var endColumn = session.getLine(endRow).length; + return new Range(startRow, startColumn, endRow, endColumn); + } + }; + + // must return "" if there's no fold, to enable caching + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + var indent = line.search(/\S/); + var next = session.getLine(row + 1); + var prev = session.getLine(row - 1); + var prevIndent = prev.search(/\S/); + var nextIndent = next.search(/\S/); + + if (indent == -1) { + session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; + return ""; + } + + // documentation comments + if (prevIndent == -1) { + if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { + session.foldWidgets[row - 1] = ""; + session.foldWidgets[row + 1] = ""; + return "start"; + } + } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { + if (session.getLine(row - 2).search(/\S/) == -1) { + session.foldWidgets[row - 1] = "start"; + session.foldWidgets[row + 1] = ""; + return "" + } + } + + if (prevIndent!= -1 && prevIndent < indent) + session.foldWidgets[row - 1] = "start"; + else + session.foldWidgets[row - 1] = ""; + + if (indent < nextIndent) + return "start"; + else + return ""; + }; + +}).call(FoldMode.prototype); + +}); diff --git a/lib/ace/mode/folding/coffee_test.js b/lib/ace/mode/folding/coffee_test.js new file mode 100644 index 00000000..41c440a2 --- /dev/null +++ b/lib/ace/mode/folding/coffee_test.js @@ -0,0 +1,108 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +if (typeof process !== "undefined") + require("amd-loader"); + +define(function(require, exports, module) { +"use strict"; + +var CoffeeMode = require("../coffee").Mode; +var EditSession = require("../../edit_session").EditSession; +var assert = require("../../test/assertions"); +function testFoldWidgets(array) { + var session = array.filter(function(_, i){return i % 2 == 1}); + session = new EditSession(session); + var mode = new CoffeeMode(); + session.setFoldStyle("markbeginend"); + session.setMode(mode); + + var widgets = array.filter(function(_, i){return i % 2 == 0}); + widgets.forEach(function(w, i){ + session.foldWidgets[i] = session.getFoldWidget(i); + }) + widgets.forEach(function(w, i){ + w = w.split(","); + var type = w[0] == ">" ? "start" : w[0] == "<" ? "end" : ""; + assert.equal(session.foldWidgets[i], type); + if (!type) + return; + var range = session.getFoldWidgetRange(i); + if (!w[1]) { + assert.equal(range, null); + return; + } + assert.equal(range.start.row, i); + assert.equal(range.end.row - range.start.row, parseInt(w[1])); + testColumn(w[2], range.start); + testColumn(w[3], range.end); + }); + + function testColumn(w, pos) { + if (!w) + return; + if (w == "l") + w = session.getLine(pos.row).length; + else + w = parseInt(w); + assert.equal(pos.column, w); + } +} +module.exports = { + "test: coffee script indentation based folding": function() { + testFoldWidgets([ + '>,1,l,l', ' ## indented comment', + '', ' # ', + '', '', + '>,1,l,l', ' # plain comment', + '', ' # ', + '>,2', ' function (x)=>', + '', ' ', + '', ' x++', + '', ' ', + '', ' ', + '>,2', ' bar = ', + '', ' foo: 1', + '', ' baz: lighter' + ]); + } +}; + +}); + +if (typeof module !== "undefined" && module === require.main) + require("asyncjs").test.testcase(module.exports).exec(); diff --git a/lib/ace/mode/folding/fold_mode.js b/lib/ace/mode/folding/fold_mode.js index 9dcbda13..25407569 100644 --- a/lib/ace/mode/folding/fold_mode.js +++ b/lib/ace/mode/folding/fold_mode.js @@ -58,25 +58,27 @@ var FoldMode = exports.FoldMode = function() {}; return "end"; return ""; }; - + this.getFoldWidgetRange = function(session, foldStyle, row) { return null; }; this.indentationBlock = function(session, row, column) { - var re = /^\s*/; + var re = /\S/; + var line = session.getLine(row); + var startLevel = line.search(re); + if (startLevel == -1) + return; + + var startColumn = column || line.length; + var maxRow = session.getLength(); var startRow = row; var endRow = row; - var line = session.getLine(row); - var startColumn = column || line.length; - var startLevel = line.match(re)[0].length; - var maxRow = session.getLength() - - while (++row < maxRow) { - line = session.getLine(row); - var level = line.match(re)[0].length; - if (level == line.length) + while (++row < maxRow) { + var level = session.getLine(row).search(re); + + if (level == -1) continue; if (level <= startLevel) diff --git a/lib/ace/mode/folding/pythonic_test.js b/lib/ace/mode/folding/pythonic_test.js index ca853715..f0f93799 100644 --- a/lib/ace/mode/folding/pythonic_test.js +++ b/lib/ace/mode/folding/pythonic_test.js @@ -61,7 +61,7 @@ module.exports = { session.setFoldStyle("markbeginend"); session.setMode(mode); - assert.equal(session.getFoldWidget(0), "start"); + assert.equal(session.getFoldWidget(0), ""); assert.equal(session.getFoldWidget(1), ""); assert.equal(session.getFoldWidget(2), ""); assert.equal(session.getFoldWidget(3), "start"); diff --git a/lib/ace/test/all_browser.js b/lib/ace/test/all_browser.js index 934149e4..f1f68c81 100644 --- a/lib/ace/test/all_browser.js +++ b/lib/ace/test/all_browser.js @@ -42,6 +42,7 @@ var testNames = [ "ace/mode/folding/html_test", "ace/mode/folding/pythonic_test", "ace/mode/folding/xml_test", + "ace/mode/folding/coffee_test", "ace/multi_select_test", "ace/range_test", "ace/range_list_test", From 241776dd4c011fcbaec45eae0316f1420bdb12bf Mon Sep 17 00:00:00 2001 From: nightwing Date: Sat, 16 Jun 2012 17:07:55 +0400 Subject: [PATCH 18/47] tweak selectByWords --- lib/ace/edit_session/bracket_match.js | 5 +---- lib/ace/mouse/default_gutter_handler.js | 9 +++------ lib/ace/mouse/default_handlers.js | 17 ++++++++--------- 3 files changed, 12 insertions(+), 19 deletions(-) diff --git a/lib/ace/edit_session/bracket_match.js b/lib/ace/edit_session/bracket_match.js index 4b95c1cd..9b977b8c 100644 --- a/lib/ace/edit_session/bracket_match.js +++ b/lib/ace/edit_session/bracket_match.js @@ -94,7 +94,7 @@ function BracketMatch() { var match = chr && chr.match(/([\(\[\{])|([\)\]\}])/); if (!match) { chr = line.charAt(pos.column); - pos.column++; + pos = {row: pos.row, column: pos.column + 1}; match = chr && chr.match(/([\(\[\{])|([\)\]\}])/); before = false; } @@ -123,9 +123,6 @@ function BracketMatch() { range.cursor = range.start; } - if (!before) - pos.column--; - return range; }; diff --git a/lib/ace/mouse/default_gutter_handler.js b/lib/ace/mouse/default_gutter_handler.js index fc9b012b..21c792a1 100644 --- a/lib/ace/mouse/default_gutter_handler.js +++ b/lib/ace/mouse/default_gutter_handler.js @@ -58,13 +58,10 @@ function GutterHandler(mouseHandler) { var row = e.getDocumentPosition().row; var selection = editor.session.selection; - if (e.getShiftKey()) { + if (e.getShiftKey()) selection.selectTo(row, 0); - } else { - selection.moveCursorTo(row, 0); - selection.selectLine(); - mouseHandler.$clickSelection = selection.getRange(); - } + else + mouseHandler.$clickSelection = editor.selection.getLineRange(row); mouseHandler.captureMouse(e, "selectByLines"); return e.preventDefault(); diff --git a/lib/ace/mouse/default_handlers.js b/lib/ace/mouse/default_handlers.js index 1b916801..7fabf75d 100644 --- a/lib/ace/mouse/default_handlers.js +++ b/lib/ace/mouse/default_handlers.js @@ -65,7 +65,7 @@ function DefaultHandlers(mouseHandler) { mouseHandler.selectByLines = this.extendSelectionBy.bind(mouseHandler, "getLineRange"); mouseHandler.selectByWords = this.extendSelectionBy.bind(mouseHandler, "getWordRange"); - + mouseHandler.$focusWaitTimout = 250; } @@ -163,10 +163,12 @@ function DefaultHandlers(mouseHandler) { if (cmpStart == -1 && cmpEnd <= 0) { anchor = this.$clickSelection.end; - cursor = range.start; + if (range.end.row != cursor.row || range.end.column != cursor.column) + cursor = range.start; } else if (cmpEnd == 1 && cmpStart >= 0) { anchor = this.$clickSelection.start; - cursor = range.end; + if (range.start.row != cursor.row || range.start.column != cursor.column) + cursor = range.end; } else if (cmpStart == -1 && cmpEnd == 1) { cursor = range.end; anchor = range.start; @@ -286,7 +288,7 @@ function DefaultHandlers(mouseHandler) { this.setState("select"); return; } - + this.$clickSelection = editor.selection.getWordRange(pos.row, pos.column); this.setState("selectByWords"); }; @@ -296,10 +298,7 @@ function DefaultHandlers(mouseHandler) { var editor = this.editor; this.setState("selectByLines"); - - editor.moveCursorToPosition(pos); - editor.selection.selectLine(); - this.$clickSelection = editor.getSelectionRange(); + this.$clickSelection = editor.selection.getLineRange(pos.row); }; this.onQuadClick = function(ev) { @@ -345,7 +344,7 @@ function calcRangeOrientation(range, cursor) { var cmp = 2 * cursor.column - range.start.column - range.end.column; else var cmp = 2 * cursor.row - range.start.row - range.end.row; - + if (cmp < 0) return {cursor: range.start, anchor: range.end}; else From 71231db0af356a3914ee36cd1c82251a78bca264 Mon Sep 17 00:00:00 2001 From: nightwing Date: Wed, 20 Jun 2012 13:38:31 +0400 Subject: [PATCH 19/47] editor content shouldn't overlay scrollbar --- lib/ace/css/editor.css | 1 - lib/ace/virtual_renderer.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/ace/css/editor.css b/lib/ace/css/editor.css index d53a135b..0a668fff 100644 --- a/lib/ace/css/editor.css +++ b/lib/ace/css/editor.css @@ -8,7 +8,6 @@ .ace_scroller { position: absolute; overflow: hidden; - width : 100%; } .ace_content { diff --git a/lib/ace/virtual_renderer.js b/lib/ace/virtual_renderer.js index c41d976a..eb6a17c7 100644 --- a/lib/ace/virtual_renderer.js +++ b/lib/ace/virtual_renderer.js @@ -321,7 +321,7 @@ var VirtualRenderer = function(container, theme) { var gutterWidth = this.showGutter ? this.$gutter.offsetWidth : 0; this.scroller.style.left = gutterWidth + "px"; size.scrollerWidth = Math.max(0, width - gutterWidth - this.scrollBar.getWidth()); - //this.scroller.style.width = size.scrollerWidth + "px"; + this.scroller.style.right = this.scrollBar.getWidth() + "px"; if (this.session.getUseWrapMode() && this.adjustWrapLimit() || force) changes = changes | this.CHANGE_FULL; From 5eca7dd8203bf80321278fbe3454035390282323 Mon Sep 17 00:00:00 2001 From: nightwing Date: Wed, 20 Jun 2012 14:25:01 +0400 Subject: [PATCH 20/47] fix test --- lib/ace/mode/folding/pythonic_test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ace/mode/folding/pythonic_test.js b/lib/ace/mode/folding/pythonic_test.js index f0f93799..ca853715 100644 --- a/lib/ace/mode/folding/pythonic_test.js +++ b/lib/ace/mode/folding/pythonic_test.js @@ -61,7 +61,7 @@ module.exports = { session.setFoldStyle("markbeginend"); session.setMode(mode); - assert.equal(session.getFoldWidget(0), ""); + assert.equal(session.getFoldWidget(0), "start"); assert.equal(session.getFoldWidget(1), ""); assert.equal(session.getFoldWidget(2), ""); assert.equal(session.getFoldWidget(3), "start"); From 3cc878f4c1550857986a27858577b2ca579a8397 Mon Sep 17 00:00:00 2001 From: nightwing Date: Thu, 21 Jun 2012 20:38:00 +0400 Subject: [PATCH 21/47] compatibility with dojo.require --- lib/ace/requirejs/text.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/ace/requirejs/text.js b/lib/ace/requirejs/text.js index cf7ef666..6d6f59ce 100644 --- a/lib/ace/requirejs/text.js +++ b/lib/ace/requirejs/text.js @@ -41,17 +41,17 @@ (function() { -var globalRequire = require; +var globalRequire = typeof require != "undefined" && require; define(function (require, exports, module) { "use strict"; exports.load = function (name, req, onLoad, config) { - if (req.isBrowser) - require("ace/lib/net").get(req.toUrl(name), onLoad); + //Using special require.nodeRequire, something added by r.js. + if (globalRequire && globalRequire.nodeRequire) + onLoad(('fs').readFileSync(req.toUrl(name), 'utf8')); else - //Using special require.nodeRequire, something added by r.js. - onLoad(globalRequire.nodeRequire('fs').readFileSync(req.toUrl(name), 'utf8')); + require("ace/lib/net").get(req.toUrl(name), onLoad); }; }); From 8fbe921ad992c118f10556a80750510fddc0e806 Mon Sep 17 00:00:00 2001 From: nightwing Date: Thu, 21 Jun 2012 20:55:55 +0400 Subject: [PATCH 22/47] do not include trailing slash in scriptOptions.base --- lib/ace/config.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/ace/config.js b/lib/ace/config.js index 73a83d51..0bdaf786 100644 --- a/lib/ace/config.js +++ b/lib/ace/config.js @@ -97,10 +97,9 @@ exports.init = function() { } } - var m = src.match(/^(?:(.*\/)ace\.js)(?:\?|$)/); - if (m) { - scriptUrl = m[1] || m[2]; - } + var m = src.match(/^(.*)\/ace(\-\w+)?\.js(\?|$)/); + if (m) + scriptUrl = m[1]; } if (scriptUrl) { From d179f6d89d5ffb14573c204e5ec918db00cec56e Mon Sep 17 00:00:00 2001 From: Jason Karns Date: Sat, 30 Jun 2012 11:56:29 -0300 Subject: [PATCH 23/47] Add TryJasmine as a project using Ace --- index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/index.html b/index.html index 7ebc6317..026e2559 100644 --- a/index.html +++ b/index.html @@ -73,6 +73,7 @@
  • RubyMonk
  • tmpltr
  • CMS Made Simple
  • +
  • Try Jasmine
  • Syntax Highlighters