diff --git a/lib/ace/autocomplete.js b/lib/ace/autocomplete.js index bf021760..8aa8abb3 100644 --- a/lib/ace/autocomplete.js +++ b/lib/ace/autocomplete.js @@ -63,6 +63,7 @@ var Autocomplete = function() { this.insertMatch(); e.stop(); }.bind(this)); + this.popup.focus = this.editor.focus.bind(this.editor); }; this.openPopup = function(editor, prefix, keepPopupPosition) { @@ -122,7 +123,10 @@ var Autocomplete = function() { }; this.blurListener = function() { - if (document.activeElement != this.editor.textInput.getElement()) + // we have to check if activeElement is a child of popup because + // on IE preventDefault doesn't stop scrollbar from being focussed + var el = document.activeElement; + if (el != this.editor.textInput.getElement() && el.parentNode != this.popup.container) this.detach(); }; diff --git a/lib/ace/keyboard/vim.js b/lib/ace/keyboard/vim.js index 3ae4842f..0477dca0 100644 --- a/lib/ace/keyboard/vim.js +++ b/lib/ace/keyboard/vim.js @@ -146,6 +146,8 @@ exports.handler = { if (cmds.inputBuffer.idle && startCommands[key]) return startCommands[key]; var isHandled = cmds.inputBuffer.push(editor, key); + if (!isHandled && hashId !== -1) + return; return {command: "null", passEvent: !isHandled}; } // if no modifier || shift: wait for input. else if (key.length == 1 && (hashId === 0 || hashId == 4)) { diff --git a/lib/ace/mode/_test/text_html.txt b/lib/ace/mode/_test/text_html.txt index 64a32cb2..d2ce8aaa 100644 --- a/lib/ace/mode/_test/text_html.txt +++ b/lib/ace/mode/_test/text_html.txt @@ -1,5 +1,7 @@ -'123' + +'123' + "], ["storage.type","var"], + ["text"," "], + ["string","\""], ["meta.tag.punctuation.end-tag-open.xml",""], ["text.xml","'123'"] +],[ + "start", + ["meta.tag.punctuation.end-tag-open.xml",""] ],[ ["string.attribute-value.xml0","tag_stuff"], ["meta.tag.punctuation.tag-open.xml","<"], diff --git a/lib/ace/mode/_test/tokens_ini.json b/lib/ace/mode/_test/tokens_ini.json new file mode 100644 index 00000000..11d28017 --- /dev/null +++ b/lib/ace/mode/_test/tokens_ini.json @@ -0,0 +1,23 @@ +[[ + "start", + ["punctuation.definition.entity.ini","["], + ["constant.section.group-title.ini",".ShellClassInfo"], + ["punctuation.definition.entity.ini","]"] +],[ + "start", + ["keyword.other.definition.ini","IconResource"], + ["punctuation.separator.key-value.ini","="], + ["text","..\\logo.png"] +],[ + "start", + ["punctuation.definition.entity.ini","["], + ["constant.section.group-title.ini","ViewState"], + ["punctuation.definition.entity.ini","]"] +],[ + "start", + ["keyword.other.definition.ini","FolderType"], + ["punctuation.separator.key-value.ini","="], + ["text","Generic"] +],[ + "start" +]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_matlab.json b/lib/ace/mode/_test/tokens_matlab.json new file mode 100644 index 00000000..9909eadd --- /dev/null +++ b/lib/ace/mode/_test/tokens_matlab.json @@ -0,0 +1,4 @@ +[[ + "start", + ["identifier","TODO"] +]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_mysql.json b/lib/ace/mode/_test/tokens_mysql.json new file mode 100644 index 00000000..9909eadd --- /dev/null +++ b/lib/ace/mode/_test/tokens_mysql.json @@ -0,0 +1,4 @@ +[[ + "start", + ["identifier","TODO"] +]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_pgsql.json b/lib/ace/mode/_test/tokens_pgsql.json index ded4bb86..fef23fd2 100644 --- a/lib/ace/mode/_test/tokens_pgsql.json +++ b/lib/ace/mode/_test/tokens_pgsql.json @@ -297,10 +297,10 @@ ["comment.doc","* Dollar quotes starting at the end of the line are colored as SQL unless"] ],[ "doc-start", - ["comment.doc","* a special language tag is used. Pearl and Python are currently implemented"] + ["comment.doc","* a special language tag is used. Dollar quote syntax coloring is implemented"] ],[ "doc-start", - ["comment.doc","* but lots of others are possible."] + ["comment.doc","* for Perl, Python, JavaScript, and Json."] ],[ "start", ["comment.doc","*/"] @@ -662,6 +662,160 @@ ["statementEnd",";"] ],[ "start" +],[ + "start", + ["comment","-- pl/v8 (javascript)"] +],[ + "javascript-start", + ["keyword.statementBegin","CREATE"], + ["text"," "], + ["keyword","FUNCTION"], + ["text"," "], + ["identifier","plv8_test"], + ["paren.lparen","("], + ["identifier","keys"], + ["text"," "], + ["keyword","text"], + ["text","[], "], + ["identifier","vals"], + ["text"," "], + ["keyword","text"], + ["text","[]"], + ["paren.rparen",")"], + ["text"," "], + ["keyword","RETURNS"], + ["text"," "], + ["keyword","text"], + ["text"," "], + ["keyword","AS"], + ["text"," "], + ["string","$javascript$"] +],[ + "javascript-start", + ["storage.type","var"], + ["text"," "], + ["identifier","o"], + ["text"," "], + ["keyword.operator","="], + ["text"," "], + ["paren.lparen","{"], + ["paren.rparen","}"], + ["punctuation.operator",";"] +],[ + "javascript-start", + ["keyword","for"], + ["paren.lparen","("], + ["storage.type","var"], + ["text"," "], + ["identifier","i"], + ["keyword.operator","="], + ["constant.numeric","0"], + ["punctuation.operator",";"], + ["text"," "], + ["identifier","i"], + ["keyword.operator","<"], + ["identifier","keys"], + ["punctuation.operator","."], + ["support.constant","length"], + ["punctuation.operator",";"], + ["text"," "], + ["identifier","i"], + ["keyword.operator","++"], + ["paren.rparen",")"], + ["paren.lparen","{"] +],[ + "javascript-start", + ["text"," "], + ["identifier","o"], + ["paren.lparen","["], + ["identifier","keys"], + ["paren.lparen","["], + ["identifier","i"], + ["paren.rparen","]]"], + ["text"," "], + ["keyword.operator","="], + ["text"," "], + ["identifier","vals"], + ["paren.lparen","["], + ["identifier","i"], + ["paren.rparen","]"], + ["punctuation.operator",";"] +],[ + "javascript-no_regex", + ["paren.rparen","}"] +],[ + "javascript-start", + ["keyword","return"], + ["text"," "], + ["variable.language","JSON"], + ["punctuation.operator","."], + ["identifier","stringify"], + ["paren.lparen","("], + ["identifier","o"], + ["paren.rparen",")"], + ["punctuation.operator",";"] +],[ + "start", + ["string","$javascript$"], + ["text"," "], + ["keyword","LANGUAGE"], + ["text"," "], + ["identifier","plv8"], + ["text"," "], + ["keyword","IMMUTABLE"], + ["text"," "], + ["keyword","STRICT"], + ["statementEnd",";"] +],[ + "start" +],[ + "start", + ["comment","-- json"] +],[ + "json-start", + ["keyword.statementBegin","select"], + ["text"," "], + ["keyword.operator","*"], + ["text"," "], + ["keyword","from"], + ["text"," "], + ["support.function","json_object_keys"], + ["paren.lparen","("], + ["string","$json$"] +],[ + "json-start", + ["paren.lparen","{"] +],[ + "json-start", + ["text"," "], + ["variable","\"f1\""], + ["text",": "], + ["constant.numeric","5"], + ["text",","] +],[ + "json-start", + ["text"," "], + ["variable","\"f2\""], + ["text",": "], + ["string","\"test\""], + ["text",","] +],[ + "json-start", + ["text"," "], + ["variable","\"f3\""], + ["text",": "], + ["paren.lparen","{"], + ["paren.rparen","}"] +],[ + "json-start", + ["paren.rparen","}"] +],[ + "start", + ["string","$json$"], + ["paren.rparen",")"], + ["statementEnd",";"] +],[ + "start" ],[ "start" ],[ diff --git a/lib/ace/mode/_test/tokens_smarty.json b/lib/ace/mode/_test/tokens_smarty.json new file mode 100644 index 00000000..0f56985d --- /dev/null +++ b/lib/ace/mode/_test/tokens_smarty.json @@ -0,0 +1,98 @@ +[[ + "start", + ["punctuation.section.embedded.begin.smarty","{"], + ["keyword.control.smarty","foreach"], + ["source.smarty"," "], + ["punctuation.definition.variable.smarty","$"], + ["variable.other.smarty","foo"], + ["source.smarty"," as "], + ["punctuation.definition.variable.smarty","$"], + ["variable.other.smarty","bar"], + ["punctuation.section.embedded.end.smarty","}"] +],[ + "start", + ["text.xml"," "], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.anchor.tag-name.xml","a"], + ["text.tag-whitespace.xml"," "], + ["entity.other.attribute-name.xml","href"], + ["keyword.operator.attribute-equals.xml","="], + ["string.attribute-value.xml","\""], + ["punctuation.section.embedded.begin.smarty","{"], + ["punctuation.definition.variable.smarty","$"], + ["variable.other.smarty","bar"], + ["source.smarty",".zig"], + ["punctuation.section.embedded.end.smarty","}"], + ["string.attribute-value.xml","\""], + ["meta.tag.punctuation.tag-close.xml",">"], + ["punctuation.section.embedded.begin.smarty","{"], + ["punctuation.definition.variable.smarty","$"], + ["variable.other.smarty","bar"], + ["source.smarty",".zag"], + ["punctuation.section.embedded.end.smarty","}"], + ["meta.tag.punctuation.end-tag-open.xml",""] +],[ + "start", + ["text.xml"," "], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.anchor.tag-name.xml","a"], + ["text.tag-whitespace.xml"," "], + ["entity.other.attribute-name.xml","href"], + ["keyword.operator.attribute-equals.xml","="], + ["string.attribute-value.xml","\""], + ["punctuation.section.embedded.begin.smarty","{"], + ["punctuation.definition.variable.smarty","$"], + ["variable.other.smarty","bar"], + ["source.smarty",".zig2"], + ["punctuation.section.embedded.end.smarty","}"], + ["string.attribute-value.xml","\""], + ["meta.tag.punctuation.tag-close.xml",">"], + ["punctuation.section.embedded.begin.smarty","{"], + ["punctuation.definition.variable.smarty","$"], + ["variable.other.smarty","bar"], + ["source.smarty",".zag2"], + ["punctuation.section.embedded.end.smarty","}"], + ["meta.tag.punctuation.end-tag-open.xml",""] +],[ + "start", + ["text.xml"," "], + ["meta.tag.punctuation.tag-open.xml","<"], + ["meta.tag.anchor.tag-name.xml","a"], + ["text.tag-whitespace.xml"," "], + ["entity.other.attribute-name.xml","href"], + ["keyword.operator.attribute-equals.xml","="], + ["string.attribute-value.xml","\""], + ["punctuation.section.embedded.begin.smarty","{"], + ["punctuation.definition.variable.smarty","$"], + ["variable.other.smarty","bar"], + ["source.smarty",".zig3"], + ["punctuation.section.embedded.end.smarty","}"], + ["string.attribute-value.xml","\""], + ["meta.tag.punctuation.tag-close.xml",">"], + ["punctuation.section.embedded.begin.smarty","{"], + ["punctuation.definition.variable.smarty","$"], + ["variable.other.smarty","bar"], + ["source.smarty",".zag3"], + ["punctuation.section.embedded.end.smarty","}"], + ["meta.tag.punctuation.end-tag-open.xml",""] +],[ + "start", + ["punctuation.section.embedded.begin.smarty","{"], + ["keyword.control.smarty","foreachelse"], + ["punctuation.section.embedded.end.smarty","}"] +],[ + "start", + ["text.xml"," There were no rows found."] +],[ + "start", + ["punctuation.section.embedded.begin.smarty","{"], + ["source.smarty","/"], + ["keyword.control.smarty","foreach"], + ["punctuation.section.embedded.end.smarty","}"] +]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_vbscript.json b/lib/ace/mode/_test/tokens_vbscript.json index 6a2346d3..a49f976d 100644 --- a/lib/ace/mode/_test/tokens_vbscript.json +++ b/lib/ace/mode/_test/tokens_vbscript.json @@ -5,18 +5,12 @@ ["text"," "], ["punctuation.definition.string.begin.asp","\""], ["string.quoted.double.asp","C:\\Wikipedia - VBScript - Example - Hello World.txt\""] -],[ - "start" ],[ "start", ["text","MakeHelloWorldFile myfilename"] -],[ - "start" ],[ "state_4", ["meta.leading-space"," "] -],[ - "state_4" ],[ "start", ["storage.type.function.asp","Sub"], @@ -26,14 +20,10 @@ ["punctuation.definition.parameters.asp","("], ["variable.parameter.function.asp","FileName"], ["punctuation.definition.parameters.asp",")"] -],[ - "start" ],[ "start", ["punctuation.definition.comment.asp","'"], ["comment.line.apostrophe.asp","Create a new file in C: drive or overwrite existing file"] -],[ - "start" ],[ "start", ["meta.odd-tab.spaces"," "], @@ -47,8 +37,6 @@ ["punctuation.definition.string.begin.asp","\""], ["string.quoted.double.asp","Scripting.FileSystemObject\""], ["text",")"] -],[ - "start" ],[ "start", ["meta.odd-tab.spaces"," "], @@ -59,8 +47,6 @@ ["text","(FileName) "], ["keyword.control.asp","Then"], ["text"," "] -],[ - "start" ],[ "start", ["meta.odd-tab.spaces"," "], @@ -81,8 +67,6 @@ ["punctuation.definition.string.begin.asp","\""], ["string.quoted.double.asp"," exists ... OK to overwrite?\""], ["text",", vbOKCancel)"] -],[ - "start" ],[ "start", ["meta.odd-tab.spaces"," "], @@ -90,8 +74,6 @@ ["meta.odd-tab.spaces"," "], ["punctuation.definition.comment.asp","'"], ["comment.line.apostrophe.asp","If button selected is not OK, then quit now"] -],[ - "start" ],[ "start", ["meta.odd-tab.spaces"," "], @@ -99,8 +81,6 @@ ["meta.odd-tab.spaces"," "], ["punctuation.definition.comment.asp","'"], ["comment.line.apostrophe.asp","vbOK is a language constant"] -],[ - "start" ],[ "start", ["meta.odd-tab.spaces"," "], @@ -113,15 +93,11 @@ ["keyword.control.asp","Then"], ["text"," "], ["keyword.control.asp","Exit Sub"] -],[ - "start" ],[ "start", ["meta.odd-tab.spaces"," "], ["meta.leading-space"," "], ["keyword.control.asp","Else"] -],[ - "start" ],[ "start", ["meta.odd-tab.spaces"," "], @@ -129,8 +105,6 @@ ["meta.odd-tab.spaces"," "], ["punctuation.definition.comment.asp","'"], ["comment.line.apostrophe.asp","Confirm OK to create"] -],[ - "start" ],[ "start", ["meta.odd-tab.spaces"," "], @@ -151,8 +125,6 @@ ["punctuation.definition.string.begin.asp","\""], ["string.quoted.double.asp"," ... OK to create?\""], ["text",", vbOKCancel)"] -],[ - "start" ],[ "start", ["meta.odd-tab.spaces"," "], @@ -165,23 +137,17 @@ ["keyword.control.asp","Then"], ["text"," "], ["keyword.control.asp","Exit Sub"] -],[ - "start" ],[ "start", ["meta.odd-tab.spaces"," "], ["meta.leading-space"," "], ["keyword.control.asp","End If"] -],[ - "start" ],[ "start", ["meta.odd-tab.spaces"," "], ["meta.leading-space"," "], ["punctuation.definition.comment.asp","'"], ["comment.line.apostrophe.asp","Create new file (or replace an existing file)"] -],[ - "start" ],[ "start", ["meta.odd-tab.spaces"," "], @@ -190,8 +156,6 @@ ["text"," FileObject "], ["keyword.operator.asp","="], ["text"," FSO.CreateTextFile (FileName)"] -],[ - "start" ],[ "start", ["meta.odd-tab.spaces"," "], @@ -204,8 +168,6 @@ ["text"," "], ["support.function.vb.asp","Now"], ["text","()"] -],[ - "start" ],[ "start", ["meta.odd-tab.spaces"," "], @@ -213,8 +175,6 @@ ["text","FileObject.WriteLine "], ["punctuation.definition.string.begin.asp","\""], ["string.quoted.double.asp","Hello World\""] -],[ - "start" ],[ "start", ["meta.odd-tab.spaces"," "], @@ -222,8 +182,6 @@ ["text","FileObject."], ["entity.name.function.asp","Close"], ["text","()"] -],[ - "start" ],[ "start", ["meta.odd-tab.spaces"," "], @@ -239,8 +197,6 @@ ["text"," "], ["punctuation.definition.string.begin.asp","\""], ["string.quoted.double.asp"," ... updated.\""] -],[ - "start" ],[ "start", ["support.function.asp","End"], diff --git a/lib/ace/mode/php/php.js b/lib/ace/mode/php/php.js index a1abc609..ed23f641 100644 --- a/lib/ace/mode/php/php.js +++ b/lib/ace/mode/php/php.js @@ -629,7 +629,7 @@ PHP.Lexer = function( src, ini ) { }, { value: PHP.Constants.T_VARIABLE, - re: /^\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/ + re: /^\$[a-zA-Z_\x7f-\uffff][a-zA-Z0-9_\x7f-\uffff]*/ }, { value: PHP.Constants.T_WHITESPACE, @@ -648,7 +648,7 @@ PHP.Lexer = function( src, ini ) { return result; } - var match = result.match( /(?:[^\\]|\\.)*[^\\]\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/g ); + var match = result.match( /(?:[^\\]|\\.)*[^\\]\$[a-zA-Z_\x7f-\uffff][a-zA-Z0-9_\x7f-\uffff]*/g ); if ( match !== null ) { // string has a variable @@ -675,7 +675,7 @@ PHP.Lexer = function( src, ini ) { } - match = result.match(/^\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/); + match = result.match(/^\$[a-zA-Z_\x7f-\uffff][a-zA-Z0-9_\x7f-\uffff]*/); @@ -689,7 +689,7 @@ PHP.Lexer = function( src, ini ) { result = result.substring( match[ 0 ].length ); - match = result.match(/^(\-\>)\s*([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)\s*(\()/); + match = result.match(/^(\-\>)\s*([a-zA-Z_\x7f-\uffff][a-zA-Z0-9_\x7f-\uffff]*)\s*(\()/); if ( match !== null ) { @@ -719,7 +719,7 @@ PHP.Lexer = function( src, ini ) { if ( curlyOpen > 0) { re = /^([^\\\$"{}\]\)]|\\.)+/g; } else { - re = /^([^\\\$"{]|\\.|{[^\$]|\$(?=[^a-zA-Z_\x7f-\xff]))+/g;; + re = /^([^\\\$"{]|\\.|{[^\$]|\$(?=[^a-zA-Z_\x7f-\uffff]))+/g;; } while(( match = result.match( re )) !== null ) { @@ -756,7 +756,7 @@ PHP.Lexer = function( src, ini ) { if (len === result.length) { // nothing has been found yet - if ((match = result.match( /^(([^\\]|\\.)*?[^\\]\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)/g )) !== null) { + if ((match = result.match( /^(([^\\]|\\.)*?[^\\]\$[a-zA-Z_\x7f-\uffff][a-zA-Z0-9_\x7f-\uffff]*)/g )) !== null) { return; } } @@ -786,7 +786,7 @@ PHP.Lexer = function( src, ini ) { }, { value: PHP.Constants.T_STRING, - re: /^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/ + re: /^[a-zA-Z_\x7f-\uffff][a-zA-Z0-9_\x7f-\uffff]*/ }, { value: -1, diff --git a/lib/ace/mode/php_highlight_rules.js b/lib/ace/mode/php_highlight_rules.js index d0419aca..ca591d1b 100644 --- a/lib/ace/mode/php_highlight_rules.js +++ b/lib/ace/mode/php_highlight_rules.js @@ -969,11 +969,11 @@ var PhpLangHighlightRules = function() { else if (value == "debugger") return "invalid.deprecated"; else - if(value.match(/^(\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*|self|parent)$/)) + if(value.match(/^(\$[a-zA-Z_\x7f-\uffff][a-zA-Z0-9_\x7f-\uffff]*|self|parent)$/)) return "variable"; return "identifier"; }, - regex : "[a-zA-Z_$\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*\\b" + regex : /[a-zA-Z_$\x7f-\uffff][a-zA-Z0-9_\x7f-\uffff]*/ }, { onMatch : function(value, currentSate, state) { value = value.substr(3); diff --git a/lib/ace/mode/xml_highlight_rules.js b/lib/ace/mode/xml_highlight_rules.js index 54c7db9f..ca9e88a3 100644 --- a/lib/ace/mode/xml_highlight_rules.js +++ b/lib/ace/mode/xml_highlight_rules.js @@ -206,7 +206,7 @@ var XmlHighlightRules = function(normalize) { this.embedTagRules = function(HighlightRules, prefix, tag){ this.$rules.tag.unshift({ token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], - regex : "(<)(" + tag + ")", + regex : "(<)(" + tag + "(?=\\s|>|$))", next: [ {include : "attributes"}, {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"} @@ -224,7 +224,7 @@ var XmlHighlightRules = function(normalize) { this.embedRules(HighlightRules, prefix, [{ token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"], - regex : "(|$))", next: tag + "-end" }, { token: "string.cdata.xml", diff --git a/lib/ace/mouse/mouse_handler.js b/lib/ace/mouse/mouse_handler.js index 55b72389..c7573e94 100644 --- a/lib/ace/mouse/mouse_handler.js +++ b/lib/ace/mouse/mouse_handler.js @@ -45,7 +45,9 @@ var MouseHandler = function(editor) { new DefaultHandlers(this); new DefaultGutterHandler(this); new DragdropHandler(this); - + + var focusEditor = function(e) { editor.focus() }; + var mouseTarget = editor.renderer.getMouseEventTarget(); event.addListener(mouseTarget, "click", this.onMouseEvent.bind(this, "click")); event.addListener(mouseTarget, "mousemove", this.onMouseMove.bind(this, "mousemove")); @@ -53,6 +55,10 @@ var MouseHandler = function(editor) { if (editor.renderer.scrollBarV) { event.addMultiMouseDownListener(editor.renderer.scrollBarV.inner, [400, 300, 250], this, "onMouseEvent"); event.addMultiMouseDownListener(editor.renderer.scrollBarH.inner, [400, 300, 250], this, "onMouseEvent"); + if (useragent.isIE) { + event.addListener(editor.renderer.scrollBarV.element, "mousedown", focusEditor); + event.addListener(editor.renderer.scrollBarH.element, "mousemove", focusEditor); + } } event.addMouseWheelListener(editor.container, this.onMouseWheel.bind(this, "mousewheel")); @@ -62,9 +68,7 @@ var MouseHandler = function(editor) { event.addListener(gutterEl, "dblclick", this.onMouseEvent.bind(this, "gutterdblclick")); event.addListener(gutterEl, "mousemove", this.onMouseEvent.bind(this, "guttermousemove")); - event.addListener(mouseTarget, "mousedown", function(e) { - editor.focus(); - }); + event.addListener(mouseTarget, "mousedown", focusEditor); event.addListener(gutterEl, "mousedown", function(e) { editor.focus(); diff --git a/lib/ace/snippets/_all_modes.js b/lib/ace/snippets/_all_modes.js new file mode 100644 index 00000000..17086d08 --- /dev/null +++ b/lib/ace/snippets/_all_modes.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./_all_modes.snippets"); +exports.scope = "_all_modes"; + +}); diff --git a/lib/ace/snippets/_all_modes.snippets b/lib/ace/snippets/_all_modes.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/all_modes.js b/lib/ace/snippets/all_modes.js new file mode 100644 index 00000000..d0e46233 --- /dev/null +++ b/lib/ace/snippets/all_modes.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./all_modes.snippets"); +exports.scope = "all_modes"; + +}); diff --git a/lib/ace/snippets/all_modes.snippets b/lib/ace/snippets/all_modes.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/cirru.js b/lib/ace/snippets/cirru.js new file mode 100644 index 00000000..c0d3416d --- /dev/null +++ b/lib/ace/snippets/cirru.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./cirru.snippets"); +exports.scope = "cirru"; + +}); diff --git a/lib/ace/snippets/cirru.snippets b/lib/ace/snippets/cirru.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/gherkin.js b/lib/ace/snippets/gherkin.js new file mode 100644 index 00000000..da0b684d --- /dev/null +++ b/lib/ace/snippets/gherkin.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./gherkin.snippets"); +exports.scope = "gherkin"; + +}); diff --git a/lib/ace/snippets/gherkin.snippets b/lib/ace/snippets/gherkin.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/jack.js b/lib/ace/snippets/jack.js new file mode 100644 index 00000000..29b8f9d2 --- /dev/null +++ b/lib/ace/snippets/jack.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./jack.snippets"); +exports.scope = "jack"; + +}); diff --git a/lib/ace/snippets/jack.snippets b/lib/ace/snippets/jack.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/mel.js b/lib/ace/snippets/mel.js new file mode 100644 index 00000000..090d79b3 --- /dev/null +++ b/lib/ace/snippets/mel.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./mel.snippets"); +exports.scope = "mel"; + +}); diff --git a/lib/ace/snippets/mel.snippets b/lib/ace/snippets/mel.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/plain_text.js b/lib/ace/snippets/plain_text.js new file mode 100644 index 00000000..4b4dad55 --- /dev/null +++ b/lib/ace/snippets/plain_text.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./plain_text.snippets"); +exports.scope = "plain_text"; + +}); diff --git a/lib/ace/snippets/plain_text.snippets b/lib/ace/snippets/plain_text.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/protobuf.snippets b/lib/ace/snippets/protobuf.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/smarty.js b/lib/ace/snippets/smarty.js new file mode 100644 index 00000000..121d0b7c --- /dev/null +++ b/lib/ace/snippets/smarty.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./smarty.snippets"); +exports.scope = "smarty"; + +}); diff --git a/lib/ace/snippets/smarty.snippets b/lib/ace/snippets/smarty.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/snippets/space.js b/lib/ace/snippets/space.js new file mode 100644 index 00000000..766d493e --- /dev/null +++ b/lib/ace/snippets/space.js @@ -0,0 +1,7 @@ +define(function(require, exports, module) { +"use strict"; + +exports.snippetText = require("../requirejs/text!./space.snippets"); +exports.scope = "space"; + +}); diff --git a/lib/ace/snippets/space.snippets b/lib/ace/snippets/space.snippets new file mode 100644 index 00000000..e69de29b diff --git a/lib/ace/virtual_renderer.js b/lib/ace/virtual_renderer.js index 6f6ab177..d55d6085 100644 --- a/lib/ace/virtual_renderer.js +++ b/lib/ace/virtual_renderer.js @@ -34,6 +34,7 @@ define(function(require, exports, module) { var oop = require("./lib/oop"); var dom = require("./lib/dom"); var config = require("./config"); +var useragent = require("./lib/useragent"); var GutterLayer = require("./layer/gutter").Gutter; var MarkerLayer = require("./layer/marker").Marker; var TextLayer = require("./layer/text").Text; @@ -71,7 +72,7 @@ var VirtualRenderer = function(container, theme) { // dom.importCssString(editorCss, "ace_editor", container.ownerDocument); // in IE <= 9 the native cursor always shines through - this.$keepTextAreaAtCursor = true; + this.$keepTextAreaAtCursor = !useragent.isOldIE; dom.addCssClass(this.container, "ace_editor");