Merge remote-tracking branch 'remotes/origin/master'
Conflicts: lib/ace/document.js lib/ace/editor.js lib/ace/undomanager.js
This commit is contained in:
commit
b5af2c898c
82 changed files with 18444 additions and 332 deletions
|
|
@ -280,7 +280,7 @@ function addSuffix(options) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getWriteFilters(options, projectType) {
|
function getWriteFilters(options, projectType, main) {
|
||||||
var filters = [
|
var filters = [
|
||||||
copy.filter.moduleDefines,
|
copy.filter.moduleDefines,
|
||||||
removeUseStrict,
|
removeUseStrict,
|
||||||
|
|
@ -310,11 +310,9 @@ function getWriteFilters(options, projectType) {
|
||||||
return text;
|
return text;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (options.exportModule && projectType == "main") {
|
if (options.exportModule && projectType == "main" || projectType == "ext") {
|
||||||
if (options.noconflict)
|
filters.push(exportAce(options.ns, options.exportModule,
|
||||||
filters.push(exportAce(options.ns, options.exportModule, options.ns));
|
options.noconflict ? options.ns : "", projectType == "ext" && main));
|
||||||
else
|
|
||||||
filters.push(exportAce(options.ns, options.exportModule));
|
|
||||||
}
|
}
|
||||||
return filters;
|
return filters;
|
||||||
}
|
}
|
||||||
|
|
@ -390,7 +388,7 @@ var buildAce = function(options) {
|
||||||
project: cloneProject(project),
|
project: cloneProject(project),
|
||||||
require: [ 'ace/ext/' + ext ]
|
require: [ 'ace/ext/' + ext ]
|
||||||
}],
|
}],
|
||||||
filter: getWriteFilters(options, "ext"),
|
filter: getWriteFilters(options, "ext", 'ace/ext/' + ext),
|
||||||
dest: targetDir + "/ext-" + ext + ".js"
|
dest: targetDir + "/ext-" + ext + ".js"
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -650,7 +648,7 @@ function namespace(ns) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function exportAce(ns, module, requireBase) {
|
function exportAce(ns, module, requireBase, extModule) {
|
||||||
requireBase = requireBase || "window";
|
requireBase = requireBase || "window";
|
||||||
module = module || "ace/ace";
|
module = module || "ace/ace";
|
||||||
return function(text) {
|
return function(text) {
|
||||||
|
|
@ -666,7 +664,16 @@ function exportAce(ns, module, requireBase) {
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (extModule) {
|
||||||
|
module = extModule;
|
||||||
|
template = function() {
|
||||||
|
(function() {
|
||||||
|
REQUIRE_NS.require(["MODULE"], function() {});
|
||||||
|
})();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
return (text + ";" + template
|
return (text + ";" + template
|
||||||
.toString()
|
.toString()
|
||||||
.replace(/MODULE/g, module)
|
.replace(/MODULE/g, module)
|
||||||
|
|
|
||||||
17
demo/kitchen-sink/docs/Haxe.hx
Normal file
17
demo/kitchen-sink/docs/Haxe.hx
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
class Haxe
|
||||||
|
{
|
||||||
|
public static function main()
|
||||||
|
{
|
||||||
|
// Say Hello!
|
||||||
|
var greeting:String = "Hello World";
|
||||||
|
trace(greeting);
|
||||||
|
|
||||||
|
var targets:Array<String> = ["Flash","Javascript","PHP","Neko","C++","iOS","Android","webOS"];
|
||||||
|
trace("Haxe is a great language that can target:");
|
||||||
|
for (target in targets)
|
||||||
|
{
|
||||||
|
trace (" - " + target);
|
||||||
|
}
|
||||||
|
trace("And many more!");
|
||||||
|
}
|
||||||
|
}
|
||||||
57
demo/kitchen-sink/docs/Nix.nix
Normal file
57
demo/kitchen-sink/docs/Nix.nix
Normal file
|
|
@ -0,0 +1,57 @@
|
||||||
|
{
|
||||||
|
# Name of our deployment
|
||||||
|
network.description = "HelloWorld";
|
||||||
|
# Enable rolling back to previous versions of our infrastructure
|
||||||
|
network.enableRollback = true;
|
||||||
|
|
||||||
|
# It consists of a single server named 'helloserver'
|
||||||
|
helloserver =
|
||||||
|
# Every server gets passed a few arguments, including a reference
|
||||||
|
# to nixpkgs (pkgs)
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
let
|
||||||
|
# We import our custom packages from ./default passing pkgs as argument
|
||||||
|
packages = import ./default.nix { pkgs = pkgs; };
|
||||||
|
# This is the nodejs version specified in default.nix
|
||||||
|
nodejs = packages.nodejs;
|
||||||
|
# And this is the application we'd like to deploy
|
||||||
|
app = packages.app;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
# We'll be running our application on port 8080, because a regular
|
||||||
|
# user cannot bind to port 80
|
||||||
|
# Then, using some iptables magic we'll forward traffic designated to port 80 to 8080
|
||||||
|
networking.firewall.enable = true;
|
||||||
|
# We will open up port 22 (SSH) as well otherwise we're locking ourselves out
|
||||||
|
networking.firewall.allowedTCPPorts = [ 80 8080 22 ];
|
||||||
|
networking.firewall.allowPing = true;
|
||||||
|
|
||||||
|
# Port forwarding using iptables
|
||||||
|
networking.firewall.extraCommands = ''
|
||||||
|
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
|
||||||
|
'';
|
||||||
|
|
||||||
|
# To run our node.js program we're going to use a systemd service
|
||||||
|
# We can configure the service to automatically start on boot and to restart
|
||||||
|
# the process in case it crashes
|
||||||
|
systemd.services.helloserver = {
|
||||||
|
description = "Hello world application";
|
||||||
|
# Start the service after the network is available
|
||||||
|
after = [ "network.target" ];
|
||||||
|
# We're going to run it on port 8080 in production
|
||||||
|
environment = { PORT = "8080"; };
|
||||||
|
serviceConfig = {
|
||||||
|
# The actual command to run
|
||||||
|
ExecStart = "${nodejs}/bin/node ${app}/server.js";
|
||||||
|
# For security reasons we'll run this process as a special 'nodejs' user
|
||||||
|
User = "nodejs";
|
||||||
|
Restart = "always";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# And lastly we ensure the user we run our application as is created
|
||||||
|
users.extraUsers = {
|
||||||
|
nodejs = { };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
6040
demo/kitchen-sink/docs/asciidoc.asciidoc
Normal file
6040
demo/kitchen-sink/docs/asciidoc.asciidoc
Normal file
File diff suppressed because it is too large
Load diff
36
demo/kitchen-sink/docs/cirru.cirru
Normal file
36
demo/kitchen-sink/docs/cirru.cirru
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
-- https://github.com/Cirru/cirru-gopher/blob/master/code/scope.cr,
|
||||||
|
|
||||||
|
set a (int 2)
|
||||||
|
|
||||||
|
print (self)
|
||||||
|
|
||||||
|
set c (child)
|
||||||
|
|
||||||
|
under c
|
||||||
|
under parent
|
||||||
|
print a
|
||||||
|
|
||||||
|
print $ get c a
|
||||||
|
|
||||||
|
set c x (int 3)
|
||||||
|
print $ get c x
|
||||||
|
|
||||||
|
set just-print $ code
|
||||||
|
print a
|
||||||
|
|
||||||
|
print just-print
|
||||||
|
|
||||||
|
eval (self) just-print
|
||||||
|
eval just-print
|
||||||
|
|
||||||
|
print (string "string with space")
|
||||||
|
print (string "escapes \n \"\\")
|
||||||
|
|
||||||
|
brackets ((((()))))
|
||||||
|
|
||||||
|
"eval" $ string "eval"
|
||||||
|
|
||||||
|
print (add $ (int 1) (int 2))
|
||||||
|
|
||||||
|
print $ unwrap $
|
||||||
|
map (a $ int 1) (b $ int 2)
|
||||||
1
demo/kitchen-sink/docs/cobol.CBL
Normal file
1
demo/kitchen-sink/docs/cobol.CBL
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
TODO
|
||||||
|
|
@ -1 +1,4 @@
|
||||||
TODO
|
[.ShellClassInfo]
|
||||||
|
IconResource=..\logo.png
|
||||||
|
[ViewState]
|
||||||
|
FolderType=Generic
|
||||||
|
|
|
||||||
7
demo/kitchen-sink/docs/smarty.smarty
Normal file
7
demo/kitchen-sink/docs/smarty.smarty
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
{foreach $foo as $bar}
|
||||||
|
<a href="{$bar.zig}">{$bar.zag}</a>
|
||||||
|
<a href="{$bar.zig2}">{$bar.zag2}</a>
|
||||||
|
<a href="{$bar.zig3}">{$bar.zag3}</a>
|
||||||
|
{foreachelse}
|
||||||
|
There were no rows found.
|
||||||
|
{/foreach}
|
||||||
11
index.html
11
index.html
|
|
@ -952,7 +952,7 @@ if (match) {
|
||||||
<a href="https://www.decor-tab-creator.com">Decor</a>
|
<a href="https://www.decor-tab-creator.com">Decor</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<img src="https://2.gravatar.com/avatar/cca33939e02e36446015d57b01868d2d?d=https%3A%2F%2Fidenticons.github.com%2F260479af5073adc51195677756073de5.png&r=x&s=100"
|
<img src='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c3ZnIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iOTVweCIgaGVpZ2h0PSIxMTZweCIgdmlld0JveD0iLTAuMTc0IC0wLjMwNCA5NSAxMTYiPg0KPHBvbHlnb24gZmlsbD0iIzMzMzMzMyIgcG9pbnRzPSIzNy45MzMsMTE1LjM5MyAyMi42NTcsMTAwLjExNiA2My44OSw1OC44ODIgMjAuMjg5LDE1LjI3NiAzNS41NjcsMCA5NC40NDMsNTguODgyIj48L3BvbHlnb24+DQo8cG9seWdvbiBmaWxsPSIjM0ZBOUY1IiBwb2ludHM9IjI3LjQ1Nyw4NC42MzMgMCw1Ny4xNTQgMjYuMzk3LDMwLjc2IDM1LjY5Miw0MC4wNTggMTguNTksNTcuMTYgMzYuNzU3LDc1LjMzOSI+PC9wb2x5Z29uPg0KPC9zdmc+DQo='
|
||||||
style="left: 12px; width: 79px;top: -18px;">
|
style="left: 12px; width: 79px;top: -18px;">
|
||||||
<a href="http://www.divshot.com/">Divshot</a>
|
<a href="http://www.divshot.com/">Divshot</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
@ -968,10 +968,6 @@ if (match) {
|
||||||
style="left: 4px; width: 96px;top: -17px;">
|
style="left: 4px; width: 96px;top: -17px;">
|
||||||
<a href="http://multiPlay.io/">MultiPlay.io</a>
|
<a href="http://multiPlay.io/">MultiPlay.io</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
|
||||||
<div class="text-logo" style="font-size: 18px;margin-left: -3px;">Codeshare.io</div>
|
|
||||||
<a href="http://codeshare.io">Codeshare.io</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
<li>
|
||||||
<div class="text-logo" style="font-size: 23px;">Runnable</div>
|
<div class="text-logo" style="font-size: 23px;">Runnable</div>
|
||||||
<a href="http://runnable.com">Runnable</a>
|
<a href="http://runnable.com">Runnable</a>
|
||||||
|
|
@ -985,11 +981,6 @@ if (match) {
|
||||||
style="left: 4px; width: 90px;top: -17px;">
|
style="left: 4px; width: 90px;top: -17px;">
|
||||||
<a href="http://joshnuss.github.io/mruby-web-irb/">Mruby-web-irb</a>
|
<a href="http://joshnuss.github.io/mruby-web-irb/">Mruby-web-irb</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
|
||||||
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAG4AAAA8CAYAAACHHY8HAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfdBQETIiXg/sIKAAAAGnRFWHRTb2Z0d2FyZQBQYWludC5ORVQgdjMuNS4xMDD0cqEAAAFpSURBVHhe7dstTgRBEAbQTVgCKDTBInCgUJwAQwgEAQK1hjtwCAR3IASB2ENwCg6AJAFBws83jmCnMy3qbfLJ7qp+NVkxnZnN/AgQIECAAAECBAgQINBWYLFYrCXHyUWxnOS86201J9wtzd8nP0XzNCF121IZ2HvRoQ0P61dbzQl3S/OPhQe3nJC6banhfz45S66K5Tzn3WiraTcCBAgQIECAAAECBAgQIECAAAECBAgQINBLIG+995KHZFksR73Mm9TNsF6K3rF95txbTRB7bJLm34oObrjV3u1h3qRmmr9OPgoO764JYM9NMrR5slosPcnVJkCAAAECBAgQIECAAAECBAgQIEBgpEDeZ24nhwUzH0nXb3mGdVD448bnnH2ln/6Iymn8tuD1z99Pp/dH8PVbmqFdJt9Fh/eac2/20x9ZOc2fJjcFszOSznICBAgQIECAAAECBAgQIECAAAECBAgQIECAwD+BX9K9KZrlGQTqAAAAAElFTkSuQmCC"
|
|
||||||
style="left: 0px; width: 110px;top: 9px;">
|
|
||||||
<a href="http://www.radide.com/">RAD Ide</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
<li>
|
||||||
<div class="text-logo" style="margin-left:0px;">Codiqa</div>
|
<div class="text-logo" style="margin-left:0px;">Codiqa</div>
|
||||||
<a href="https://codiqa.com/">Codiqa</a>
|
<a href="https://codiqa.com/">Codiqa</a>
|
||||||
|
|
|
||||||
|
|
@ -174,7 +174,7 @@ var Anchor = exports.Anchor = function(doc, row, column) {
|
||||||
|
|
||||||
this.row = pos.row;
|
this.row = pos.row;
|
||||||
this.column = pos.column;
|
this.column = pos.column;
|
||||||
this._emit("change", {
|
this._signal("change", {
|
||||||
old: old,
|
old: old,
|
||||||
value: pos
|
value: pos
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ var Autocomplete = function() {
|
||||||
this.detach = function() {
|
this.detach = function() {
|
||||||
this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler);
|
this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler);
|
||||||
this.editor.off("changeSelection", this.changeListener);
|
this.editor.off("changeSelection", this.changeListener);
|
||||||
this.editor.off("blur", this.changeListener);
|
this.editor.off("blur", this.blurListener);
|
||||||
this.editor.off("mousedown", this.mousedownListener);
|
this.editor.off("mousedown", this.mousedownListener);
|
||||||
this.editor.off("mousewheel", this.mousewheelListener);
|
this.editor.off("mousewheel", this.mousewheelListener);
|
||||||
this.changeTimer.cancel();
|
this.changeTimer.cancel();
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,7 @@ var BackgroundTokenizer = function(tokenizer, editor) {
|
||||||
first: firstRow,
|
first: firstRow,
|
||||||
last: lastRow
|
last: lastRow
|
||||||
};
|
};
|
||||||
this._emit("update", {data: data});
|
this._signal("update", {data: data});
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ exports.commands = [{
|
||||||
module.showErrorMarker(editor, 1);
|
module.showErrorMarker(editor, 1);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
scrollIntoView: "center",
|
scrollIntoView: "animate",
|
||||||
readOnly: true
|
readOnly: true
|
||||||
}, {
|
}, {
|
||||||
name: "goToPreviousError",
|
name: "goToPreviousError",
|
||||||
|
|
@ -70,7 +70,7 @@ exports.commands = [{
|
||||||
module.showErrorMarker(editor, -1);
|
module.showErrorMarker(editor, -1);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
scrollIntoView: "center",
|
scrollIntoView: "animate",
|
||||||
readOnly: true
|
readOnly: true
|
||||||
}, {
|
}, {
|
||||||
name: "selectall",
|
name: "selectall",
|
||||||
|
|
@ -366,12 +366,14 @@ exports.commands = [{
|
||||||
bindKey: "Shift-Home",
|
bindKey: "Shift-Home",
|
||||||
exec: function(editor) { editor.getSelection().selectLineStart(); },
|
exec: function(editor) { editor.getSelection().selectLineStart(); },
|
||||||
multiSelectAction: "forEach",
|
multiSelectAction: "forEach",
|
||||||
|
scrollIntoView: "cursor",
|
||||||
readOnly: true
|
readOnly: true
|
||||||
}, {
|
}, {
|
||||||
name: "selectlineend",
|
name: "selectlineend",
|
||||||
bindKey: "Shift-End",
|
bindKey: "Shift-End",
|
||||||
exec: function(editor) { editor.getSelection().selectLineEnd(); },
|
exec: function(editor) { editor.getSelection().selectLineEnd(); },
|
||||||
multiSelectAction: "forEach",
|
multiSelectAction: "forEach",
|
||||||
|
scrollIntoView: "cursor",
|
||||||
readOnly: true
|
readOnly: true
|
||||||
}, {
|
}, {
|
||||||
name: "togglerecording",
|
name: "togglerecording",
|
||||||
|
|
@ -409,21 +411,25 @@ exports.commands = [{
|
||||||
editor.clearSelection();
|
editor.clearSelection();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
scrollIntoView: "cursor",
|
||||||
multiSelectAction: "forEach"
|
multiSelectAction: "forEach"
|
||||||
}, {
|
}, {
|
||||||
name: "removeline",
|
name: "removeline",
|
||||||
bindKey: bindKey("Ctrl-D", "Command-D"),
|
bindKey: bindKey("Ctrl-D", "Command-D"),
|
||||||
exec: function(editor) { editor.removeLines(); },
|
exec: function(editor) { editor.removeLines(); },
|
||||||
|
scrollIntoView: "cursor",
|
||||||
multiSelectAction: "forEachLine"
|
multiSelectAction: "forEachLine"
|
||||||
}, {
|
}, {
|
||||||
name: "duplicateSelection",
|
name: "duplicateSelection",
|
||||||
bindKey: bindKey("Ctrl-Shift-D", "Command-Shift-D"),
|
bindKey: bindKey("Ctrl-Shift-D", "Command-Shift-D"),
|
||||||
exec: function(editor) { editor.duplicateSelection(); },
|
exec: function(editor) { editor.duplicateSelection(); },
|
||||||
|
scrollIntoView: "cursor",
|
||||||
multiSelectAction: "forEach"
|
multiSelectAction: "forEach"
|
||||||
}, {
|
}, {
|
||||||
name: "sortlines",
|
name: "sortlines",
|
||||||
bindKey: bindKey("Ctrl-Alt-S", "Command-Alt-S"),
|
bindKey: bindKey("Ctrl-Alt-S", "Command-Alt-S"),
|
||||||
exec: function(editor) { editor.sortLines(); },
|
exec: function(editor) { editor.sortLines(); },
|
||||||
|
scrollIntoView: "selection",
|
||||||
multiSelectAction: "forEachLine"
|
multiSelectAction: "forEachLine"
|
||||||
}, {
|
}, {
|
||||||
name: "togglecomment",
|
name: "togglecomment",
|
||||||
|
|
@ -435,7 +441,8 @@ exports.commands = [{
|
||||||
name: "toggleBlockComment",
|
name: "toggleBlockComment",
|
||||||
bindKey: bindKey("Ctrl-Shift-/", "Command-Shift-/"),
|
bindKey: bindKey("Ctrl-Shift-/", "Command-Shift-/"),
|
||||||
exec: function(editor) { editor.toggleBlockComment(); },
|
exec: function(editor) { editor.toggleBlockComment(); },
|
||||||
multiSelectAction: "forEach"
|
multiSelectAction: "forEach",
|
||||||
|
scrollIntoView: "selectionPart"
|
||||||
}, {
|
}, {
|
||||||
name: "modifyNumberUp",
|
name: "modifyNumberUp",
|
||||||
bindKey: bindKey("Ctrl-Shift-Up", "Alt-Shift-Up"),
|
bindKey: bindKey("Ctrl-Shift-Up", "Alt-Shift-Up"),
|
||||||
|
|
@ -463,24 +470,29 @@ exports.commands = [{
|
||||||
}, {
|
}, {
|
||||||
name: "copylinesup",
|
name: "copylinesup",
|
||||||
bindKey: bindKey("Alt-Shift-Up", "Command-Option-Up"),
|
bindKey: bindKey("Alt-Shift-Up", "Command-Option-Up"),
|
||||||
exec: function(editor) { editor.copyLinesUp(); }
|
exec: function(editor) { editor.copyLinesUp(); },
|
||||||
|
scrollIntoView: "cursor"
|
||||||
}, {
|
}, {
|
||||||
name: "movelinesup",
|
name: "movelinesup",
|
||||||
bindKey: bindKey("Alt-Up", "Option-Up"),
|
bindKey: bindKey("Alt-Up", "Option-Up"),
|
||||||
exec: function(editor) { editor.moveLinesUp(); }
|
exec: function(editor) { editor.moveLinesUp(); },
|
||||||
|
scrollIntoView: "cursor"
|
||||||
}, {
|
}, {
|
||||||
name: "copylinesdown",
|
name: "copylinesdown",
|
||||||
bindKey: bindKey("Alt-Shift-Down", "Command-Option-Down"),
|
bindKey: bindKey("Alt-Shift-Down", "Command-Option-Down"),
|
||||||
exec: function(editor) { editor.copyLinesDown(); }
|
exec: function(editor) { editor.copyLinesDown(); },
|
||||||
|
scrollIntoView: "cursor"
|
||||||
}, {
|
}, {
|
||||||
name: "movelinesdown",
|
name: "movelinesdown",
|
||||||
bindKey: bindKey("Alt-Down", "Option-Down"),
|
bindKey: bindKey("Alt-Down", "Option-Down"),
|
||||||
exec: function(editor) { editor.moveLinesDown(); }
|
exec: function(editor) { editor.moveLinesDown(); },
|
||||||
|
scrollIntoView: "cursor"
|
||||||
}, {
|
}, {
|
||||||
name: "del",
|
name: "del",
|
||||||
bindKey: bindKey("Delete", "Delete|Ctrl-D|Shift-Delete"),
|
bindKey: bindKey("Delete", "Delete|Ctrl-D|Shift-Delete"),
|
||||||
exec: function(editor) { editor.remove("right"); },
|
exec: function(editor) { editor.remove("right"); },
|
||||||
multiSelectAction: "forEach"
|
multiSelectAction: "forEach",
|
||||||
|
scrollIntoView: "cursor"
|
||||||
}, {
|
}, {
|
||||||
name: "backspace",
|
name: "backspace",
|
||||||
bindKey: bindKey(
|
bindKey: bindKey(
|
||||||
|
|
@ -488,7 +500,8 @@ exports.commands = [{
|
||||||
"Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"
|
"Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"
|
||||||
),
|
),
|
||||||
exec: function(editor) { editor.remove("left"); },
|
exec: function(editor) { editor.remove("left"); },
|
||||||
multiSelectAction: "forEach"
|
multiSelectAction: "forEach",
|
||||||
|
scrollIntoView: "cursor"
|
||||||
}, {
|
}, {
|
||||||
name: "cut_or_delete",
|
name: "cut_or_delete",
|
||||||
bindKey: bindKey("Shift-Delete", null),
|
bindKey: bindKey("Shift-Delete", null),
|
||||||
|
|
@ -499,27 +512,32 @@ exports.commands = [{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
multiSelectAction: "forEach"
|
multiSelectAction: "forEach",
|
||||||
|
scrollIntoView: "cursor"
|
||||||
}, {
|
}, {
|
||||||
name: "removetolinestart",
|
name: "removetolinestart",
|
||||||
bindKey: bindKey("Alt-Backspace", "Command-Backspace"),
|
bindKey: bindKey("Alt-Backspace", "Command-Backspace"),
|
||||||
exec: function(editor) { editor.removeToLineStart(); },
|
exec: function(editor) { editor.removeToLineStart(); },
|
||||||
multiSelectAction: "forEach"
|
multiSelectAction: "forEach",
|
||||||
|
scrollIntoView: "cursor"
|
||||||
}, {
|
}, {
|
||||||
name: "removetolineend",
|
name: "removetolineend",
|
||||||
bindKey: bindKey("Alt-Delete", "Ctrl-K"),
|
bindKey: bindKey("Alt-Delete", "Ctrl-K"),
|
||||||
exec: function(editor) { editor.removeToLineEnd(); },
|
exec: function(editor) { editor.removeToLineEnd(); },
|
||||||
multiSelectAction: "forEach"
|
multiSelectAction: "forEach",
|
||||||
|
scrollIntoView: "cursor"
|
||||||
}, {
|
}, {
|
||||||
name: "removewordleft",
|
name: "removewordleft",
|
||||||
bindKey: bindKey("Ctrl-Backspace", "Alt-Backspace|Ctrl-Alt-Backspace"),
|
bindKey: bindKey("Ctrl-Backspace", "Alt-Backspace|Ctrl-Alt-Backspace"),
|
||||||
exec: function(editor) { editor.removeWordLeft(); },
|
exec: function(editor) { editor.removeWordLeft(); },
|
||||||
multiSelectAction: "forEach"
|
multiSelectAction: "forEach",
|
||||||
|
scrollIntoView: "cursor"
|
||||||
}, {
|
}, {
|
||||||
name: "removewordright",
|
name: "removewordright",
|
||||||
bindKey: bindKey("Ctrl-Delete", "Alt-Delete"),
|
bindKey: bindKey("Ctrl-Delete", "Alt-Delete"),
|
||||||
exec: function(editor) { editor.removeWordRight(); },
|
exec: function(editor) { editor.removeWordRight(); },
|
||||||
multiSelectAction: "forEach"
|
multiSelectAction: "forEach",
|
||||||
|
scrollIntoView: "cursor"
|
||||||
}, {
|
}, {
|
||||||
name: "outdent",
|
name: "outdent",
|
||||||
bindKey: bindKey("Shift-Tab", "Shift-Tab"),
|
bindKey: bindKey("Shift-Tab", "Shift-Tab"),
|
||||||
|
|
@ -554,27 +572,32 @@ exports.commands = [{
|
||||||
exec: function(editor, args) {
|
exec: function(editor, args) {
|
||||||
editor.insert(lang.stringRepeat(args.text || "", args.times || 1));
|
editor.insert(lang.stringRepeat(args.text || "", args.times || 1));
|
||||||
},
|
},
|
||||||
multiSelectAction: "forEach"
|
multiSelectAction: "forEach",
|
||||||
|
scrollIntoView: "cursor"
|
||||||
}, {
|
}, {
|
||||||
name: "splitline",
|
name: "splitline",
|
||||||
bindKey: bindKey(null, "Ctrl-O"),
|
bindKey: bindKey(null, "Ctrl-O"),
|
||||||
exec: function(editor) { editor.splitLine(); },
|
exec: function(editor) { editor.splitLine(); },
|
||||||
multiSelectAction: "forEach"
|
multiSelectAction: "forEach",
|
||||||
|
scrollIntoView: "cursor"
|
||||||
}, {
|
}, {
|
||||||
name: "transposeletters",
|
name: "transposeletters",
|
||||||
bindKey: bindKey("Ctrl-T", "Ctrl-T"),
|
bindKey: bindKey("Ctrl-T", "Ctrl-T"),
|
||||||
exec: function(editor) { editor.transposeLetters(); },
|
exec: function(editor) { editor.transposeLetters(); },
|
||||||
multiSelectAction: function(editor) {editor.transposeSelections(1); }
|
multiSelectAction: function(editor) {editor.transposeSelections(1); },
|
||||||
|
scrollIntoView: "cursor"
|
||||||
}, {
|
}, {
|
||||||
name: "touppercase",
|
name: "touppercase",
|
||||||
bindKey: bindKey("Ctrl-U", "Ctrl-U"),
|
bindKey: bindKey("Ctrl-U", "Ctrl-U"),
|
||||||
exec: function(editor) { editor.toUpperCase(); },
|
exec: function(editor) { editor.toUpperCase(); },
|
||||||
multiSelectAction: "forEach"
|
multiSelectAction: "forEach",
|
||||||
|
scrollIntoView: "cursor"
|
||||||
}, {
|
}, {
|
||||||
name: "tolowercase",
|
name: "tolowercase",
|
||||||
bindKey: bindKey("Ctrl-Shift-U", "Ctrl-Shift-U"),
|
bindKey: bindKey("Ctrl-Shift-U", "Ctrl-Shift-U"),
|
||||||
exec: function(editor) { editor.toLowerCase(); },
|
exec: function(editor) { editor.toLowerCase(); },
|
||||||
multiSelectAction: "forEach"
|
multiSelectAction: "forEach",
|
||||||
|
scrollIntoView: "cursor"
|
||||||
}];
|
}];
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,7 @@
|
||||||
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
|
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
color: black;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ace_editor .ace_line {
|
|
||||||
direction: ltr;
|
direction: ltr;
|
||||||
unicode-bidi: bidi-override;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace_scroller {
|
.ace_scroller {
|
||||||
|
|
@ -64,6 +59,10 @@
|
||||||
left: 0;
|
left: 0;
|
||||||
cursor: default;
|
cursor: default;
|
||||||
z-index: 4;
|
z-index: 4;
|
||||||
|
-ms-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace_gutter-active-line {
|
.ace_gutter-active-line {
|
||||||
|
|
@ -83,22 +82,22 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace_gutter-cell.ace_error {
|
.ace_gutter-cell.ace_error {
|
||||||
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QUM2OEZDQTQ4RTU0MTFFMUEzM0VFRTM2RUY1M0RBMjYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QUM2OEZDQTU4RTU0MTFFMUEzM0VFRTM2RUY1M0RBMjYiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpBQzY4RkNBMjhFNTQxMUUxQTMzRUVFMzZFRjUzREEyNiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpBQzY4RkNBMzhFNTQxMUUxQTMzRUVFMzZFRjUzREEyNiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PkgXxbAAAAJbSURBVHjapFNNaBNBFH4zs5vdZLP5sQmNpT82QY209heh1ioWisaDRcSKF0WKJ0GQnrzrxasHsR6EnlrwD0TagxJabaVEpFYxLWlLSS822tr87m66ccfd2GKyVhA6MMybgfe97/vmPUQphd0sZjto9XIn9OOsvlu2nkqRzVU+6vvlzPf8W6bk8dxQ0NPbxAALgCgg2JkaQuhzQau/El0zbmUA7U0Es8v2CiYmKQJHGO1QICCLoqilMhkmurDAyapKgqItezi/USRdJqEYY4D5jCy03ht2yMkkvL91jTTX10qzyyu2hruPRN7jgbH+EOsXcMLgYiThEgAMhABW85oqy1DXdRIdvP1AHJ2acQXvDIrVHcdQNrEKNYSVMSZGMjEzIIAwDXIo+6G/FxcGnzkC3T2oMhLjre49sBB+RRcHLqdafK6sYdE/GGBwU1VpFNj0aN8pJbe+BkZyevUrvLl6Xmm0W9IuTc0DxrDNAJd5oEvI/KRsNC3bQyNjPO9yQ1YHcfj2QvfQc/5TUhJTBc2iM0U7AWDQtc1nJHvD/cfO2s7jaGkiTEfa/Ep8coLu7zmNmh8+dc5lZDuUeFAGUNA/OY6JVaypQ0vjr7XYjUvJM37vt+j1vuTK5DgVfVUoTjVe+y3/LxMxY2GgU+CSLy4cpfsYorRXuXIOi0Vt40h67uZFTdIo6nLaZcwUJWAzwNS0tBnqqKzQDnjdG/iPyZxo46HaKUpbvYkj8qYRTZsBhge+JHhZyh0x9b95JqjVJkT084kZIPwu/mPWqPgfQ5jXh2+92Ay7HedfAgwA6KDWafb4w3cAAAAASUVORK5CYII=");
|
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-position: 2px center;
|
background-position: 2px center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace_gutter-cell.ace_warning {
|
.ace_gutter-cell.ace_warning {
|
||||||
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QUM2OEZDQTg4RTU0MTFFMUEzM0VFRTM2RUY1M0RBMjYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QUM2OEZDQTk4RTU0MTFFMUEzM0VFRTM2RUY1M0RBMjYiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpBQzY4RkNBNjhFNTQxMUUxQTMzRUVFMzZFRjUzREEyNiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpBQzY4RkNBNzhFNTQxMUUxQTMzRUVFMzZFRjUzREEyNiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pgd7PfIAAAGmSURBVHjaYvr//z8DJZiJgUIANoCRkREb9gLiSVAaQx4OQM7AAkwd7XU2/v++/rOttdYGEB9dASEvOMydGKfH8Gv/p4XTkvRBfLxeQAP+1cUhXopyvzhP7P/IoSj7g7Mw09cNKO6J1QQ0L4gICPIv/veg/8W+JdFvQNLHVsW9/nmn9zk7B+cCkDwhL7gt6knSZnx9/LuCEOcvkIAMP+cvto9nfqyZmmUAksfnBUtbM60gX/3/kgyv3/xSFOL5DZT+L8vP+Yfh5cvfPvp/xUHyQHXGyAYwgpwBjZYFT3Y1OEl/OfCH4ffv3wzc4iwMvNIsDJ+f/mH4+vIPAxsb631WW0Yln6ZpQLXdMK/DXGDflh+sIv37EivD5x//Gb7+YWT4y86sl7BCCkSD+Z++/1dkvsFRl+HnD1Rvje4F8whjMXmGj58YGf5zsDMwcnAwfPvKcml62DsQDeaDxN+/Y0qwlpEHqrdB94IRNIDUgfgfKJChGK4OikEW3gTiXUB950ASLFAF54AC94A0G9QAfOnmF9DCDzABFqS08IHYDIScdijOjQABBgC+/9awBH96jwAAAABJRU5ErkJggg==");
|
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");
|
||||||
background-position: 2px center;
|
background-position: 2px center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace_gutter-cell.ace_info {
|
.ace_gutter-cell.ace_info {
|
||||||
background-image: url("data:image/gif;base64,R0lGODlhEAAQAMQAAAAAAEFBQVJSUl5eXmRkZGtra39/f4WFhYmJiZGRkaampry8vMPDw8zMzNXV1dzc3OTk5Orq6vDw8P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABQALAAAAAAQABAAAAUuICWOZGmeaBml5XGwFCQSBGyXRSAwtqQIiRuiwIM5BoYVbEFIyGCQoeJGrVptIQA7");
|
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");
|
||||||
background-position: 2px center;
|
background-position: 2px center;
|
||||||
}
|
}
|
||||||
.ace_dark .ace_gutter-cell.ace_info {
|
.ace_dark .ace_gutter-cell.ace_info {
|
||||||
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpGRTk5MTVGREIxNDkxMUUxOTc5Q0FFREQyMTNGMjBFQyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpGRTk5MTVGRUIxNDkxMUUxOTc5Q0FFREQyMTNGMjBFQyI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkZFOTkxNUZCQjE0OTExRTE5NzlDQUVERDIxM0YyMEVDIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkZFOTkxNUZDQjE0OTExRTE5NzlDQUVERDIxM0YyMEVDIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+SIDkjAAAAJ1JREFUeNpi/P//PwMlgImBQkB7A6qrq/+DMC55FkIGKCoq4pVnpFkgTp069f/+/fv/r1u37r+tre1/kg0A+ptn9uzZYLaRkRHpLvjw4cNXWVlZhufPnzOcO3eOdAO0tbVPAjHDmzdvGA4fPsxIsgGSkpJmv379Ynj37h2DjIyMCMkG3LhxQ/T27dsMampqDHZ2dq/pH41DxwCAAAMAFdc68dUsFZgAAAAASUVORK5CYII=");
|
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace_scrollbar {
|
.ace_scrollbar {
|
||||||
|
|
@ -228,10 +227,6 @@
|
||||||
transition: opacity 0.18s;
|
transition: opacity 0.18s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace_cursor[style*="opacity: 0"]{
|
|
||||||
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
|
|
||||||
}
|
|
||||||
|
|
||||||
.ace_editor.ace_multiselect .ace_cursor {
|
.ace_editor.ace_multiselect .ace_cursor {
|
||||||
border-left-width: 1px;
|
border-left-width: 1px;
|
||||||
}
|
}
|
||||||
|
|
@ -275,8 +270,8 @@
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
|
|
||||||
background-image:
|
background-image:
|
||||||
url("data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%11%00%00%00%09%08%06%00%00%00%D4%E8%C7%0C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%8Dm%9A%19N%D1%7C%8A%DE%1F9%7Dp%8C%E6%00%D5%C1%3F_%18%BDA%B8%9DpX6%E3%A35~B%CD%24%AE%11%26%BD%E7%EEti%98%EDe%9A%97Y)%12%25%1C%24%BCbT%AE3li%E6%0B%03%89%9A%E6%D3%ED%F4P%92%B0%9F4%BF43Y%F3%E3%EDP%95%04%EB1%C5%F5%F6KF%F4%BA%BD%D7%DB%91%93%07%E35%3E%A7)%D6%7F%40%FE%BD%F7%F5r%8A%E5y%92%F0%EB%B4%1E%8D%D5%F4%5B%92%3AV%DB%DB%E4%CD%A6%23%C3%C4wQ%3F%03HB%82%8E%1Cd(%E0%91B%0Ca%9Ac%C4%AA%F8L%16%19%22J%A4%D2itTy%B28%D6%3B(%93%96%ED%1CGx%C9_%0E%B8%5E%16%F5%5B%B2%B8%F6%E0%FB%9E%DD%25%D7%8E%BC%15%85%C5%B7%A3%D8Q%ED%B5%81%E9%BA%B2%13%9A%1B%7Fua%A5%A3n%E17%B9%E5%9B%1Bm%AB%0B%08Q%FE%8A%E5%B1H%5Ee%CAO%82Q%D7u6%E6%90S%97%FCu%0B%CF2%94%EE%25v%12X%0C%BA%AC%F0%5E%F8*l%0AO%85%17%C2%97%BF%D4%C8%CE%DE%AD%11%CB%80q%2C%3E%AB%9ES%CD%C6%EC%25%D2L%D2%EBd%B8%BF%8A%F5B%C6%18%F9%901CZ%9D%BE%24M%9C%8A9%F2%DAP%0B'%06w%82%EB%E6%E2%5C%2F%D7%07%9E%BB%CC%5D%E1%FA%B9%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%00%B5IDAT(%15%A5%91%3D%0E%02!%10%85ac%E1%05%D6%CE%D6%C6%CE%D2%E8%ED%CD%DE%C0%C6%D6N.%E0V%F8%3D%9Ca%891XH%C2%BE%D9y%3F%90!%E6%9C%C3%BFk%E5%011%C6-%F5%C8N%04%DF%BD%FF%89%DFt%83DN%60%3E%F3%AB%A0%DE%1A%5Dg%BE%10Q%97%1B%40%9C%A8o%10%8F%5E%828%B4%1B%60%87%F6%02%26%85%1Ch%1E%C1%2B%5Bk%FF%86%EE%B7j%09%9A%DA%9B%ACe%A3%F9%EC%DA!9%B4%D5%A6%81%86%86%98%CC%3C%5B%40%FA%81%B3%E9%CB%23%94%C16Azo%05%D4%E1%C1%95a%3B%8A'%A0%E8%CC%17%22%85%1D%BA%00%A2%FA%DC%0A%94%D1%D1%8D%8B%3A%84%17B%C7%60%1A%25Z%FC%8D%00%00%00%00IEND%AEB%60%82"),
|
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),
|
||||||
url("data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%007%08%06%00%00%00%C4%DD%80C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%8Dm%9A%19N%D1%7C%8A%DE%1F9%7Dp%8C%E6%00%D5%C1%3F_%18%BDA%B8%9DpX6%E3%A35~B%CD%24%AE%11%26%BD%E7%EEti%98%EDe%9A%97Y)%12%25%1C%24%BCbT%AE3li%E6%0B%03%89%9A%E6%D3%ED%F4P%92%B0%9F4%BF43Y%F3%E3%EDP%95%04%EB1%C5%F5%F6KF%F4%BA%BD%D7%DB%91%93%07%E35%3E%A7)%D6%7F%40%FE%BD%F7%F5r%8A%E5y%92%F0%EB%B4%1E%8D%D5%F4%5B%92%3AV%DB%DB%E4%CD%A6%23%C3%C4wQ%3F%03HB%82%8E%1Cd(%E0%91B%0Ca%9Ac%C4%AA%F8L%16%19%22J%A4%D2itTy%B28%D6%3B(%93%96%ED%1CGx%C9_%0E%B8%5E%16%F5%5B%B2%B8%F6%E0%FB%9E%DD%25%D7%8E%BC%15%85%C5%B7%A3%D8Q%ED%B5%81%E9%BA%B2%13%9A%1B%7Fua%A5%A3n%E17%B9%E5%9B%1Bm%AB%0B%08Q%FE%8A%E5%B1H%5Ee%CAO%82Q%D7u6%E6%90S%97%FCu%0B%CF2%94%EE%25v%12X%0C%BA%AC%F0%5E%F8*l%0AO%85%17%C2%97%BF%D4%C8%CE%DE%AD%11%CB%80q%2C%3E%AB%9ES%CD%C6%EC%25%D2L%D2%EBd%B8%BF%8A%F5B%C6%18%F9%901CZ%9D%BE%24M%9C%8A9%F2%DAP%0B'%06w%82%EB%E6%E2%5C%2F%D7%07%9E%BB%CC%5D%E1%FA%B9%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%00%3AIDAT8%11c%FC%FF%FF%7F%18%03%1A%60%01%F2%3F%A0%891%80%04%FF%11-%F8%17%9BJ%E2%05%B1ZD%81v%26t%E7%80%F8%A3%82h%A12%1A%20%A3%01%02%0F%01%BA%25%06%00%19%C0%0D%AEF%D5%3ES%00%00%00%00IEND%AEB%60%82");
|
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");
|
||||||
background-repeat: no-repeat, repeat-x;
|
background-repeat: no-repeat, repeat-x;
|
||||||
background-position: center center, top left;
|
background-position: center center, top left;
|
||||||
color: transparent;
|
color: transparent;
|
||||||
|
|
@ -295,10 +290,8 @@
|
||||||
|
|
||||||
.ace_fold:hover{
|
.ace_fold:hover{
|
||||||
background-image:
|
background-image:
|
||||||
url("data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%11%00%00%00%09%08%06%00%00%00%D4%E8%C7%0C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%8Dm%9A%19N%D1%7C%8A%DE%1F9%7Dp%8C%E6%00%D5%C1%3F_%18%BDA%B8%9DpX6%E3%A35~B%CD%24%AE%11%26%BD%E7%EEti%98%EDe%9A%97Y)%12%25%1C%24%BCbT%AE3li%E6%0B%03%89%9A%E6%D3%ED%F4P%92%B0%9F4%BF43Y%F3%E3%EDP%95%04%EB1%C5%F5%F6KF%F4%BA%BD%D7%DB%91%93%07%E35%3E%A7)%D6%7F%40%FE%BD%F7%F5r%8A%E5y%92%F0%EB%B4%1E%8D%D5%F4%5B%92%3AV%DB%DB%E4%CD%A6%23%C3%C4wQ%3F%03HB%82%8E%1Cd(%E0%91B%0Ca%9Ac%C4%AA%F8L%16%19%22J%A4%D2itTy%B28%D6%3B(%93%96%ED%1CGx%C9_%0E%B8%5E%16%F5%5B%B2%B8%F6%E0%FB%9E%DD%25%D7%8E%BC%15%85%C5%B7%A3%D8Q%ED%B5%81%E9%BA%B2%13%9A%1B%7Fua%A5%A3n%E17%B9%E5%9B%1Bm%AB%0B%08Q%FE%8A%E5%B1H%5Ee%CAO%82Q%D7u6%E6%90S%97%FCu%0B%CF2%94%EE%25v%12X%0C%BA%AC%F0%5E%F8*l%0AO%85%17%C2%97%BF%D4%C8%CE%DE%AD%11%CB%80q%2C%3E%AB%9ES%CD%C6%EC%25%D2L%D2%EBd%B8%BF%8A%F5B%C6%18%F9%901CZ%9D%BE%24M%9C%8A9%F2%DAP%0B'%06w%82%EB%E6%E2%5C%2F%D7%07%9E%BB%CC%5D%E1%FA%B9%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%00%B5IDAT(%15%A5%91%3D%0E%02!%10%85ac%E1%05%D6%CE%D6%C6%CE%D2%E8%ED%CD%DE%C0%C6%D6N.%E0V%F8%3D%9Ca%891XH%C2%BE%D9y%3F%90!%E6%9C%C3%BFk%E5%011%C6-%F5%C8N%04%DF%BD%FF%89%DFt%83DN%60%3E%F3%AB%A0%DE%1A%5Dg%BE%10Q%97%1B%40%9C%A8o%10%8F%5E%828%B4%1B%60%87%F6%02%26%85%1Ch%1E%C1%2B%5Bk%FF%86%EE%B7j%09%9A%DA%9B%ACe%A3%F9%EC%DA!9%B4%D5%A6%81%86%86%98%CC%3C%5B%40%FA%81%B3%E9%CB%23%94%C16Azo%05%D4%E1%C1%95a%3B%8A'%A0%E8%CC%17%22%85%1D%BA%00%A2%FA%DC%0A%94%D1%D1%8D%8B%3A%84%17B%C7%60%1A%25Z%FC%8D%00%00%00%00IEND%AEB%60%82"),
|
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),
|
||||||
url("data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%007%08%06%00%00%00%C4%DD%80C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%8Dm%9A%19N%D1%7C%8A%DE%1F9%7Dp%8C%E6%00%D5%C1%3F_%18%BDA%B8%9DpX6%E3%A35~B%CD%24%AE%11%26%BD%E7%EEti%98%EDe%9A%97Y)%12%25%1C%24%BCbT%AE3li%E6%0B%03%89%9A%E6%D3%ED%F4P%92%B0%9F4%BF43Y%F3%E3%EDP%95%04%EB1%C5%F5%F6KF%F4%BA%BD%D7%DB%91%93%07%E35%3E%A7)%D6%7F%40%FE%BD%F7%F5r%8A%E5y%92%F0%EB%B4%1E%8D%D5%F4%5B%92%3AV%DB%DB%E4%CD%A6%23%C3%C4wQ%3F%03HB%82%8E%1Cd(%E0%91B%0Ca%9Ac%C4%AA%F8L%16%19%22J%A4%D2itTy%B28%D6%3B(%93%96%ED%1CGx%C9_%0E%B8%5E%16%F5%5B%B2%B8%F6%E0%FB%9E%DD%25%D7%8E%BC%15%85%C5%B7%A3%D8Q%ED%B5%81%E9%BA%B2%13%9A%1B%7Fua%A5%A3n%E17%B9%E5%9B%1Bm%AB%0B%08Q%FE%8A%E5%B1H%5Ee%CAO%82Q%D7u6%E6%90S%97%FCu%0B%CF2%94%EE%25v%12X%0C%BA%AC%F0%5E%F8*l%0AO%85%17%C2%97%BF%D4%C8%CE%DE%AD%11%CB%80q%2C%3E%AB%9ES%CD%C6%EC%25%D2L%D2%EBd%B8%BF%8A%F5B%C6%18%F9%901CZ%9D%BE%24M%9C%8A9%F2%DAP%0B'%06w%82%EB%E6%E2%5C%2F%D7%07%9E%BB%CC%5D%E1%FA%B9%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%003IDAT8%11c%FC%FF%FF%7F%3E%03%1A%60%01%F2%3F%A3%891%80%04%FFQ%26%F8w%C0%B43%A1%DB%0C%E2%8F%0A%A2%85%CAh%80%8C%06%08%3C%04%E8%96%18%00%A3S%0D%CD%CF%D8%C1%9D%00%00%00%00IEND%AEB%60%82");
|
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");
|
||||||
background-repeat: no-repeat, repeat-x;
|
|
||||||
background-position: center center, top left;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace_tooltip {
|
.ace_tooltip {
|
||||||
|
|
@ -341,7 +334,7 @@
|
||||||
width: 11px;
|
width: 11px;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
|
|
||||||
background-image: url("data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%00%05%08%06%00%00%00%8Do%26%E5%00%00%004IDATx%DAe%8A%B1%0D%000%0C%C2%F2%2CK%96%BC%D0%8F9%81%88H%E9%D0%0E%96%C0%10%92%3E%02%80%5E%82%E4%A9*-%EEsw%C8%CC%11%EE%96w%D8%DC%E9*Eh%0C%151(%00%00%00%00IEND%AEB%60%82");
|
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
|
|
||||||
|
|
@ -356,11 +349,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace_fold-widget.ace_end {
|
.ace_fold-widget.ace_end {
|
||||||
background-image: url("data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%00%05%08%06%00%00%00%8Do%26%E5%00%00%004IDATx%DAm%C7%C1%09%000%08C%D1%8C%ECE%C8E(%8E%EC%02)%1EZJ%F1%C1'%04%07I%E1%E5%EE%CAL%F5%A2%99%99%22%E2%D6%1FU%B5%FE0%D9x%A7%26Wz5%0E%D5%00%00%00%00IEND%AEB%60%82");
|
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace_fold-widget.ace_closed {
|
.ace_fold-widget.ace_closed {
|
||||||
background-image: url("data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%03%00%00%00%06%08%06%00%00%00%06%E5%24%0C%00%00%009IDATx%DA5%CA%C1%09%000%08%03%C0%AC*(%3E%04%C1%0D%BA%B1%23%A4Uh%E0%20%81%C0%CC%F8%82%81%AA%A2%AArGfr%88%08%11%11%1C%DD%7D%E0%EE%5B%F6%F6%CB%B8%05Q%2F%E9tai%D9%00%00%00%00IEND%AEB%60%82");
|
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace_fold-widget:hover {
|
.ace_fold-widget:hover {
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,7 @@ var EditSession = function(text, mode) {
|
||||||
|
|
||||||
config.resetOptions(this);
|
config.resetOptions(this);
|
||||||
this.setMode(mode);
|
this.setMode(mode);
|
||||||
config._emit("session", this);
|
config._signal("session", this);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -269,7 +269,7 @@ var EditSession = function(text, mode) {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.bgTokenizer.$updateOnChange(delta);
|
this.bgTokenizer.$updateOnChange(delta);
|
||||||
this._emit("change", e);
|
this._signal("change", e);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -528,7 +528,7 @@ var EditSession = function(text, mode) {
|
||||||
if (!this.$decorations[row])
|
if (!this.$decorations[row])
|
||||||
this.$decorations[row] = "";
|
this.$decorations[row] = "";
|
||||||
this.$decorations[row] += " " + className;
|
this.$decorations[row] += " " + className;
|
||||||
this._emit("changeBreakpoint", {});
|
this._signal("changeBreakpoint", {});
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -540,7 +540,7 @@ var EditSession = function(text, mode) {
|
||||||
**/
|
**/
|
||||||
this.removeGutterDecoration = function(row, className) {
|
this.removeGutterDecoration = function(row, className) {
|
||||||
this.$decorations[row] = (this.$decorations[row] || "").replace(" " + className, "");
|
this.$decorations[row] = (this.$decorations[row] || "").replace(" " + className, "");
|
||||||
this._emit("changeBreakpoint", {});
|
this._signal("changeBreakpoint", {});
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -563,7 +563,7 @@ var EditSession = function(text, mode) {
|
||||||
for (var i=0; i<rows.length; i++) {
|
for (var i=0; i<rows.length; i++) {
|
||||||
this.$breakpoints[rows[i]] = "ace_breakpoint";
|
this.$breakpoints[rows[i]] = "ace_breakpoint";
|
||||||
}
|
}
|
||||||
this._emit("changeBreakpoint", {});
|
this._signal("changeBreakpoint", {});
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -571,7 +571,7 @@ var EditSession = function(text, mode) {
|
||||||
**/
|
**/
|
||||||
this.clearBreakpoints = function() {
|
this.clearBreakpoints = function() {
|
||||||
this.$breakpoints = [];
|
this.$breakpoints = [];
|
||||||
this._emit("changeBreakpoint", {});
|
this._signal("changeBreakpoint", {});
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -588,7 +588,7 @@ var EditSession = function(text, mode) {
|
||||||
this.$breakpoints[row] = className;
|
this.$breakpoints[row] = className;
|
||||||
else
|
else
|
||||||
delete this.$breakpoints[row];
|
delete this.$breakpoints[row];
|
||||||
this._emit("changeBreakpoint", {});
|
this._signal("changeBreakpoint", {});
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -599,7 +599,7 @@ var EditSession = function(text, mode) {
|
||||||
**/
|
**/
|
||||||
this.clearBreakpoint = function(row) {
|
this.clearBreakpoint = function(row) {
|
||||||
delete this.$breakpoints[row];
|
delete this.$breakpoints[row];
|
||||||
this._emit("changeBreakpoint", {});
|
this._signal("changeBreakpoint", {});
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -626,10 +626,10 @@ var EditSession = function(text, mode) {
|
||||||
|
|
||||||
if (inFront) {
|
if (inFront) {
|
||||||
this.$frontMarkers[id] = marker;
|
this.$frontMarkers[id] = marker;
|
||||||
this._emit("changeFrontMarker")
|
this._signal("changeFrontMarker")
|
||||||
} else {
|
} else {
|
||||||
this.$backMarkers[id] = marker;
|
this.$backMarkers[id] = marker;
|
||||||
this._emit("changeBackMarker")
|
this._signal("changeBackMarker")
|
||||||
}
|
}
|
||||||
|
|
||||||
return id;
|
return id;
|
||||||
|
|
@ -652,10 +652,10 @@ var EditSession = function(text, mode) {
|
||||||
|
|
||||||
if (inFront) {
|
if (inFront) {
|
||||||
this.$frontMarkers[id] = marker;
|
this.$frontMarkers[id] = marker;
|
||||||
this._emit("changeFrontMarker")
|
this._signal("changeFrontMarker")
|
||||||
} else {
|
} else {
|
||||||
this.$backMarkers[id] = marker;
|
this.$backMarkers[id] = marker;
|
||||||
this._emit("changeBackMarker")
|
this._signal("changeBackMarker")
|
||||||
}
|
}
|
||||||
|
|
||||||
return marker;
|
return marker;
|
||||||
|
|
@ -676,7 +676,7 @@ var EditSession = function(text, mode) {
|
||||||
var markers = marker.inFront ? this.$frontMarkers : this.$backMarkers;
|
var markers = marker.inFront ? this.$frontMarkers : this.$backMarkers;
|
||||||
if (marker) {
|
if (marker) {
|
||||||
delete (markers[markerId]);
|
delete (markers[markerId]);
|
||||||
this._emit(marker.inFront ? "changeFrontMarker" : "changeBackMarker");
|
this._signal(marker.inFront ? "changeFrontMarker" : "changeBackMarker");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -728,7 +728,7 @@ var EditSession = function(text, mode) {
|
||||||
**/
|
**/
|
||||||
this.setAnnotations = function(annotations) {
|
this.setAnnotations = function(annotations) {
|
||||||
this.$annotations = annotations;
|
this.$annotations = annotations;
|
||||||
this._emit("changeAnnotation", {});
|
this._signal("changeAnnotation", {});
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -858,7 +858,7 @@ var EditSession = function(text, mode) {
|
||||||
this.onReloadTokenizer = function(e) {
|
this.onReloadTokenizer = function(e) {
|
||||||
var rows = e.data;
|
var rows = e.data;
|
||||||
this.bgTokenizer.start(rows.first);
|
this.bgTokenizer.start(rows.first);
|
||||||
this._emit("tokenizerUpdate", e);
|
this._signal("tokenizerUpdate", e);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$modes = {};
|
this.$modes = {};
|
||||||
|
|
@ -937,7 +937,7 @@ var EditSession = function(text, mode) {
|
||||||
this.bgTokenizer = new BackgroundTokenizer(tokenizer);
|
this.bgTokenizer = new BackgroundTokenizer(tokenizer);
|
||||||
var _self = this;
|
var _self = this;
|
||||||
this.bgTokenizer.addEventListener("update", function(e) {
|
this.bgTokenizer.addEventListener("update", function(e) {
|
||||||
_self._emit("tokenizerUpdate", e);
|
_self._signal("tokenizerUpdate", e);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.bgTokenizer.setTokenizer(tokenizer);
|
this.bgTokenizer.setTokenizer(tokenizer);
|
||||||
|
|
@ -1570,7 +1570,7 @@ var EditSession = function(text, mode) {
|
||||||
this.$updateWrapData(0, len - 1);
|
this.$updateWrapData(0, len - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
this._emit("changeWrapMode");
|
this._signal("changeWrapMode");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -1601,7 +1601,7 @@ var EditSession = function(text, mode) {
|
||||||
};
|
};
|
||||||
this.$modified = true;
|
this.$modified = true;
|
||||||
// This will force a recalculation of the wrap limit
|
// This will force a recalculation of the wrap limit
|
||||||
this._emit("changeWrapMode");
|
this._signal("changeWrapMode");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -1623,7 +1623,7 @@ var EditSession = function(text, mode) {
|
||||||
if (this.$useWrapMode) {
|
if (this.$useWrapMode) {
|
||||||
this.$updateWrapData(0, this.getLength() - 1);
|
this.$updateWrapData(0, this.getLength() - 1);
|
||||||
this.$resetRowCache(0);
|
this.$resetRowCache(0);
|
||||||
this._emit("changeWrapLimit");
|
this._signal("changeWrapLimit");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -2503,7 +2503,7 @@ config.defineOptions(EditSession.prototype, "session", {
|
||||||
initialValue: "auto"
|
initialValue: "auto"
|
||||||
},
|
},
|
||||||
firstLineNumber: {
|
firstLineNumber: {
|
||||||
set: function() {this._emit("changeBreakpoint");},
|
set: function() {this._signal("changeBreakpoint");},
|
||||||
initialValue: 1
|
initialValue: 1
|
||||||
},
|
},
|
||||||
useWorker: {
|
useWorker: {
|
||||||
|
|
@ -2524,13 +2524,13 @@ config.defineOptions(EditSession.prototype, "session", {
|
||||||
this.$modified = true;
|
this.$modified = true;
|
||||||
this.$rowLengthCache = [];
|
this.$rowLengthCache = [];
|
||||||
this.$tabSize = tabSize;
|
this.$tabSize = tabSize;
|
||||||
this._emit("changeTabSize");
|
this._signal("changeTabSize");
|
||||||
},
|
},
|
||||||
initialValue: 4,
|
initialValue: 4,
|
||||||
handlesSet: true
|
handlesSet: true
|
||||||
},
|
},
|
||||||
overwrite: {
|
overwrite: {
|
||||||
set: function(val) {this._emit("changeOverwrite");},
|
set: function(val) {this._signal("changeOverwrite");},
|
||||||
initialValue: false
|
initialValue: false
|
||||||
},
|
},
|
||||||
newLineMode: {
|
newLineMode: {
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,7 @@ var Editor = function(renderer, session) {
|
||||||
|
|
||||||
this.setSession(session || new EditSession(""));
|
this.setSession(session || new EditSession(""));
|
||||||
config.resetOptions(this);
|
config.resetOptions(this);
|
||||||
config._emit("editor", this);
|
config._signal("editor", this);
|
||||||
};
|
};
|
||||||
|
|
||||||
(function(){
|
(function(){
|
||||||
|
|
@ -384,7 +384,7 @@ var Editor = function(renderer, session) {
|
||||||
this.session.getUseWrapMode() && this.renderer.adjustWrapLimit();
|
this.session.getUseWrapMode() && this.renderer.adjustWrapLimit();
|
||||||
this.renderer.updateFull();
|
this.renderer.updateFull();
|
||||||
|
|
||||||
this._emit("changeSession", {
|
this._signal("changeSession", {
|
||||||
session: session,
|
session: session,
|
||||||
oldSession: oldSession
|
oldSession: oldSession
|
||||||
});
|
});
|
||||||
|
|
@ -612,7 +612,7 @@ var Editor = function(renderer, session) {
|
||||||
var range = e.data.range;
|
var range = e.data.range;
|
||||||
var lastRow = (range.start.row == range.end.row ? range.end.row : Infinity);
|
var lastRow = (range.start.row == range.end.row ? range.end.row : Infinity);
|
||||||
this.renderer.updateLines(range.start.row, lastRow);
|
this.renderer.updateLines(range.start.row, lastRow);
|
||||||
this._emit("change", e);
|
this._signal("change", e);
|
||||||
|
|
||||||
// Update cursor because tab characters can influence the cursor position.
|
// Update cursor because tab characters can influence the cursor position.
|
||||||
this.$cursorChange();
|
this.$cursorChange();
|
||||||
|
|
@ -645,7 +645,7 @@ var Editor = function(renderer, session) {
|
||||||
|
|
||||||
this.$highlightBrackets();
|
this.$highlightBrackets();
|
||||||
this.$updateHighlightActiveLine();
|
this.$updateHighlightActiveLine();
|
||||||
this._emit("changeSelection");
|
this._signal("changeSelection");
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$updateHighlightActiveLine = function() {
|
this.$updateHighlightActiveLine = function() {
|
||||||
|
|
@ -670,7 +670,7 @@ var Editor = function(renderer, session) {
|
||||||
session.$highlightLineMarker.start.row = highlight.row;
|
session.$highlightLineMarker.start.row = highlight.row;
|
||||||
session.$highlightLineMarker.end.row = highlight.row;
|
session.$highlightLineMarker.end.row = highlight.row;
|
||||||
session.$highlightLineMarker.start.column = highlight.column;
|
session.$highlightLineMarker.start.column = highlight.column;
|
||||||
session._emit("changeBackMarker");
|
session._signal("changeBackMarker");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -693,7 +693,7 @@ var Editor = function(renderer, session) {
|
||||||
var re = this.$highlightSelectedWord && this.$getSelectionHighLightRegexp();
|
var re = this.$highlightSelectedWord && this.$getSelectionHighLightRegexp();
|
||||||
this.session.highlight(re);
|
this.session.highlight(re);
|
||||||
|
|
||||||
this._emit("changeSelection");
|
this._signal("changeSelection");
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$getSelectionHighLightRegexp = function() {
|
this.$getSelectionHighLightRegexp = function() {
|
||||||
|
|
@ -827,8 +827,9 @@ var Editor = function(renderer, session) {
|
||||||
// todo this should change when paste becomes a command
|
// todo this should change when paste becomes a command
|
||||||
if (this.$readOnly)
|
if (this.$readOnly)
|
||||||
return;
|
return;
|
||||||
this._emit("paste", text);
|
var e = {text: text};
|
||||||
this.insert(text);
|
this._signal("paste", e);
|
||||||
|
this.insert(e.text, true);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1024,6 +1025,7 @@ var Editor = function(renderer, session) {
|
||||||
this.getHighlightGutterLine = function() {
|
this.getHighlightGutterLine = function() {
|
||||||
return this.getOption("highlightGutterLine");
|
return this.getOption("highlightGutterLine");
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines if the currently selected word should be highlighted.
|
* Determines if the currently selected word should be highlighted.
|
||||||
* @param {Boolean} shouldHighlight Set to `true` to highlight the currently selected word
|
* @param {Boolean} shouldHighlight Set to `true` to highlight the currently selected word
|
||||||
|
|
@ -2287,7 +2289,7 @@ var Editor = function(renderer, session) {
|
||||||
**/
|
**/
|
||||||
this.destroy = function() {
|
this.destroy = function() {
|
||||||
this.renderer.destroy();
|
this.renderer.destroy();
|
||||||
this._emit("destroy", this);
|
this._signal("destroy", this);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -2295,7 +2297,7 @@ var Editor = function(renderer, session) {
|
||||||
* @param {Boolean} enable default true
|
* @param {Boolean} enable default true
|
||||||
**/
|
**/
|
||||||
this.setAutoScrollEditorIntoView = function(enable) {
|
this.setAutoScrollEditorIntoView = function(enable) {
|
||||||
if (enable === false)
|
if (!enable)
|
||||||
return;
|
return;
|
||||||
var rect;
|
var rect;
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
@ -2337,7 +2339,7 @@ var Editor = function(renderer, session) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.setAutoScrollEditorIntoView = function(enable) {
|
this.setAutoScrollEditorIntoView = function(enable) {
|
||||||
if (enable === true)
|
if (enable)
|
||||||
return;
|
return;
|
||||||
delete this.setAutoScrollEditorIntoView;
|
delete this.setAutoScrollEditorIntoView;
|
||||||
this.removeEventListener("changeSelection", onChangeSelection);
|
this.removeEventListener("changeSelection", onChangeSelection);
|
||||||
|
|
@ -2364,7 +2366,7 @@ config.defineOptions(Editor.prototype, "editor", {
|
||||||
selectionStyle: {
|
selectionStyle: {
|
||||||
set: function(style) {
|
set: function(style) {
|
||||||
this.onSelectionChange();
|
this.onSelectionChange();
|
||||||
this._emit("changeSelectionStyle", {data: style});
|
this._signal("changeSelectionStyle", {data: style});
|
||||||
},
|
},
|
||||||
initialValue: "line"
|
initialValue: "line"
|
||||||
},
|
},
|
||||||
|
|
@ -2394,6 +2396,9 @@ config.defineOptions(Editor.prototype, "editor", {
|
||||||
},
|
},
|
||||||
behavioursEnabled: {initialValue: true},
|
behavioursEnabled: {initialValue: true},
|
||||||
wrapBehavioursEnabled: {initialValue: true},
|
wrapBehavioursEnabled: {initialValue: true},
|
||||||
|
autoScrollEditorIntoView: {
|
||||||
|
set: function(val) {this.setAutoScrollEditorIntoView(val)}
|
||||||
|
},
|
||||||
|
|
||||||
hScrollBarAlwaysVisible: "renderer",
|
hScrollBarAlwaysVisible: "renderer",
|
||||||
vScrollBarAlwaysVisible: "renderer",
|
vScrollBarAlwaysVisible: "renderer",
|
||||||
|
|
@ -2405,6 +2410,7 @@ config.defineOptions(Editor.prototype, "editor", {
|
||||||
printMargin: "renderer",
|
printMargin: "renderer",
|
||||||
fadeFoldWidgets: "renderer",
|
fadeFoldWidgets: "renderer",
|
||||||
showFoldWidgets: "renderer",
|
showFoldWidgets: "renderer",
|
||||||
|
showLineNumbers: "renderer",
|
||||||
showGutter: "renderer",
|
showGutter: "renderer",
|
||||||
displayIndentGuides: "renderer",
|
displayIndentGuides: "renderer",
|
||||||
fontSize: "renderer",
|
fontSize: "renderer",
|
||||||
|
|
@ -2419,6 +2425,7 @@ config.defineOptions(Editor.prototype, "editor", {
|
||||||
dragDelay: "$mouseHandler",
|
dragDelay: "$mouseHandler",
|
||||||
dragEnabled: "$mouseHandler",
|
dragEnabled: "$mouseHandler",
|
||||||
focusTimout: "$mouseHandler",
|
focusTimout: "$mouseHandler",
|
||||||
|
tooltipFollowsMouse: "$mouseHandler",
|
||||||
|
|
||||||
firstLineNumber: "session",
|
firstLineNumber: "session",
|
||||||
overwrite: "session",
|
overwrite: "session",
|
||||||
|
|
|
||||||
|
|
@ -108,8 +108,9 @@ exports.showErrorMarker = function(editor, dir) {
|
||||||
var gutterAnno;
|
var gutterAnno;
|
||||||
if (annotations) {
|
if (annotations) {
|
||||||
var annotation = annotations[0];
|
var annotation = annotations[0];
|
||||||
if (annotation.pos && annotation.column == null)
|
pos.column = (annotation.pos && typeof annotation.column != "number"
|
||||||
pos.column = annotation.pos.sc;
|
? annotation.pos.sc
|
||||||
|
: annotation.column) || 0;
|
||||||
pos.row = annotation.row;
|
pos.row = annotation.row;
|
||||||
gutterAnno = editor.renderer.$gutterLayer.$annotations[pos.row];
|
gutterAnno = editor.renderer.$gutterLayer.$annotations[pos.row];
|
||||||
} else if (oldWidget) {
|
} else if (oldWidget) {
|
||||||
|
|
@ -171,6 +172,8 @@ exports.showErrorMarker = function(editor, dir) {
|
||||||
editor.session.widgetManager.addLineWidget(w);
|
editor.session.widgetManager.addLineWidget(w);
|
||||||
|
|
||||||
w.el.onmousedown = editor.focus.bind(editor);
|
w.el.onmousedown = editor.focus.bind(editor);
|
||||||
|
|
||||||
|
editor.renderer.scrollCursorIntoView(null, 0.5, {bottom: w.el.offsetHeight});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,7 @@ var supportedModes = {
|
||||||
BatchFile: ["bat|cmd"],
|
BatchFile: ["bat|cmd"],
|
||||||
C9Search: ["c9search_results"],
|
C9Search: ["c9search_results"],
|
||||||
C_Cpp: ["cpp|c|cc|cxx|h|hh|hpp"],
|
C_Cpp: ["cpp|c|cc|cxx|h|hh|hpp"],
|
||||||
|
Cirru: ["cirru|cr"],
|
||||||
Clojure: ["clj"],
|
Clojure: ["clj"],
|
||||||
Cobol: ["CBL|COB"],
|
Cobol: ["CBL|COB"],
|
||||||
coffee: ["coffee|cf|cson|^Cakefile"],
|
coffee: ["coffee|cf|cson|^Cakefile"],
|
||||||
|
|
@ -122,6 +123,7 @@ var supportedModes = {
|
||||||
SASS: ["sass"],
|
SASS: ["sass"],
|
||||||
SCAD: ["scad"],
|
SCAD: ["scad"],
|
||||||
Scala: ["scala"],
|
Scala: ["scala"],
|
||||||
|
Smarty: ["smarty|tpl"],
|
||||||
Scheme: ["scm|rkt"],
|
Scheme: ["scm|rkt"],
|
||||||
SCSS: ["scss"],
|
SCSS: ["scss"],
|
||||||
SH: ["sh|bash|^.bashrc"],
|
SH: ["sh|bash|^.bashrc"],
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,6 @@
|
||||||
*
|
*
|
||||||
* ***** END LICENSE BLOCK ***** */
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
/*jslint indent: 4, maxerr: 50, white: true, browser: true, vars: true*/
|
|
||||||
/*global define, require */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates a list of themes available when ace was built.
|
* Generates a list of themes available when ace was built.
|
||||||
|
|
@ -77,7 +75,7 @@ var themeData = [
|
||||||
["Tomorrow Night 80s" ,"tomorrow_night_eighties" , "dark"],
|
["Tomorrow Night 80s" ,"tomorrow_night_eighties" , "dark"],
|
||||||
["Twilight" ,"twilight" , "dark"],
|
["Twilight" ,"twilight" , "dark"],
|
||||||
["Vibrant Ink" ,"vibrant_ink" , "dark"]
|
["Vibrant Ink" ,"vibrant_ink" , "dark"]
|
||||||
]
|
];
|
||||||
|
|
||||||
|
|
||||||
exports.themesByName = {};
|
exports.themesByName = {};
|
||||||
|
|
@ -88,10 +86,10 @@ exports.themesByName = {};
|
||||||
exports.themes = themeData.map(function(data) {
|
exports.themes = themeData.map(function(data) {
|
||||||
var name = data[1] || data[0].replace(/ /g, "_").toLowerCase();
|
var name = data[1] || data[0].replace(/ /g, "_").toLowerCase();
|
||||||
var theme = {
|
var theme = {
|
||||||
caption: data[0],
|
caption: data[0],
|
||||||
theme: "ace/theme/" + name,
|
theme: "ace/theme/" + name,
|
||||||
isDark: data[2] == "dark",
|
isDark: data[2] == "dark",
|
||||||
name: name
|
name: name
|
||||||
};
|
};
|
||||||
exports.themesByName[name] = theme;
|
exports.themesByName[name] = theme;
|
||||||
return theme;
|
return theme;
|
||||||
|
|
|
||||||
|
|
@ -61,9 +61,12 @@ exports.$detectIndentation = function(lines, fallback) {
|
||||||
prevSpaces = spaces;
|
prevSpaces = spaces;
|
||||||
|
|
||||||
// ignore lines ending with backslash
|
// ignore lines ending with backslash
|
||||||
while (line[line.length - 1] == "\\")
|
while (i < max && line[line.length - 1] == "\\")
|
||||||
line = lines[i++];
|
line = lines[i++];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!stats.length)
|
||||||
|
return;
|
||||||
|
|
||||||
function getScore(indent) {
|
function getScore(indent) {
|
||||||
var score = 0;
|
var score = 0;
|
||||||
|
|
|
||||||
|
|
@ -100,30 +100,30 @@ exports.handler.attach = function(editor) {
|
||||||
|
|
||||||
editor.emacsMark = function() {
|
editor.emacsMark = function() {
|
||||||
return this.session.$emacsMark;
|
return this.session.$emacsMark;
|
||||||
}
|
};
|
||||||
|
|
||||||
editor.setEmacsMark = function(p) {
|
editor.setEmacsMark = function(p) {
|
||||||
// to deactivate pass in a falsy value
|
// to deactivate pass in a falsy value
|
||||||
this.session.$emacsMark = p;
|
this.session.$emacsMark = p;
|
||||||
}
|
};
|
||||||
|
|
||||||
editor.pushEmacsMark = function(p, activate) {
|
editor.pushEmacsMark = function(p, activate) {
|
||||||
var prevMark = this.session.$emacsMark;
|
var prevMark = this.session.$emacsMark;
|
||||||
if (prevMark)
|
if (prevMark)
|
||||||
this.session.$emacsMarkRing.push(prevMark);
|
this.session.$emacsMarkRing.push(prevMark);
|
||||||
if (!p || activate) this.setEmacsMark(p)
|
if (!p || activate) this.setEmacsMark(p);
|
||||||
else this.session.$emacsMarkRing.push(p);
|
else this.session.$emacsMarkRing.push(p);
|
||||||
}
|
};
|
||||||
|
|
||||||
editor.popEmacsMark = function() {
|
editor.popEmacsMark = function() {
|
||||||
var mark = this.emacsMark();
|
var mark = this.emacsMark();
|
||||||
if (mark) { this.setEmacsMark(null); return mark; }
|
if (mark) { this.setEmacsMark(null); return mark; }
|
||||||
return this.session.$emacsMarkRing.pop();
|
return this.session.$emacsMarkRing.pop();
|
||||||
}
|
};
|
||||||
|
|
||||||
editor.getLastEmacsMark = function(p) {
|
editor.getLastEmacsMark = function(p) {
|
||||||
return this.session.$emacsMark || this.session.$emacsMarkRing.slice(-1)[0];
|
return this.session.$emacsMark || this.session.$emacsMarkRing.slice(-1)[0];
|
||||||
}
|
};
|
||||||
|
|
||||||
editor.on("click", $resetMarkMode);
|
editor.on("click", $resetMarkMode);
|
||||||
editor.on("changeSession", $kbSessionChange);
|
editor.on("changeSession", $kbSessionChange);
|
||||||
|
|
@ -163,15 +163,15 @@ var $kbSessionChange = function(e) {
|
||||||
e.session.$emacsMark = null;
|
e.session.$emacsMark = null;
|
||||||
if (!e.session.hasOwnProperty('$emacsMarkRing'))
|
if (!e.session.hasOwnProperty('$emacsMarkRing'))
|
||||||
e.session.$emacsMarkRing = [];
|
e.session.$emacsMarkRing = [];
|
||||||
}
|
};
|
||||||
|
|
||||||
var $resetMarkMode = function(e) {
|
var $resetMarkMode = function(e) {
|
||||||
e.editor.session.$emacsMark = null;
|
e.editor.session.$emacsMark = null;
|
||||||
}
|
};
|
||||||
|
|
||||||
var keys = require("../lib/keys").KEY_MODS,
|
var keys = require("../lib/keys").KEY_MODS;
|
||||||
eMods = {C: "ctrl", S: "shift", M: "alt", CMD: "command"},
|
var eMods = {C: "ctrl", S: "shift", M: "alt", CMD: "command"};
|
||||||
combinations = ["C-S-M-CMD",
|
var combinations = ["C-S-M-CMD",
|
||||||
"S-M-CMD", "C-M-CMD", "C-S-CMD", "C-S-M",
|
"S-M-CMD", "C-M-CMD", "C-S-CMD", "C-S-M",
|
||||||
"M-CMD", "S-CMD", "S-M", "C-CMD", "C-M", "C-S",
|
"M-CMD", "S-CMD", "S-M", "C-CMD", "C-M", "C-S",
|
||||||
"CMD", "M", "S", "C"];
|
"CMD", "M", "S", "C"];
|
||||||
|
|
@ -188,11 +188,11 @@ exports.handler.onCopy = function(e, editor) {
|
||||||
editor.$handlesEmacsOnCopy = true;
|
editor.$handlesEmacsOnCopy = true;
|
||||||
exports.handler.commands.killRingSave.exec(editor);
|
exports.handler.commands.killRingSave.exec(editor);
|
||||||
delete editor.$handlesEmacsOnCopy;
|
delete editor.$handlesEmacsOnCopy;
|
||||||
}
|
};
|
||||||
|
|
||||||
exports.handler.onPaste = function(e, editor) {
|
exports.handler.onPaste = function(e, editor) {
|
||||||
editor.pushEmacsMark(editor.getCursorPosition());
|
editor.pushEmacsMark(editor.getCursorPosition());
|
||||||
}
|
};
|
||||||
|
|
||||||
exports.handler.bindKey = function(key, command) {
|
exports.handler.bindKey = function(key, command) {
|
||||||
if (!key)
|
if (!key)
|
||||||
|
|
@ -216,7 +216,7 @@ exports.handler.bindKey = function(key, command) {
|
||||||
if (!ckb[keyPart]) ckb[keyPart] = "null";
|
if (!ckb[keyPart]) ckb[keyPart] = "null";
|
||||||
});
|
});
|
||||||
}, this);
|
}, this);
|
||||||
}
|
};
|
||||||
|
|
||||||
exports.handler.handleKeyboard = function(data, hashId, key, keyCode) {
|
exports.handler.handleKeyboard = function(data, hashId, key, keyCode) {
|
||||||
var editor = data.editor;
|
var editor = data.editor;
|
||||||
|
|
@ -224,7 +224,7 @@ exports.handler.handleKeyboard = function(data, hashId, key, keyCode) {
|
||||||
if (hashId == -1) {
|
if (hashId == -1) {
|
||||||
editor.pushEmacsMark();
|
editor.pushEmacsMark();
|
||||||
if (data.count) {
|
if (data.count) {
|
||||||
var str = Array(data.count + 1).join(key);
|
var str = new Array(data.count + 1).join(key);
|
||||||
data.count = null;
|
data.count = null;
|
||||||
return {command: "insertstring", args: str};
|
return {command: "insertstring", args: str};
|
||||||
}
|
}
|
||||||
|
|
@ -313,7 +313,7 @@ exports.handler.handleKeyboard = function(data, hashId, key, keyCode) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
if (!args) args = {}
|
if (!args) args = {};
|
||||||
if (typeof args === 'object') args.count = count;
|
if (typeof args === 'object') args.count = count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -508,8 +508,8 @@ exports.handler.addCommands({
|
||||||
killLine: function(editor) {
|
killLine: function(editor) {
|
||||||
editor.pushEmacsMark(null);
|
editor.pushEmacsMark(null);
|
||||||
var pos = editor.getCursorPosition();
|
var pos = editor.getCursorPosition();
|
||||||
if (pos.column == 0 &&
|
if (pos.column === 0 &&
|
||||||
editor.session.doc.getLine(pos.row).length == 0) {
|
editor.session.doc.getLine(pos.row).length === 0) {
|
||||||
// If an already empty line is killed, remove
|
// If an already empty line is killed, remove
|
||||||
// the line entirely
|
// the line entirely
|
||||||
editor.selection.selectLine();
|
editor.selection.selectLine();
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ var event = require("../lib/event");
|
||||||
|
|
||||||
var KeyBinding = function(editor) {
|
var KeyBinding = function(editor) {
|
||||||
this.$editor = editor;
|
this.$editor = editor;
|
||||||
this.$data = { };
|
this.$data = {};
|
||||||
this.$handlers = [];
|
this.$handlers = [];
|
||||||
this.setDefaultHandler(editor.commands);
|
this.setDefaultHandler(editor.commands);
|
||||||
};
|
};
|
||||||
|
|
@ -63,6 +63,8 @@ var KeyBinding = function(editor) {
|
||||||
this.addKeyboardHandler = function(kb, pos) {
|
this.addKeyboardHandler = function(kb, pos) {
|
||||||
if (!kb)
|
if (!kb)
|
||||||
return;
|
return;
|
||||||
|
if (typeof kb == "function" && !kb.handleKeyboard)
|
||||||
|
kb.handleKeyboard = kb;
|
||||||
var i = this.$handlers.indexOf(kb);
|
var i = this.$handlers.indexOf(kb);
|
||||||
if (i != -1)
|
if (i != -1)
|
||||||
this.$handlers.splice(i, 1);
|
this.$handlers.splice(i, 1);
|
||||||
|
|
|
||||||
|
|
@ -355,7 +355,7 @@ var TextInput = function(parentNode, host) {
|
||||||
|
|
||||||
// COMPOSITION
|
// COMPOSITION
|
||||||
var onCompositionStart = function(e) {
|
var onCompositionStart = function(e) {
|
||||||
if (inComposition) return;
|
if (inComposition || !host.onCompositionStart) return;
|
||||||
// console.log("onCompositionStart", inComposition)
|
// console.log("onCompositionStart", inComposition)
|
||||||
inComposition = {};
|
inComposition = {};
|
||||||
host.onCompositionStart();
|
host.onCompositionStart();
|
||||||
|
|
@ -371,7 +371,7 @@ var TextInput = function(parentNode, host) {
|
||||||
|
|
||||||
var onCompositionUpdate = function() {
|
var onCompositionUpdate = function() {
|
||||||
// console.log("onCompositionUpdate", inComposition && JSON.stringify(text.value))
|
// console.log("onCompositionUpdate", inComposition && JSON.stringify(text.value))
|
||||||
if (!inComposition) return;
|
if (!inComposition || !host.onCompositionUpdate) return;
|
||||||
var val = text.value.replace(/\x01/g, "");
|
var val = text.value.replace(/\x01/g, "");
|
||||||
if (inComposition.lastValue === val) return;
|
if (inComposition.lastValue === val) return;
|
||||||
|
|
||||||
|
|
@ -390,6 +390,7 @@ var TextInput = function(parentNode, host) {
|
||||||
};
|
};
|
||||||
|
|
||||||
var onCompositionEnd = function(e) {
|
var onCompositionEnd = function(e) {
|
||||||
|
if (!host.onCompositionEnd) return;
|
||||||
// console.log("onCompositionEnd", inComposition &&inComposition.lastValue)
|
// console.log("onCompositionEnd", inComposition &&inComposition.lastValue)
|
||||||
var c = inComposition;
|
var c = inComposition;
|
||||||
inComposition = false;
|
inComposition = false;
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ exports.handler = {
|
||||||
if (util.currentMode === "insert") {
|
if (util.currentMode === "insert") {
|
||||||
this.onCompositionStartOrig(text);
|
this.onCompositionStartOrig(text);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
if (enable) {
|
if (enable) {
|
||||||
if (!editor.onCompositionUpdateOrig) {
|
if (!editor.onCompositionUpdateOrig) {
|
||||||
editor.onCompositionUpdateOrig = editor.onCompositionUpdate;
|
editor.onCompositionUpdateOrig = editor.onCompositionUpdate;
|
||||||
|
|
@ -116,7 +116,7 @@ exports.handler = {
|
||||||
|
|
||||||
handleKeyboard: function(data, hashId, key, keyCode, e) {
|
handleKeyboard: function(data, hashId, key, keyCode, e) {
|
||||||
// ignore command keys (shift, ctrl etc.)
|
// ignore command keys (shift, ctrl etc.)
|
||||||
if (hashId != 0 && (key == "" || key == "\x00"))
|
if (hashId !== 0 && (!key || keyCode == -1))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
var editor = data.editor;
|
var editor = data.editor;
|
||||||
|
|
@ -134,7 +134,7 @@ exports.handler = {
|
||||||
return {command: "null", passEvent: true};
|
return {command: "null", passEvent: true};
|
||||||
}
|
}
|
||||||
return {command: coreCommands.stop};
|
return {command: coreCommands.stop};
|
||||||
} else if ((key == "esc" && hashId == 0) || key == "ctrl-[") {
|
} else if ((key == "esc" && hashId === 0) || key == "ctrl-[") {
|
||||||
return {command: coreCommands.stop};
|
return {command: coreCommands.stop};
|
||||||
} else if (data.state == "start") {
|
} else if (data.state == "start") {
|
||||||
if (useragent.isMac && this.handleMacRepeat(data, hashId, key)) {
|
if (useragent.isMac && this.handleMacRepeat(data, hashId, key)) {
|
||||||
|
|
@ -142,15 +142,15 @@ exports.handler = {
|
||||||
key = data.inputChar;
|
key = data.inputChar;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hashId == -1 || hashId == 1 || hashId == 0 && key.length > 1) {
|
if (hashId == -1 || hashId == 1 || hashId === 0 && key.length > 1) {
|
||||||
if (cmds.inputBuffer.idle && startCommands[key])
|
if (cmds.inputBuffer.idle && startCommands[key])
|
||||||
return startCommands[key];
|
return startCommands[key];
|
||||||
cmds.inputBuffer.push(editor, key);
|
cmds.inputBuffer.push(editor, key);
|
||||||
return {command: "null", passEvent: false};
|
return {command: "null", passEvent: false};
|
||||||
} // if no modifier || shift: wait for input.
|
} // if no modifier || shift: wait for input.
|
||||||
else if (key.length == 1 && (hashId == 0 || hashId == 4)) {
|
else if (key.length == 1 && (hashId === 0 || hashId == 4)) {
|
||||||
return {command: "null", passEvent: true};
|
return {command: "null", passEvent: true};
|
||||||
} else if (key == "esc" && hashId == 0) {
|
} else if (key == "esc" && hashId === 0) {
|
||||||
return {command: coreCommands.stop};
|
return {command: coreCommands.stop};
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -481,10 +481,17 @@ module.exports = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"$": {
|
"$": {
|
||||||
nav: function(editor) {
|
handlesCount: true,
|
||||||
|
nav: function(editor, range, count, param) {
|
||||||
|
if (count > 1) {
|
||||||
|
editor.navigateDown(count-1);
|
||||||
|
}
|
||||||
editor.navigateLineEnd();
|
editor.navigateLineEnd();
|
||||||
},
|
},
|
||||||
sel: function(editor) {
|
sel: function(editor, range, count, param) {
|
||||||
|
if (count > 1) {
|
||||||
|
editor.selection.moveCursorBy(count-1, 0);
|
||||||
|
}
|
||||||
editor.selection.selectLineEnd();
|
editor.selection.selectLineEnd();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -660,5 +667,7 @@ module.exports.up = module.exports.k;
|
||||||
module.exports.down = module.exports.j;
|
module.exports.down = module.exports.j;
|
||||||
module.exports.pagedown = module.exports["ctrl-d"];
|
module.exports.pagedown = module.exports["ctrl-d"];
|
||||||
module.exports.pageup = module.exports["ctrl-u"];
|
module.exports.pageup = module.exports["ctrl-u"];
|
||||||
|
module.exports.home = module.exports["0"];
|
||||||
|
module.exports.end = module.exports["$"];
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -251,7 +251,7 @@ addTest("Word movement [PARTIAL]", "03", "1", function() {
|
||||||
*/
|
*/
|
||||||
});
|
});
|
||||||
|
|
||||||
addTest("Moving to the start or end of a line [PARTIAL]", "03", "2", function() {
|
addTest("Moving to the start or end of a line", "03", "2", function() {
|
||||||
var text = " This is a line with example text";
|
var text = " This is a line with example text";
|
||||||
var textLength = text.length;
|
var textLength = text.length;
|
||||||
initEditor(text);
|
initEditor(text);
|
||||||
|
|
@ -259,22 +259,18 @@ addTest("Moving to the start or end of a line [PARTIAL]", "03", "2", function()
|
||||||
assertPosition(0, 36);
|
assertPosition(0, 36);
|
||||||
sendKeys("0");
|
sendKeys("0");
|
||||||
assertPosition(0, 0);
|
assertPosition(0, 0);
|
||||||
/* "End" and "Home" fails
|
|
||||||
sendKeys("End");
|
sendKeys("End");
|
||||||
assertPosition(0, 36);
|
assertPosition(0, 36);
|
||||||
sendKeys("Home");
|
sendKeys("Home");
|
||||||
assertPosition(0, 0);
|
assertPosition(0, 0);
|
||||||
*/
|
|
||||||
sendKeys("^");
|
sendKeys("^");
|
||||||
assertPosition(0, 5);
|
assertPosition(0, 5);
|
||||||
sendKeys("$^");
|
sendKeys("$^");
|
||||||
assertPosition(0, 5);
|
assertPosition(0, 5);
|
||||||
sendKeys("ddaA young intelligent turtle\nFound programming UNIX a hurdle", "Esc", "k0");
|
sendKeys("ddaA young intelligent turtle\nFound programming UNIX a hurdle", "Esc", "k0");
|
||||||
assertPosition(0, 0);
|
assertPosition(0, 0);
|
||||||
/* <count>$ fails
|
|
||||||
sendKeys("2$");
|
sendKeys("2$");
|
||||||
assertPosition(1, 30);
|
assertPosition(1, 30);
|
||||||
*/
|
|
||||||
});
|
});
|
||||||
|
|
||||||
addTest("Moving to a character [PARTIAL]", "03", "3", function() {
|
addTest("Moving to a character [PARTIAL]", "03", "3", function() {
|
||||||
|
|
|
||||||
|
|
@ -32,11 +32,15 @@ define(function(require, exports, module) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var dom = require("../lib/dom");
|
var dom = require("../lib/dom");
|
||||||
|
var IE8;
|
||||||
|
|
||||||
var Cursor = function(parentEl) {
|
var Cursor = function(parentEl) {
|
||||||
this.element = dom.createElement("div");
|
this.element = dom.createElement("div");
|
||||||
this.element.className = "ace_layer ace_cursor-layer";
|
this.element.className = "ace_layer ace_cursor-layer";
|
||||||
parentEl.appendChild(this.element);
|
parentEl.appendChild(this.element);
|
||||||
|
|
||||||
|
if (IE8 === undefined)
|
||||||
|
IE8 = "opacity" in this.element;
|
||||||
|
|
||||||
this.isVisible = false;
|
this.isVisible = false;
|
||||||
this.isBlinking = true;
|
this.isBlinking = true;
|
||||||
|
|
@ -46,9 +50,22 @@ var Cursor = function(parentEl) {
|
||||||
this.cursors = [];
|
this.cursors = [];
|
||||||
this.cursor = this.addCursor();
|
this.cursor = this.addCursor();
|
||||||
dom.addCssClass(this.element, "ace_hidden-cursors");
|
dom.addCssClass(this.element, "ace_hidden-cursors");
|
||||||
|
this.$updateCursors = this.$updateVisibility.bind(this);
|
||||||
};
|
};
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
|
this.$updateVisibility = function(val) {
|
||||||
|
var cursors = this.cursors;
|
||||||
|
for (var i = cursors.length; i--; )
|
||||||
|
cursors[i].style.visibility = val ? "" : "hidden";
|
||||||
|
};
|
||||||
|
this.$updateOpacity = function(val) {
|
||||||
|
var cursors = this.cursors;
|
||||||
|
for (var i = cursors.length; i--; )
|
||||||
|
cursors[i].style.opacity = val ? "" : "0";
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
this.$padding = 0;
|
this.$padding = 0;
|
||||||
this.setPadding = function(padding) {
|
this.setPadding = function(padding) {
|
||||||
|
|
@ -74,12 +91,13 @@ var Cursor = function(parentEl) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.setSmoothBlinking = function(smoothBlinking) {
|
this.setSmoothBlinking = function(smoothBlinking) {
|
||||||
if (smoothBlinking != this.smoothBlinking) {
|
if (smoothBlinking != this.smoothBlinking && !IE8) {
|
||||||
this.smoothBlinking = smoothBlinking;
|
this.smoothBlinking = smoothBlinking;
|
||||||
if (smoothBlinking)
|
dom.setCssClass(this.element, "ace_smooth-blinking", smoothBlinking);
|
||||||
dom.addCssClass(this.element, "ace_smooth-blinking");
|
this.$updateCursors(true);
|
||||||
else
|
this.$updateCursors = (smoothBlinking
|
||||||
dom.removeCssClass(this.element, "ace_smooth-blinking");
|
? this.$updateOpacity
|
||||||
|
: this.$updateVisibility).bind(this);
|
||||||
this.restartTimer();
|
this.restartTimer();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -113,35 +131,34 @@ var Cursor = function(parentEl) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.restartTimer = function() {
|
this.restartTimer = function() {
|
||||||
|
var update = this.$updateCursors;
|
||||||
clearInterval(this.intervalId);
|
clearInterval(this.intervalId);
|
||||||
clearTimeout(this.timeoutId);
|
clearTimeout(this.timeoutId);
|
||||||
if (this.smoothBlinking)
|
if (this.smoothBlinking) {
|
||||||
dom.removeCssClass(this.element, "ace_smooth-blinking");
|
dom.removeCssClass(this.element, "ace_smooth-blinking");
|
||||||
for (var i = this.cursors.length; i--; )
|
}
|
||||||
this.cursors[i].style.opacity = "";
|
|
||||||
|
update(true);
|
||||||
|
|
||||||
if (!this.isBlinking || !this.blinkInterval || !this.isVisible)
|
if (!this.isBlinking || !this.blinkInterval || !this.isVisible)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (this.smoothBlinking)
|
if (this.smoothBlinking) {
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
dom.addCssClass(this.element, "ace_smooth-blinking");
|
dom.addCssClass(this.element, "ace_smooth-blinking");
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
}
|
||||||
|
|
||||||
var blink = function(){
|
var blink = function(){
|
||||||
this.timeoutId = setTimeout(function() {
|
this.timeoutId = setTimeout(function() {
|
||||||
for (var i = this.cursors.length; i--; ) {
|
update(false);
|
||||||
this.cursors[i].style.opacity = 0;
|
}, 0.6 * this.blinkInterval);
|
||||||
}
|
|
||||||
}.bind(this), 0.6 * this.blinkInterval);
|
|
||||||
}.bind(this);
|
}.bind(this);
|
||||||
|
|
||||||
this.intervalId = setInterval(function() {
|
this.intervalId = setInterval(function() {
|
||||||
for (var i = this.cursors.length; i--; ) {
|
update(true);
|
||||||
this.cursors[i].style.opacity = "";
|
|
||||||
}
|
|
||||||
blink();
|
blink();
|
||||||
}.bind(this), this.blinkInterval);
|
}, this.blinkInterval);
|
||||||
|
|
||||||
blink();
|
blink();
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -118,9 +118,9 @@ var Gutter = function(parentEl) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.update = function(config) {
|
this.update = function(config) {
|
||||||
var firstRow = config.firstRow;
|
|
||||||
var lastRow = config.lastRow;
|
|
||||||
var session = this.session;
|
var session = this.session;
|
||||||
|
var firstRow = config.firstRow;
|
||||||
|
var lastRow = Math.min(config.lastRow + 1, session.getLength() - 1); // needed to compensate
|
||||||
var fold = session.getNextFoldLine(firstRow);
|
var fold = session.getNextFoldLine(firstRow);
|
||||||
var foldStart = fold ? fold.start.row : Infinity;
|
var foldStart = fold ? fold.start.row : Infinity;
|
||||||
var foldWidgets = this.$showFoldWidgets && session.foldWidgets;
|
var foldWidgets = this.$showFoldWidgets && session.foldWidgets;
|
||||||
|
|
@ -129,7 +129,7 @@ var Gutter = function(parentEl) {
|
||||||
var firstLineNumber = session.$firstLineNumber;
|
var firstLineNumber = session.$firstLineNumber;
|
||||||
var lastLineNumber = 0;
|
var lastLineNumber = 0;
|
||||||
|
|
||||||
var gutterRenderer = session.gutterRenderer;
|
var gutterRenderer = session.gutterRenderer || this.$renderer;
|
||||||
|
|
||||||
var cell = null;
|
var cell = null;
|
||||||
var index = -1;
|
var index = -1;
|
||||||
|
|
@ -231,6 +231,19 @@ var Gutter = function(parentEl) {
|
||||||
|
|
||||||
this.$fixedWidth = false;
|
this.$fixedWidth = false;
|
||||||
|
|
||||||
|
this.$showLineNumbers = true;
|
||||||
|
this.$renderer = "";
|
||||||
|
this.setShowLineNumbers = function(show) {
|
||||||
|
this.$renderer = !show && {
|
||||||
|
getWidth: function() {return ""},
|
||||||
|
getText: function() {return ""}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
this.getShowLineNumbers = function() {
|
||||||
|
return this.$showLineNumbers;
|
||||||
|
};
|
||||||
|
|
||||||
this.$showFoldWidgets = true;
|
this.$showFoldWidgets = true;
|
||||||
this.setShowFoldWidgets = function(show) {
|
this.setShowFoldWidgets = function(show) {
|
||||||
if (show)
|
if (show)
|
||||||
|
|
|
||||||
|
|
@ -364,9 +364,8 @@ var Text = function(parentEl) {
|
||||||
container.style.height = config.lineHeight * this.session.getRowLength(row) + "px";
|
container.style.height = config.lineHeight * this.session.getRowLength(row) + "px";
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
var lines = container.childNodes
|
while(container.firstChild)
|
||||||
while(lines.length)
|
fragment.appendChild(container.firstChild);
|
||||||
fragment.appendChild(lines[0]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
row++;
|
row++;
|
||||||
|
|
|
||||||
|
|
@ -258,11 +258,11 @@ function normalizeCommandKeys(callback, e, keyCode) {
|
||||||
hashId = 8;
|
hashId = 8;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
keyCode = 0;
|
keyCode = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hashId & 8 && (keyCode === 91 || keyCode === 93)) {
|
if (hashId & 8 && (keyCode === 91 || keyCode === 93)) {
|
||||||
keyCode = 0;
|
keyCode = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hashId && keyCode === 13) {
|
if (!hashId && keyCode === 13) {
|
||||||
|
|
|
||||||
|
|
@ -46,8 +46,8 @@ var Keys = (function() {
|
||||||
},
|
},
|
||||||
|
|
||||||
KEY_MODS: {
|
KEY_MODS: {
|
||||||
"ctrl": 1, "alt": 2, "option" : 2,
|
"ctrl": 1, "alt": 2, "option" : 2, "shift": 4,
|
||||||
"shift": 4, "meta": 8, "command": 8, "cmd": 8
|
"super": 8, "meta": 8, "command": 8, "cmd": 8
|
||||||
},
|
},
|
||||||
|
|
||||||
FUNCTION_KEYS : {
|
FUNCTION_KEYS : {
|
||||||
|
|
@ -108,8 +108,15 @@ var Keys = (function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
// A reverse map of FUNCTION_KEYS
|
// A reverse map of FUNCTION_KEYS
|
||||||
for (var i in ret.FUNCTION_KEYS) {
|
var name, i;
|
||||||
var name = ret.FUNCTION_KEYS[i].toLowerCase();
|
for (i in ret.FUNCTION_KEYS) {
|
||||||
|
name = ret.FUNCTION_KEYS[i].toLowerCase();
|
||||||
|
ret[name] = parseInt(i, 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
// A reverse map of PRINTABLE_KEYS
|
||||||
|
for (i in ret.PRINTABLE_KEYS) {
|
||||||
|
name = ret.PRINTABLE_KEYS[i].toLowerCase();
|
||||||
ret[name] = parseInt(i, 10);
|
ret[name] = parseInt(i, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,10 @@
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
exports.last = function(a) {
|
||||||
|
return a[a.length - 1];
|
||||||
|
};
|
||||||
|
|
||||||
exports.stringReverse = function(string) {
|
exports.stringReverse = function(string) {
|
||||||
return string.split("").reverse().join("");
|
return string.split("").reverse().join("");
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -179,7 +179,7 @@
|
||||||
["meta.tag.name.table","td"],
|
["meta.tag.name.table","td"],
|
||||||
["meta.tag.punctuation.end",">"]
|
["meta.tag.punctuation.end",">"]
|
||||||
],[
|
],[
|
||||||
["start","ejs-start","qqstring_inner","qqstring_inner","start_tag_stuff"],
|
"start",
|
||||||
["text"," "],
|
["text"," "],
|
||||||
["meta.tag.punctuation.begin","<"],
|
["meta.tag.punctuation.begin","<"],
|
||||||
["meta.tag.name","span"],
|
["meta.tag.name","span"],
|
||||||
|
|
@ -204,12 +204,13 @@
|
||||||
["text"," "],
|
["text"," "],
|
||||||
["string","'file'"],
|
["string","'file'"],
|
||||||
["markup.list.meta.tag","%>"],
|
["markup.list.meta.tag","%>"],
|
||||||
["text","\">"],
|
["string","\""],
|
||||||
|
["meta.tag.punctuation.end",">"],
|
||||||
["meta.tag.punctuation.begin","</"],
|
["meta.tag.punctuation.begin","</"],
|
||||||
["meta.tag.name","span"],
|
["meta.tag.name","span"],
|
||||||
["meta.tag.punctuation.end",">"]
|
["meta.tag.punctuation.end",">"]
|
||||||
],[
|
],[
|
||||||
["start","ejs-start","qqstring_inner","qqstring_inner","start_tag_stuff","start","ejs-start","qqstring_inner","qqstring_inner","start_tag_stuff"],
|
"start",
|
||||||
["text"," "],
|
["text"," "],
|
||||||
["meta.tag.punctuation.begin","<"],
|
["meta.tag.punctuation.begin","<"],
|
||||||
["meta.tag.name.anchor","a"],
|
["meta.tag.name.anchor","a"],
|
||||||
|
|
@ -224,7 +225,8 @@
|
||||||
["identifier","name"],
|
["identifier","name"],
|
||||||
["text"," "],
|
["text"," "],
|
||||||
["markup.list.meta.tag","%>"],
|
["markup.list.meta.tag","%>"],
|
||||||
["text","\">"],
|
["string","\""],
|
||||||
|
["meta.tag.punctuation.end",">"],
|
||||||
["markup.list.meta.tag","<%="],
|
["markup.list.meta.tag","<%="],
|
||||||
["text"," "],
|
["text"," "],
|
||||||
["identifier","entry"],
|
["identifier","entry"],
|
||||||
|
|
@ -236,13 +238,13 @@
|
||||||
["meta.tag.name.anchor","a"],
|
["meta.tag.name.anchor","a"],
|
||||||
["meta.tag.punctuation.end",">"]
|
["meta.tag.punctuation.end",">"]
|
||||||
],[
|
],[
|
||||||
["start","ejs-start","qqstring_inner","qqstring_inner","start_tag_stuff","start","ejs-start","qqstring_inner","qqstring_inner","start_tag_stuff"],
|
"start",
|
||||||
["text"," "],
|
["text"," "],
|
||||||
["meta.tag.punctuation.begin","</"],
|
["meta.tag.punctuation.begin","</"],
|
||||||
["meta.tag.name.table","td"],
|
["meta.tag.name.table","td"],
|
||||||
["meta.tag.punctuation.end",">"]
|
["meta.tag.punctuation.end",">"]
|
||||||
],[
|
],[
|
||||||
["start","ejs-start","qqstring_inner","qqstring_inner","start_tag_stuff","start","ejs-start","qqstring_inner","qqstring_inner","start_tag_stuff"],
|
"start",
|
||||||
["text"," "],
|
["text"," "],
|
||||||
["meta.tag.punctuation.begin","<"],
|
["meta.tag.punctuation.begin","<"],
|
||||||
["meta.tag.name.table","td"],
|
["meta.tag.name.table","td"],
|
||||||
|
|
@ -258,13 +260,13 @@
|
||||||
["meta.tag.name.table","td"],
|
["meta.tag.name.table","td"],
|
||||||
["meta.tag.punctuation.end",">"]
|
["meta.tag.punctuation.end",">"]
|
||||||
],[
|
],[
|
||||||
["start","ejs-start","qqstring_inner","qqstring_inner","start_tag_stuff","start","ejs-start","qqstring_inner","qqstring_inner","start_tag_stuff"],
|
"start",
|
||||||
["text"," "],
|
["text"," "],
|
||||||
["meta.tag.punctuation.begin","</"],
|
["meta.tag.punctuation.begin","</"],
|
||||||
["meta.tag.name.table","tr"],
|
["meta.tag.name.table","tr"],
|
||||||
["meta.tag.punctuation.end",">"]
|
["meta.tag.punctuation.end",">"]
|
||||||
],[
|
],[
|
||||||
["start","ejs-start","qqstring_inner","qqstring_inner","start_tag_stuff","start","ejs-start","qqstring_inner","qqstring_inner","start_tag_stuff"],
|
"start",
|
||||||
["text"," "],
|
["text"," "],
|
||||||
["markup.list.meta.tag","<%"],
|
["markup.list.meta.tag","<%"],
|
||||||
["text"," "],
|
["text"," "],
|
||||||
|
|
@ -272,22 +274,22 @@
|
||||||
["text"," "],
|
["text"," "],
|
||||||
["markup.list.meta.tag","%>"]
|
["markup.list.meta.tag","%>"]
|
||||||
],[
|
],[
|
||||||
["start","ejs-start","qqstring_inner","qqstring_inner","start_tag_stuff","start","ejs-start","qqstring_inner","qqstring_inner","start_tag_stuff"],
|
"start",
|
||||||
["text"," "],
|
["text"," "],
|
||||||
["meta.tag.punctuation.begin","</"],
|
["meta.tag.punctuation.begin","</"],
|
||||||
["meta.tag.name.table","table"],
|
["meta.tag.name.table","table"],
|
||||||
["meta.tag.punctuation.end",">"]
|
["meta.tag.punctuation.end",">"]
|
||||||
],[
|
],[
|
||||||
["start","ejs-start","qqstring_inner","qqstring_inner","start_tag_stuff","start","ejs-start","qqstring_inner","qqstring_inner","start_tag_stuff"],
|
"start",
|
||||||
["text"," "]
|
["text"," "]
|
||||||
],[
|
],[
|
||||||
["start","ejs-start","qqstring_inner","qqstring_inner","start_tag_stuff","start","ejs-start","qqstring_inner","qqstring_inner","start_tag_stuff"],
|
"start",
|
||||||
["text"," "],
|
["text"," "],
|
||||||
["meta.tag.punctuation.begin","</"],
|
["meta.tag.punctuation.begin","</"],
|
||||||
["meta.tag.name","body"],
|
["meta.tag.name","body"],
|
||||||
["meta.tag.punctuation.end",">"]
|
["meta.tag.punctuation.end",">"]
|
||||||
],[
|
],[
|
||||||
["start","ejs-start","qqstring_inner","qqstring_inner","start_tag_stuff","start","ejs-start","qqstring_inner","qqstring_inner","start_tag_stuff"],
|
"start",
|
||||||
["meta.tag.punctuation.begin","</"],
|
["meta.tag.punctuation.begin","</"],
|
||||||
["meta.tag.name","html"],
|
["meta.tag.name","html"],
|
||||||
["meta.tag.punctuation.end",">"]
|
["meta.tag.punctuation.end",">"]
|
||||||
|
|
|
||||||
|
|
@ -201,7 +201,7 @@
|
||||||
["keyword.operator","="],
|
["keyword.operator","="],
|
||||||
["keyword","function"],
|
["keyword","function"],
|
||||||
["paren.lparen","("],
|
["paren.lparen","("],
|
||||||
["identifier","self"],
|
["variable.language","self"],
|
||||||
["text",", "],
|
["text",", "],
|
||||||
["identifier","other"],
|
["identifier","other"],
|
||||||
["paren.rparen",")"]
|
["paren.rparen",")"]
|
||||||
|
|
@ -266,7 +266,7 @@
|
||||||
["text"," "],
|
["text"," "],
|
||||||
["keyword","return"],
|
["keyword","return"],
|
||||||
["text"," "],
|
["text"," "],
|
||||||
["identifier","self"],
|
["variable.language","self"],
|
||||||
["keyword.operator",":"],
|
["keyword.operator",":"],
|
||||||
["support.function","format"],
|
["support.function","format"],
|
||||||
["paren.lparen","("],
|
["paren.lparen","("],
|
||||||
|
|
@ -345,4 +345,4 @@
|
||||||
["text"," "],
|
["text"," "],
|
||||||
["comment","--[[ blah ]]"],
|
["comment","--[[ blah ]]"],
|
||||||
["paren.rparen",")"]
|
["paren.rparen",")"]
|
||||||
]]
|
]]
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,7 @@ oop.inherits(Mode, TextMode);
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
this.lineCommentStart = "#";
|
this.lineCommentStart = "#";
|
||||||
|
this.$id = "ace/mode/apache_conf";
|
||||||
// Extra logic goes here.
|
// Extra logic goes here.
|
||||||
}).call(Mode.prototype);
|
}).call(Mode.prototype);
|
||||||
|
|
||||||
|
|
|
||||||
95
lib/ace/mode/behaviour/coldfusion.js
Normal file
95
lib/ace/mode/behaviour/coldfusion.js
Normal file
|
|
@ -0,0 +1,95 @@
|
||||||
|
/* ***** BEGIN LICENSE BLOCK *****
|
||||||
|
* Distributed under the BSD license:
|
||||||
|
*
|
||||||
|
* Copyright (c) 2010, Ajax.org B.V.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* * Neither the name of Ajax.org B.V. nor the
|
||||||
|
* names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
|
define(function(require, exports, module) {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var oop = require("../../lib/oop");
|
||||||
|
var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
|
||||||
|
var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
|
||||||
|
var TokenIterator = require("../../token_iterator").TokenIterator;
|
||||||
|
var voidElements = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr'];
|
||||||
|
|
||||||
|
function hasType(token, type) {
|
||||||
|
var hasType = true;
|
||||||
|
var typeList = token.type.split('.');
|
||||||
|
var needleList = type.split('.');
|
||||||
|
needleList.forEach(function(needle){
|
||||||
|
if (typeList.indexOf(needle) == -1) {
|
||||||
|
hasType = false;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return hasType;
|
||||||
|
}
|
||||||
|
|
||||||
|
var CfmlBehaviour = function () {
|
||||||
|
|
||||||
|
this.inherit(XmlBehaviour); // Get xml behaviour
|
||||||
|
|
||||||
|
this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
|
||||||
|
if (text == '>') {
|
||||||
|
var position = editor.getCursorPosition();
|
||||||
|
var iterator = new TokenIterator(session, position.row, position.column);
|
||||||
|
var token = iterator.getCurrentToken();
|
||||||
|
|
||||||
|
if (token && hasType(token, 'meta.tag.name') && /^cf+(abort|application|argument|associate|break|cache|collection|cookie|dbinfo|directory|dump|else|elseif|error|exchangecalendar|exchangeconnection|exchangecontact|exchangefilter|exchangetask|exit|feed|file|flush|ftp|header|htmlhead|httpparam|image|import|include|index|insert|invokeargument|location|log|mailparam|NTauthenticate|object|objectcache|param|pdfformparam|print|procparam|procresult|property|queryparam|registry|reportparam|rethrow|return|schedule|search|set|setting|throw|zipparam)$/gi.test(token.value))
|
||||||
|
return;
|
||||||
|
if (hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column)
|
||||||
|
return;
|
||||||
|
var atCursor = false;
|
||||||
|
if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){
|
||||||
|
do {
|
||||||
|
token = iterator.stepBackward();
|
||||||
|
} while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text')));
|
||||||
|
} else {
|
||||||
|
atCursor = true;
|
||||||
|
}
|
||||||
|
if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var element = token.value;
|
||||||
|
if (atCursor){
|
||||||
|
var element = element.substring(0, position.column - token.start);
|
||||||
|
}
|
||||||
|
if (voidElements.indexOf(element) !== -1){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
text: '>' + '</' + element + '>',
|
||||||
|
selection: [1, 1]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
oop.inherits(CfmlBehaviour, XmlBehaviour);
|
||||||
|
|
||||||
|
exports.CfmlBehaviour = CfmlBehaviour;
|
||||||
|
});
|
||||||
|
|
@ -66,7 +66,7 @@ var C9SearchHighlightRules = function() {
|
||||||
|
|
||||||
var m;
|
var m;
|
||||||
var last = 0;
|
var last = 0;
|
||||||
if (regex) {
|
if (regex && regex.exec) {
|
||||||
regex.lastIndex = 0;
|
regex.lastIndex = 0;
|
||||||
while (m = regex.exec(str)) {
|
while (m = regex.exec(str)) {
|
||||||
var skipped = str.substring(last, m.index);
|
var skipped = str.substring(last, m.index);
|
||||||
|
|
@ -92,42 +92,26 @@ var C9SearchHighlightRules = function() {
|
||||||
regex : "Searching for .*$",
|
regex : "Searching for .*$",
|
||||||
onMatch: function(val, state, stack) {
|
onMatch: function(val, state, stack) {
|
||||||
var parts = val.split("\x01");
|
var parts = val.split("\x01");
|
||||||
var search = parts[1];
|
|
||||||
if (parts.length < 3)
|
if (parts.length < 3)
|
||||||
return "text";
|
return "text";
|
||||||
var options = parts[2] == " in" ? parts[5] : parts[6];
|
|
||||||
|
|
||||||
if (!/regex/.test(options))
|
var options, search, replace;
|
||||||
search = lang.escapeRegExp(search);
|
|
||||||
if (/whole/.test(options))
|
|
||||||
search = "\\b" + search + "\\b";
|
|
||||||
var regex = search && safeCreateRegexp(
|
|
||||||
"(" + search + ")",
|
|
||||||
/ sensitive/.test(options) ? "g" : "ig"
|
|
||||||
);
|
|
||||||
if (regex) {
|
|
||||||
stack[0] = state;
|
|
||||||
stack[1] = regex;
|
|
||||||
}
|
|
||||||
|
|
||||||
var i = 0;
|
var i = 0;
|
||||||
var tokens = [
|
var tokens = [{
|
||||||
{
|
value: parts[i++] + "'",
|
||||||
value: parts[i++] + "'",
|
type: "text"
|
||||||
type: "text"
|
}, {
|
||||||
},
|
value: search = parts[i++],
|
||||||
{
|
type: "text" // "c9searchresults.keyword"
|
||||||
value: parts[i++],
|
}, {
|
||||||
type: "text" // "c9searchresults.keyword"
|
value: "'" + parts[i++],
|
||||||
},
|
type: "text"
|
||||||
{
|
}];
|
||||||
value: "'" + parts[i++],
|
|
||||||
type: "text"
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
// replaced
|
// replaced
|
||||||
if (parts[2] !== " in") {
|
if (parts[2] !== " in") {
|
||||||
|
replace = parts[i];
|
||||||
tokens.push({
|
tokens.push({
|
||||||
value: "'" + parts[i++] + "'",
|
value: "'" + parts[i++] + "'",
|
||||||
type: "text"
|
type: "text"
|
||||||
|
|
@ -143,6 +127,7 @@ var C9SearchHighlightRules = function() {
|
||||||
});
|
});
|
||||||
// options
|
// options
|
||||||
if (parts[i+1]) {
|
if (parts[i+1]) {
|
||||||
|
options = parts[i+1];
|
||||||
tokens.push({
|
tokens.push({
|
||||||
value: "(" + parts[i+1] + ")",
|
value: "(" + parts[i+1] + ")",
|
||||||
type: "text"
|
type: "text"
|
||||||
|
|
@ -151,11 +136,33 @@ var C9SearchHighlightRules = function() {
|
||||||
} else {
|
} else {
|
||||||
i -= 1;
|
i -= 1;
|
||||||
}
|
}
|
||||||
while (i++ < parts.length)
|
while (i++ < parts.length) {
|
||||||
parts[i] && tokens.push({
|
parts[i] && tokens.push({
|
||||||
value: parts[i],
|
value: parts[i],
|
||||||
type: "text"
|
type: "text"
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (replace) {
|
||||||
|
search = replace;
|
||||||
|
options = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (search) {
|
||||||
|
if (!/regex/.test(options))
|
||||||
|
search = lang.escapeRegExp(search);
|
||||||
|
if (/whole/.test(options))
|
||||||
|
search = "\\b" + search + "\\b";
|
||||||
|
}
|
||||||
|
|
||||||
|
var regex = search && safeCreateRegexp(
|
||||||
|
"(" + search + ")",
|
||||||
|
/ sensitive/.test(options) ? "g" : "ig"
|
||||||
|
);
|
||||||
|
if (regex) {
|
||||||
|
stack[0] = state;
|
||||||
|
stack[1] = regex;
|
||||||
|
}
|
||||||
|
|
||||||
return tokens;
|
return tokens;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocComme
|
||||||
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
||||||
|
|
||||||
// used by objective-c
|
// used by objective-c
|
||||||
var cFunctions = exports.cFunctions = "\\s*\\bhypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len)))\\b"
|
var cFunctions = exports.cFunctions = "\\b(?:hypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len))))\\b"
|
||||||
|
|
||||||
var c_cppHighlightRules = function() {
|
var c_cppHighlightRules = function() {
|
||||||
|
|
||||||
|
|
|
||||||
52
lib/ace/mode/cirru.js
Normal file
52
lib/ace/mode/cirru.js
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
/* ***** BEGIN LICENSE BLOCK *****
|
||||||
|
* Distributed under the BSD license:
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014, Ajax.org B.V.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* * Neither the name of Ajax.org B.V. nor the
|
||||||
|
* names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
|
define(function(require, exports, module) {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var oop = require("../lib/oop");
|
||||||
|
var TextMode = require("./text").Mode;
|
||||||
|
var Tokenizer = require("../tokenizer").Tokenizer;
|
||||||
|
var CirruHighlightRules = require("./cirru_highlight_rules").CirruHighlightRules;
|
||||||
|
var CoffeeFoldMode = require("./folding/coffee").FoldMode;
|
||||||
|
|
||||||
|
var Mode = function() {
|
||||||
|
this.HighlightRules = CirruHighlightRules;
|
||||||
|
this.foldingRules = new CoffeeFoldMode();
|
||||||
|
};
|
||||||
|
oop.inherits(Mode, TextMode);
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
this.lineCommentStart = "--";
|
||||||
|
this.$id = "ace/mode/cirru";
|
||||||
|
}).call(Mode.prototype);
|
||||||
|
|
||||||
|
exports.Mode = Mode;
|
||||||
|
});
|
||||||
121
lib/ace/mode/cirru_highlight_rules.js
Normal file
121
lib/ace/mode/cirru_highlight_rules.js
Normal file
|
|
@ -0,0 +1,121 @@
|
||||||
|
/* ***** BEGIN LICENSE BLOCK *****
|
||||||
|
* Distributed under the BSD license:
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014, Ajax.org B.V.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* * Neither the name of Ajax.org B.V. nor the
|
||||||
|
* names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
|
define(function(require, exports, module) {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var oop = require("../lib/oop");
|
||||||
|
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
||||||
|
|
||||||
|
// see http://cirru.org for more about this language
|
||||||
|
var CirruHighlightRules = function() {
|
||||||
|
this.$rules = {
|
||||||
|
start: [{
|
||||||
|
token: 'constant.numeric',
|
||||||
|
regex: /[\d\.]+/
|
||||||
|
}, {
|
||||||
|
token: 'comment.line.double-dash',
|
||||||
|
regex: /--/,
|
||||||
|
next: 'comment',
|
||||||
|
}, {
|
||||||
|
token: 'storage.modifier',
|
||||||
|
regex: /\(/,
|
||||||
|
}, {
|
||||||
|
token: 'support.function',
|
||||||
|
regex: /[^\(\)\"\s]+/,
|
||||||
|
next: 'line'
|
||||||
|
}, {
|
||||||
|
token: 'string.quoted.double',
|
||||||
|
regex: /"/,
|
||||||
|
next: 'string',
|
||||||
|
}, {
|
||||||
|
token: 'storage.modifier',
|
||||||
|
regex: /\)/,
|
||||||
|
}],
|
||||||
|
comment: [{
|
||||||
|
token: 'comment.line.double-dash',
|
||||||
|
regex: /\ +[^\n]+/,
|
||||||
|
next: 'start',
|
||||||
|
}],
|
||||||
|
string: [{
|
||||||
|
token: 'string.quoted.double',
|
||||||
|
regex: /"/,
|
||||||
|
next: 'line',
|
||||||
|
}, {
|
||||||
|
token: 'constant.character.escape',
|
||||||
|
regex: /\\/,
|
||||||
|
next: 'escape',
|
||||||
|
}, {
|
||||||
|
token: 'string.quoted.double',
|
||||||
|
regex: /[^\\\"]+/,
|
||||||
|
}],
|
||||||
|
escape: [{
|
||||||
|
token: 'constant.character.escape',
|
||||||
|
regex: /./,
|
||||||
|
next: 'string',
|
||||||
|
}],
|
||||||
|
line: [{
|
||||||
|
token: 'constant.numeric',
|
||||||
|
regex: /[\d\.]+/
|
||||||
|
}, {
|
||||||
|
token: 'markup.raw',
|
||||||
|
regex: /^\s*/,
|
||||||
|
next: 'start',
|
||||||
|
}, {
|
||||||
|
token: 'variable.parameter',
|
||||||
|
regex: /[^\(\)\"\s]+/
|
||||||
|
}, {
|
||||||
|
token: 'storage.modifier',
|
||||||
|
regex: /\(/,
|
||||||
|
next: 'start'
|
||||||
|
}, {
|
||||||
|
token: 'storage.modifier',
|
||||||
|
regex: /\)/,
|
||||||
|
}, {
|
||||||
|
token: 'markup.raw',
|
||||||
|
regex: /^\ */,
|
||||||
|
next: 'start',
|
||||||
|
}, {
|
||||||
|
token: 'storage.modifier',
|
||||||
|
regex: /\$/,
|
||||||
|
next: 'start',
|
||||||
|
}, {
|
||||||
|
token: 'string.quoted.double',
|
||||||
|
regex: /"/,
|
||||||
|
next: 'string',
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
oop.inherits(CirruHighlightRules, TextHighlightRules);
|
||||||
|
|
||||||
|
exports.CirruHighlightRules = CirruHighlightRules;
|
||||||
|
});
|
||||||
|
|
@ -37,11 +37,13 @@ var JavaScriptMode = require("./javascript").Mode;
|
||||||
var CssMode = require("./css").Mode;
|
var CssMode = require("./css").Mode;
|
||||||
var Tokenizer = require("../tokenizer").Tokenizer;
|
var Tokenizer = require("../tokenizer").Tokenizer;
|
||||||
var ColdfusionHighlightRules = require("./coldfusion_highlight_rules").ColdfusionHighlightRules;
|
var ColdfusionHighlightRules = require("./coldfusion_highlight_rules").ColdfusionHighlightRules;
|
||||||
|
var CfmlBehaviour = require("./behaviour/coldfusion").CfmlBehaviour;
|
||||||
|
|
||||||
var Mode = function() {
|
var Mode = function() {
|
||||||
XmlMode.call(this);
|
XmlMode.call(this);
|
||||||
|
|
||||||
this.HighlightRules = ColdfusionHighlightRules;
|
this.HighlightRules = ColdfusionHighlightRules;
|
||||||
|
this.$behaviour = new CfmlBehaviour();
|
||||||
|
|
||||||
this.createModeDelegates({
|
this.createModeDelegates({
|
||||||
"js-": JavaScriptMode,
|
"js-": JavaScriptMode,
|
||||||
|
|
|
||||||
|
|
@ -112,5 +112,9 @@ var Mode = function() {
|
||||||
};
|
};
|
||||||
oop.inherits(Mode, HtmlMode);
|
oop.inherits(Mode, HtmlMode);
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
this.$id = "ace/mode/django";
|
||||||
|
}).call(Mode.prototype);
|
||||||
|
|
||||||
exports.Mode = Mode;
|
exports.Mode = Mode;
|
||||||
});
|
});
|
||||||
|
|
@ -50,24 +50,30 @@ oop.inherits(FoldMode, BaseFoldMode);
|
||||||
var level1 = /^(Found.*|Searching for.*)$/;
|
var level1 = /^(Found.*|Searching for.*)$/;
|
||||||
var level2 = /^(\S.*\:|\s*)$/;
|
var level2 = /^(\S.*\:|\s*)$/;
|
||||||
var re = level1.test(line) ? level1 : level2;
|
var re = level1.test(line) ? level1 : level2;
|
||||||
|
|
||||||
|
var startRow = row;
|
||||||
|
var endRow = row;
|
||||||
|
|
||||||
if (this.foldingStartMarker.test(line)) {
|
if (this.foldingStartMarker.test(line)) {
|
||||||
for (var i = row + 1, l = session.getLength(); i < l; i++) {
|
for (var i = row + 1, l = session.getLength(); i < l; i++) {
|
||||||
if (re.test(lines[i]))
|
if (re.test(lines[i]))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
endRow = i;
|
||||||
return new Range(row, line.length, i, 0);
|
|
||||||
}
|
}
|
||||||
|
else if (this.foldingStopMarker.test(line)) {
|
||||||
if (this.foldingStopMarker.test(line)) {
|
|
||||||
for (var i = row - 1; i >= 0; i--) {
|
for (var i = row - 1; i >= 0; i--) {
|
||||||
line = lines[i];
|
line = lines[i];
|
||||||
if (re.test(line))
|
if (re.test(line))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
startRow = i;
|
||||||
return new Range(i, line.length, row, 0);
|
}
|
||||||
|
if (startRow != endRow) {
|
||||||
|
var col = line.length;
|
||||||
|
if (re === level1)
|
||||||
|
col = line.search(/\(Found[^)]+\)$|$/);
|
||||||
|
return new Range(startRow, col, endRow, 0);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -49,5 +49,9 @@ var Mode = function() {
|
||||||
};
|
};
|
||||||
oop.inherits(Mode, CMode);
|
oop.inherits(Mode, CMode);
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
this.$id = "ace/mode/glsl";
|
||||||
|
}).call(Mode.prototype);
|
||||||
|
|
||||||
exports.Mode = Mode;
|
exports.Mode = Mode;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -40,8 +40,10 @@ var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
|
||||||
var HtmlBehaviour = require("./behaviour/html").HtmlBehaviour;
|
var HtmlBehaviour = require("./behaviour/html").HtmlBehaviour;
|
||||||
var HtmlFoldMode = require("./folding/html").FoldMode;
|
var HtmlFoldMode = require("./folding/html").FoldMode;
|
||||||
var HtmlCompletions = require("./html_completions").HtmlCompletions;
|
var HtmlCompletions = require("./html_completions").HtmlCompletions;
|
||||||
|
var WorkerClient = require("../worker/worker_client").WorkerClient;
|
||||||
|
|
||||||
var Mode = function() {
|
var Mode = function(options) {
|
||||||
|
this.fragmentContext = options && options.fragmentContext;
|
||||||
this.HighlightRules = HtmlHighlightRules;
|
this.HighlightRules = HtmlHighlightRules;
|
||||||
this.$behaviour = new HtmlBehaviour();
|
this.$behaviour = new HtmlBehaviour();
|
||||||
this.$completer = new HtmlCompletions();
|
this.$completer = new HtmlCompletions();
|
||||||
|
|
@ -71,6 +73,26 @@ oop.inherits(Mode, TextMode);
|
||||||
return this.$completer.getCompletions(state, session, pos, prefix);
|
return this.$completer.getCompletions(state, session, pos, prefix);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.createWorker = function(session) {
|
||||||
|
if (this.constructor != Mode)
|
||||||
|
return;
|
||||||
|
var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker");
|
||||||
|
worker.attachToDocument(session.getDocument());
|
||||||
|
|
||||||
|
if (this.fragmentContext)
|
||||||
|
worker.call("setOptions", [{context: this.fragmentContext}]);
|
||||||
|
|
||||||
|
worker.on("error", function(e) {
|
||||||
|
session.setAnnotations(e.data);
|
||||||
|
});
|
||||||
|
|
||||||
|
worker.on("terminate", function() {
|
||||||
|
session.clearAnnotations();
|
||||||
|
});
|
||||||
|
|
||||||
|
return worker;
|
||||||
|
};
|
||||||
|
|
||||||
this.$id = "ace/mode/html";
|
this.$id = "ace/mode/html";
|
||||||
}).call(Mode.prototype);
|
}).call(Mode.prototype);
|
||||||
|
|
||||||
|
|
|
||||||
11113
lib/ace/mode/html/saxparser.js
Normal file
11113
lib/ace/mode/html/saxparser.js
Normal file
File diff suppressed because it is too large
Load diff
92
lib/ace/mode/html_worker.js
Normal file
92
lib/ace/mode/html_worker.js
Normal file
|
|
@ -0,0 +1,92 @@
|
||||||
|
/* ***** BEGIN LICENSE BLOCK *****
|
||||||
|
* Distributed under the BSD license:
|
||||||
|
*
|
||||||
|
* Copyright (c) 2010, Ajax.org B.V.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* * Neither the name of Ajax.org B.V. nor the
|
||||||
|
* names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
|
define(function(require, exports, module) {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var oop = require("../lib/oop");
|
||||||
|
var lang = require("../lib/lang");
|
||||||
|
var Mirror = require("../worker/mirror").Mirror;
|
||||||
|
var SAXParser = require("./html/saxparser").SAXParser;
|
||||||
|
|
||||||
|
var errorTypes = {
|
||||||
|
"expected-doctype-but-got-start-tag": "info",
|
||||||
|
"expected-doctype-but-got-chars": "info",
|
||||||
|
"non-html-root": "info",
|
||||||
|
}
|
||||||
|
|
||||||
|
var Worker = exports.Worker = function(sender) {
|
||||||
|
Mirror.call(this, sender);
|
||||||
|
this.setTimeout(400);
|
||||||
|
this.context = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
oop.inherits(Worker, Mirror);
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
|
||||||
|
this.setOptions = function(options) {
|
||||||
|
this.context = options.context;
|
||||||
|
};
|
||||||
|
|
||||||
|
this.onUpdate = function() {
|
||||||
|
var value = this.doc.getValue();
|
||||||
|
if (!value)
|
||||||
|
return;
|
||||||
|
var parser = new SAXParser();
|
||||||
|
var errors = [];
|
||||||
|
var noop = function(){};
|
||||||
|
parser.contentHandler = {
|
||||||
|
startDocument: noop,
|
||||||
|
endDocument: noop,
|
||||||
|
startElement: noop,
|
||||||
|
endElement: noop,
|
||||||
|
characters: noop
|
||||||
|
};
|
||||||
|
parser.errorHandler = {
|
||||||
|
error: function(message, location, code) {
|
||||||
|
errors.push({
|
||||||
|
row: location.line,
|
||||||
|
column: location.column,
|
||||||
|
text: message,
|
||||||
|
type: errorTypes[code] || "error"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
if (this.context)
|
||||||
|
parser.parseFragment(value, this.context);
|
||||||
|
else
|
||||||
|
parser.parse(value);
|
||||||
|
this.sender.emit("error", errors);
|
||||||
|
};
|
||||||
|
|
||||||
|
}).call(Worker.prototype);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
@ -9,6 +9,7 @@ define(function(require, exports, module){
|
||||||
if (that = require('../mode/matching_brace_outdent')) {
|
if (that = require('../mode/matching_brace_outdent')) {
|
||||||
this.$outdent = new that.MatchingBraceOutdent;
|
this.$outdent = new that.MatchingBraceOutdent;
|
||||||
}
|
}
|
||||||
|
this.$id = "ace/mode/livescript";
|
||||||
}
|
}
|
||||||
indenter = RegExp('(?:[({[=:]|[-~]>|\\b(?:e(?:lse|xport)|d(?:o|efault)|t(?:ry|hen)|finally|import(?:\\s*all)?|const|var|let|new|catch(?:\\s*' + identifier + ')?))\\s*$');
|
indenter = RegExp('(?:[({[=:]|[-~]>|\\b(?:e(?:lse|xport)|d(?:o|efault)|t(?:ry|hen)|finally|import(?:\\s*all)?|const|var|let|new|catch(?:\\s*' + identifier + ')?))\\s*$');
|
||||||
prototype.getNextLineIndent = function(state, line, tab){
|
prototype.getNextLineIndent = function(state, line, tab){
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ var LuaHighlightRules = function() {
|
||||||
"constant.library": stdLibaries,
|
"constant.library": stdLibaries,
|
||||||
"constant.language": builtinConstants,
|
"constant.language": builtinConstants,
|
||||||
"invalid.illegal": futureReserved,
|
"invalid.illegal": futureReserved,
|
||||||
"variable.language": "this"
|
"variable.language": "self"
|
||||||
}, "identifier");
|
}, "identifier");
|
||||||
|
|
||||||
var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))";
|
var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))";
|
||||||
|
|
|
||||||
|
|
@ -17,5 +17,9 @@ var Mode = function() {
|
||||||
};
|
};
|
||||||
oop.inherits(Mode, HtmlMode);
|
oop.inherits(Mode, HtmlMode);
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
this.$id = "ace/mode/luapage";
|
||||||
|
}).call(Mode.prototype);
|
||||||
|
|
||||||
exports.Mode = Mode;
|
exports.Mode = Mode;
|
||||||
});
|
});
|
||||||
|
|
@ -12,5 +12,9 @@ var Mode = function() {
|
||||||
|
|
||||||
oop.inherits(Mode, TextMode);
|
oop.inherits(Mode, TextMode);
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
this.$id = "ace/mode/lucene";
|
||||||
|
}).call(Mode.prototype);
|
||||||
|
|
||||||
exports.Mode = Mode;
|
exports.Mode = Mode;
|
||||||
});
|
});
|
||||||
|
|
@ -49,7 +49,7 @@ oop.inherits(Mode, TextMode);
|
||||||
|
|
||||||
this.lineCommentStart = "//";
|
this.lineCommentStart = "//";
|
||||||
this.blockComment = {start: "/*", end: "*/"};
|
this.blockComment = {start: "/*", end: "*/"};
|
||||||
|
this.$id = "ace/mode/mel";
|
||||||
}).call(Mode.prototype);
|
}).call(Mode.prototype);
|
||||||
|
|
||||||
exports.Mode = Mode;
|
exports.Mode = Mode;
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ define(function(require, exports, module) {
|
||||||
var oop = require("../lib/oop");
|
var oop = require("../lib/oop");
|
||||||
var TextMode = require("./text").Mode;
|
var TextMode = require("./text").Mode;
|
||||||
var Tokenizer = require("../tokenizer").Tokenizer;
|
var Tokenizer = require("../tokenizer").Tokenizer;
|
||||||
var MushCodeRules = require("./mushcode_high_rules").MushCodeRules;
|
var MushCodeRules = require("./mushcode_highlight_rules").MushCodeRules;
|
||||||
var PythonFoldMode = require("./folding/pythonic").FoldMode;
|
var PythonFoldMode = require("./folding/pythonic").FoldMode;
|
||||||
var Range = require("../range").Range;
|
var Range = require("../range").Range;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -969,13 +969,11 @@ var PhpLangHighlightRules = function() {
|
||||||
else if (value == "debugger")
|
else if (value == "debugger")
|
||||||
return "invalid.deprecated";
|
return "invalid.deprecated";
|
||||||
else
|
else
|
||||||
if(value.match(/^(\$[a-zA-Z][a-zA-Z0-9_]*|self|parent)$/))
|
if(value.match(/^(\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*|self|parent)$/))
|
||||||
return "variable";
|
return "variable";
|
||||||
return "identifier";
|
return "identifier";
|
||||||
},
|
},
|
||||||
// TODO: Unicode escape sequences
|
regex : "[a-zA-Z_$\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*\\b"
|
||||||
// TODO: Unicode identifiers
|
|
||||||
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
|
|
||||||
}, {
|
}, {
|
||||||
onMatch : function(value, currentSate, state) {
|
onMatch : function(value, currentSate, state) {
|
||||||
value = value.substr(3);
|
value = value.substr(3);
|
||||||
|
|
|
||||||
|
|
@ -41,5 +41,9 @@ var Mode = function() {
|
||||||
};
|
};
|
||||||
oop.inherits(Mode, TextMode);
|
oop.inherits(Mode, TextMode);
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
this.$id = "ace/mode/properties";
|
||||||
|
}).call(Mode.prototype);
|
||||||
|
|
||||||
exports.Mode = Mode;
|
exports.Mode = Mode;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -8,11 +8,31 @@
|
||||||
* Portions created by the Initial Developer are Copyright (C) 2010
|
* Portions created by the Initial Developer are Copyright (C) 2010
|
||||||
* the Initial Developer. All Rights Reserved.
|
* the Initial Developer. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* This program is licensed to you under the terms of version 3 of the
|
* Distributed under the BSD license:
|
||||||
* GNU Affero General Public License. This program is distributed WITHOUT
|
*
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT,
|
* Copyright (c) 2010, Ajax.org B.V.
|
||||||
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the
|
* All rights reserved.
|
||||||
* AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details.
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* * Neither the name of Ajax.org B.V. nor the
|
||||||
|
* names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
define(function(require, exports, module)
|
define(function(require, exports, module)
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,31 @@
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-11 by RStudio, Inc.
|
* Copyright (C) 2009-11 by RStudio, Inc.
|
||||||
*
|
*
|
||||||
* This program is licensed to you under the terms of version 3 of the
|
* Distributed under the BSD license:
|
||||||
* GNU Affero General Public License. This program is distributed WITHOUT
|
*
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT,
|
* Copyright (c) 2010, Ajax.org B.V.
|
||||||
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the
|
* All rights reserved.
|
||||||
* AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details.
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* * Neither the name of Ajax.org B.V. nor the
|
||||||
|
* names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
|
|
|
||||||
|
|
@ -8,11 +8,31 @@
|
||||||
* Portions created by the Initial Developer are Copyright (C) 2010
|
* Portions created by the Initial Developer are Copyright (C) 2010
|
||||||
* the Initial Developer. All Rights Reserved.
|
* the Initial Developer. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* This program is licensed to you under the terms of version 3 of the
|
* Distributed under the BSD license:
|
||||||
* GNU Affero General Public License. This program is distributed WITHOUT
|
*
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT,
|
* Copyright (c) 2010, Ajax.org B.V.
|
||||||
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the
|
* All rights reserved.
|
||||||
* AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details.
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* * Neither the name of Ajax.org B.V. nor the
|
||||||
|
* names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
|
|
|
||||||
58
lib/ace/mode/smarty.js
Normal file
58
lib/ace/mode/smarty.js
Normal file
|
|
@ -0,0 +1,58 @@
|
||||||
|
/* ***** BEGIN LICENSE BLOCK *****
|
||||||
|
* Distributed under the BSD license:
|
||||||
|
*
|
||||||
|
* Copyright (c) 2012, Ajax.org B.V.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* * Neither the name of Ajax.org B.V. nor the
|
||||||
|
* names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
|
define(function(require, exports, module) {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var oop = require("../lib/oop");
|
||||||
|
var HtmlMode = require("./html").Mode;
|
||||||
|
var Tokenizer = require("../tokenizer").Tokenizer;
|
||||||
|
var SmartyHighlightRules = require("./smarty_highlight_rules").SmartyHighlightRules;
|
||||||
|
var HtmlBehaviour = require("./behaviour/html").HtmlBehaviour;
|
||||||
|
var HtmlFoldMode = require("./folding/html").FoldMode;
|
||||||
|
|
||||||
|
var Mode = function() {
|
||||||
|
HtmlMode.call(this);
|
||||||
|
this.HighlightRules = SmartyHighlightRules;
|
||||||
|
this.$behaviour = new HtmlBehaviour();
|
||||||
|
|
||||||
|
|
||||||
|
this.foldingRules = new HtmlFoldMode();
|
||||||
|
};
|
||||||
|
|
||||||
|
oop.inherits(Mode, HtmlMode);
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
|
||||||
|
this.$id = "ace/mode/smarty";
|
||||||
|
}).call(Mode.prototype);
|
||||||
|
|
||||||
|
exports.Mode = Mode;
|
||||||
|
});
|
||||||
139
lib/ace/mode/smarty_highlight_rules.js
Normal file
139
lib/ace/mode/smarty_highlight_rules.js
Normal file
|
|
@ -0,0 +1,139 @@
|
||||||
|
/* ***** BEGIN LICENSE BLOCK *****
|
||||||
|
* Distributed under the BSD license:
|
||||||
|
*
|
||||||
|
* Copyright (c) 2012, Ajax.org B.V.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* * Neither the name of Ajax.org B.V. nor the
|
||||||
|
* names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
|
/* This file was autogenerated from https://raw.github.com/amitsnyderman/sublime-smarty/master/Syntaxes/Smarty.tmLanguage (uuid: ) */
|
||||||
|
/****************************************************************************************
|
||||||
|
* IT MIGHT NOT BE PERFECT ...But it's a good start from an existing *.tmlanguage file. *
|
||||||
|
* fileTypes *
|
||||||
|
****************************************************************************************/
|
||||||
|
|
||||||
|
define(function(require, exports, module) {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var oop = require("../lib/oop");
|
||||||
|
var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
|
||||||
|
|
||||||
|
var SmartyHighlightRules = function() {
|
||||||
|
HtmlHighlightRules.call(this);
|
||||||
|
var smartyRules = { start:
|
||||||
|
[ { include: '#comments' },
|
||||||
|
{ include: '#blocks' } ],
|
||||||
|
'#blocks':
|
||||||
|
[ { token: 'punctuation.section.embedded.begin.smarty',
|
||||||
|
regex: '\\{%?',
|
||||||
|
push:
|
||||||
|
[ { token: 'punctuation.section.embedded.end.smarty',
|
||||||
|
regex: '%?\\}',
|
||||||
|
next: 'pop' },
|
||||||
|
{ include: '#strings' },
|
||||||
|
{ include: '#variables' },
|
||||||
|
{ include: '#lang' },
|
||||||
|
{ defaultToken: 'source.smarty' } ] } ],
|
||||||
|
'#comments':
|
||||||
|
[ { token:
|
||||||
|
[ 'punctuation.definition.comment.smarty',
|
||||||
|
'comment.block.smarty' ],
|
||||||
|
regex: '(\\{%?)(\\*)',
|
||||||
|
push:
|
||||||
|
[ { token: 'comment.block.smarty', regex: '\\*%?\\}', next: 'pop' },
|
||||||
|
{ defaultToken: 'comment.block.smarty' } ] } ],
|
||||||
|
'#lang':
|
||||||
|
[ { token: 'keyword.operator.smarty',
|
||||||
|
regex: '(?:!=|!|<=|>=|<|>|===|==|%|&&|\\|\\|)|\\b(?:and|or|eq|neq|ne|gte|gt|ge|lte|lt|le|not|mod)\\b' },
|
||||||
|
{ token: 'constant.language.smarty',
|
||||||
|
regex: '\\b(?:TRUE|FALSE|true|false)\\b' },
|
||||||
|
{ token: 'keyword.control.smarty',
|
||||||
|
regex: '\\b(?:if|else|elseif|foreach|foreachelse|section|switch|case|break|default)\\b' },
|
||||||
|
{ token: 'variable.parameter.smarty', regex: '\\b[a-zA-Z]+=' },
|
||||||
|
{ token: 'support.function.built-in.smarty',
|
||||||
|
regex: '\\b(?:capture|config_load|counter|cycle|debug|eval|fetch|include_php|include|insert|literal|math|strip|rdelim|ldelim|assign|constant|block|html_[a-z_]*)\\b' },
|
||||||
|
{ token: 'support.function.variable-modifier.smarty',
|
||||||
|
regex: '\\|(?:capitalize|cat|count_characters|count_paragraphs|count_sentences|count_words|date_format|default|escape|indent|lower|nl2br|regex_replace|replace|spacify|string_format|strip_tags|strip|truncate|upper|wordwrap)' } ],
|
||||||
|
'#strings':
|
||||||
|
[ { token: 'punctuation.definition.string.begin.smarty',
|
||||||
|
regex: '\'',
|
||||||
|
push:
|
||||||
|
[ { token: 'punctuation.definition.string.end.smarty',
|
||||||
|
regex: '\'',
|
||||||
|
next: 'pop' },
|
||||||
|
{ token: 'constant.character.escape.smarty', regex: '\\\\.' },
|
||||||
|
{ defaultToken: 'string.quoted.single.smarty' } ] },
|
||||||
|
{ token: 'punctuation.definition.string.begin.smarty',
|
||||||
|
regex: '"',
|
||||||
|
push:
|
||||||
|
[ { token: 'punctuation.definition.string.end.smarty',
|
||||||
|
regex: '"',
|
||||||
|
next: 'pop' },
|
||||||
|
{ token: 'constant.character.escape.smarty', regex: '\\\\.' },
|
||||||
|
{ defaultToken: 'string.quoted.double.smarty' } ] } ],
|
||||||
|
'#variables':
|
||||||
|
[ { token:
|
||||||
|
[ 'punctuation.definition.variable.smarty',
|
||||||
|
'variable.other.global.smarty' ],
|
||||||
|
regex: '\\b(\\$)(Smarty\\.)' },
|
||||||
|
{ token:
|
||||||
|
[ 'punctuation.definition.variable.smarty',
|
||||||
|
'variable.other.smarty' ],
|
||||||
|
regex: '(\\$)([a-zA-Z_][a-zA-Z0-9_]*)\\b' },
|
||||||
|
{ token: [ 'keyword.operator.smarty', 'variable.other.property.smarty' ],
|
||||||
|
regex: '(->)([a-zA-Z_][a-zA-Z0-9_]*)\\b' },
|
||||||
|
{ token:
|
||||||
|
[ 'keyword.operator.smarty',
|
||||||
|
'meta.function-call.object.smarty',
|
||||||
|
'punctuation.definition.variable.smarty',
|
||||||
|
'variable.other.smarty',
|
||||||
|
'punctuation.definition.variable.smarty' ],
|
||||||
|
regex: '(->)([a-zA-Z_][a-zA-Z0-9_]*)(\\()(.*?)(\\))' } ] }
|
||||||
|
|
||||||
|
var smartyStart = smartyRules.start;
|
||||||
|
|
||||||
|
["start", "qqstring_inner", "qstring_inner", "attributes", "cdata"].forEach(function(x) {
|
||||||
|
this.$rules[x].unshift.apply(this.$rules[x], smartyStart);
|
||||||
|
}, this);
|
||||||
|
|
||||||
|
Object.keys(smartyRules).forEach(function(x) {
|
||||||
|
if (!this.$rules[x])
|
||||||
|
this.$rules[x] = smartyRules[x];
|
||||||
|
}, this);
|
||||||
|
|
||||||
|
this.normalizeRules();
|
||||||
|
};
|
||||||
|
|
||||||
|
SmartyHighlightRules.metaData = { fileTypes: [ 'tpl' ],
|
||||||
|
foldingStartMarker: '\\{%?',
|
||||||
|
foldingStopMarker: '%?\\}',
|
||||||
|
name: 'Smarty',
|
||||||
|
scopeName: 'text.html.smarty' }
|
||||||
|
|
||||||
|
|
||||||
|
oop.inherits(SmartyHighlightRules, HtmlHighlightRules);
|
||||||
|
|
||||||
|
exports.SmartyHighlightRules = SmartyHighlightRules;
|
||||||
|
});
|
||||||
|
|
@ -59,6 +59,10 @@ var SqlHighlightRules = function() {
|
||||||
"start" : [ {
|
"start" : [ {
|
||||||
token : "comment",
|
token : "comment",
|
||||||
regex : "--.*$"
|
regex : "--.*$"
|
||||||
|
}, {
|
||||||
|
token : "comment",
|
||||||
|
start : "/\\*",
|
||||||
|
end : "\\*/"
|
||||||
}, {
|
}, {
|
||||||
token : "string", // " string
|
token : "string", // " string
|
||||||
regex : '".*?"'
|
regex : '".*?"'
|
||||||
|
|
@ -85,6 +89,7 @@ var SqlHighlightRules = function() {
|
||||||
regex : "\\s+"
|
regex : "\\s+"
|
||||||
} ]
|
} ]
|
||||||
};
|
};
|
||||||
|
this.normalizeRules();
|
||||||
};
|
};
|
||||||
|
|
||||||
oop.inherits(SqlHighlightRules, TextHighlightRules);
|
oop.inherits(SqlHighlightRules, TextHighlightRules);
|
||||||
|
|
|
||||||
|
|
@ -8,11 +8,31 @@
|
||||||
* Portions created by the Initial Developer are Copyright (C) 2010
|
* Portions created by the Initial Developer are Copyright (C) 2010
|
||||||
* the Initial Developer. All Rights Reserved.
|
* the Initial Developer. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* This program is licensed to you under the terms of version 3 of the
|
* Distributed under the BSD license:
|
||||||
* GNU Affero General Public License. This program is distributed WITHOUT
|
*
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT,
|
* Copyright (c) 2010, Ajax.org B.V.
|
||||||
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the
|
* All rights reserved.
|
||||||
* AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details.
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* * Neither the name of Ajax.org B.V. nor the
|
||||||
|
* names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ var Mode = function() {
|
||||||
+ unicode.packages.L
|
+ unicode.packages.L
|
||||||
+ unicode.packages.Mn + unicode.packages.Mc
|
+ unicode.packages.Mn + unicode.packages.Mc
|
||||||
+ unicode.packages.Nd
|
+ unicode.packages.Nd
|
||||||
+ unicode.packages.Pc + "\\$_]|\s])+", "g"
|
+ unicode.packages.Pc + "\\$_]|\\s])+", "g"
|
||||||
);
|
);
|
||||||
|
|
||||||
this.getTokenizer = function() {
|
this.getTokenizer = function() {
|
||||||
|
|
@ -217,10 +217,10 @@ var Mode = function() {
|
||||||
var row = iterator.getCurrentTokenRow();
|
var row = iterator.getCurrentTokenRow();
|
||||||
var column = iterator.getCurrentTokenColumn() + i;
|
var column = iterator.getCurrentTokenColumn() + i;
|
||||||
startRange = new Range(row, column, row, column + comment.start.length);
|
startRange = new Range(row, column, row, column + comment.start.length);
|
||||||
break
|
break;
|
||||||
}
|
}
|
||||||
token = iterator.stepBackward();
|
token = iterator.stepBackward();
|
||||||
};
|
}
|
||||||
|
|
||||||
var iterator = new TokenIterator(session, cursor.row, cursor.column);
|
var iterator = new TokenIterator(session, cursor.row, cursor.column);
|
||||||
var token = iterator.getCurrentToken();
|
var token = iterator.getCurrentToken();
|
||||||
|
|
@ -239,10 +239,10 @@ var Mode = function() {
|
||||||
if (startRange) {
|
if (startRange) {
|
||||||
session.remove(startRange);
|
session.remove(startRange);
|
||||||
startRow = startRange.start.row;
|
startRow = startRange.start.row;
|
||||||
colDiff = -comment.start.length
|
colDiff = -comment.start.length;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
colDiff = comment.start.length
|
colDiff = comment.start.length;
|
||||||
startRow = range.start.row;
|
startRow = range.start.row;
|
||||||
session.insert(range.end, comment.end);
|
session.insert(range.end, comment.end);
|
||||||
session.insert(range.start, comment.start);
|
session.insert(range.start, comment.start);
|
||||||
|
|
@ -284,7 +284,8 @@ var Mode = function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var delegations = ['toggleCommentLines', 'getNextLineIndent', 'checkOutdent', 'autoOutdent', 'transformAction', 'getCompletions'];
|
var delegations = ['toggleBlockComment', 'toggleCommentLines', 'getNextLineIndent',
|
||||||
|
'checkOutdent', 'autoOutdent', 'transformAction', 'getCompletions'];
|
||||||
|
|
||||||
for (var i = 0; i < delegations.length; i++) {
|
for (var i = 0; i < delegations.length; i++) {
|
||||||
(function(scope) {
|
(function(scope) {
|
||||||
|
|
@ -292,7 +293,7 @@ var Mode = function() {
|
||||||
var defaultHandler = scope[functionName];
|
var defaultHandler = scope[functionName];
|
||||||
scope[delegations[i]] = function() {
|
scope[delegations[i]] = function() {
|
||||||
return this.$delegator(functionName, arguments, defaultHandler);
|
return this.$delegator(functionName, arguments, defaultHandler);
|
||||||
}
|
};
|
||||||
} (this));
|
} (this));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -364,7 +365,7 @@ var Mode = function() {
|
||||||
if (!this.$highlightRules)
|
if (!this.$highlightRules)
|
||||||
this.getTokenizer();
|
this.getTokenizer();
|
||||||
return this.$keywordList = this.$highlightRules.$keywordList || [];
|
return this.$keywordList = this.$highlightRules.$keywordList || [];
|
||||||
}
|
};
|
||||||
|
|
||||||
this.getCompletions = function(state, session, pos, prefix) {
|
this.getCompletions = function(state, session, pos, prefix) {
|
||||||
var keywords = this.$keywordList || this.$createKeywordList();
|
var keywords = this.$keywordList || this.$createKeywordList();
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,9 @@ var TextHighlightRules = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.embedRules = function (HighlightRules, prefix, escapeRules, states, append) {
|
this.embedRules = function (HighlightRules, prefix, escapeRules, states, append) {
|
||||||
var embedRules = new HighlightRules().getRules();
|
var embedRules = typeof HighlightRules == "function"
|
||||||
|
? new HighlightRules().getRules()
|
||||||
|
: HighlightRules;
|
||||||
if (states) {
|
if (states) {
|
||||||
for (var i = 0; i < states.length; i++)
|
for (var i = 0; i < states.length; i++)
|
||||||
states[i] = prefix + states[i];
|
states[i] = prefix + states[i];
|
||||||
|
|
@ -108,15 +110,14 @@ var TextHighlightRules = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
var pushState = function(currentState, stack) {
|
var pushState = function(currentState, stack) {
|
||||||
if (currentState != "start")
|
if (currentState != "start" || stack.length)
|
||||||
stack.unshift(this.nextState, currentState);
|
stack.unshift(this.nextState, currentState);
|
||||||
return this.nextState;
|
return this.nextState;
|
||||||
};
|
};
|
||||||
var popState = function(currentState, stack) {
|
var popState = function(currentState, stack) {
|
||||||
if (stack[0] !== currentState)
|
// if (stack[0] === currentState)
|
||||||
return "start";
|
|
||||||
stack.shift();
|
stack.shift();
|
||||||
return stack.shift();
|
return stack.shift() || "start";
|
||||||
};
|
};
|
||||||
|
|
||||||
this.normalizeRules = function() {
|
this.normalizeRules = function() {
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,15 @@ function GutterHandler(mouseHandler) {
|
||||||
tooltip.show();
|
tooltip.show();
|
||||||
editor.on("mousewheel", hideTooltip);
|
editor.on("mousewheel", hideTooltip);
|
||||||
|
|
||||||
moveTooltip(mouseEvent);
|
if (mouseHandler.$tooltipFollowsMouse) {
|
||||||
|
moveTooltip(mouseEvent);
|
||||||
|
} else {
|
||||||
|
var gutterElement = gutter.$cells[row].element;
|
||||||
|
var rect = gutterElement.getBoundingClientRect();
|
||||||
|
var style = tooltip.getElement().style;
|
||||||
|
style.left = rect.right + "px";
|
||||||
|
style.top = rect.bottom + "px";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function hideTooltip() {
|
function hideTooltip() {
|
||||||
|
|
@ -112,7 +120,7 @@ function GutterHandler(mouseHandler) {
|
||||||
if (dom.hasCssClass(target, "ace_fold-widget"))
|
if (dom.hasCssClass(target, "ace_fold-widget"))
|
||||||
return hideTooltip();
|
return hideTooltip();
|
||||||
|
|
||||||
if (tooltipAnnotation)
|
if (tooltipAnnotation && mouseHandler.$tooltipFollowsMouse)
|
||||||
moveTooltip(e);
|
moveTooltip(e);
|
||||||
|
|
||||||
mouseEvent = e;
|
mouseEvent = e;
|
||||||
|
|
|
||||||
|
|
@ -238,7 +238,7 @@ function DefaultHandlers(mouseHandler) {
|
||||||
if (ev.getAccelKey())
|
if (ev.getAccelKey())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//shift wheel to horiz scroll
|
//shift wheel to horiz scroll
|
||||||
if (ev.getShiftKey() && ev.wheelY && !ev.wheelX) {
|
if (ev.getShiftKey() && ev.wheelY && !ev.wheelX) {
|
||||||
ev.wheelX = ev.wheelY;
|
ev.wheelX = ev.wheelY;
|
||||||
ev.wheelY = 0;
|
ev.wheelY = 0;
|
||||||
|
|
|
||||||
|
|
@ -153,7 +153,8 @@ config.defineOptions(MouseHandler.prototype, "mouseHandler", {
|
||||||
scrollSpeed: {initialValue: 2},
|
scrollSpeed: {initialValue: 2},
|
||||||
dragDelay: {initialValue: 150},
|
dragDelay: {initialValue: 150},
|
||||||
dragEnabled: {initialValue: true},
|
dragEnabled: {initialValue: true},
|
||||||
focusTimout: {initialValue: 0}
|
focusTimout: {initialValue: 0},
|
||||||
|
tooltipFollowsMouse: {initialValue: true}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ var EditSession = require("./edit_session").EditSession;
|
||||||
this.$onRemoveRange(removed);
|
this.$onRemoveRange(removed);
|
||||||
|
|
||||||
if (this.rangeCount > 1 && !this.inMultiSelectMode) {
|
if (this.rangeCount > 1 && !this.inMultiSelectMode) {
|
||||||
this._emit("multiSelect");
|
this._signal("multiSelect");
|
||||||
this.inMultiSelectMode = true;
|
this.inMultiSelectMode = true;
|
||||||
this.session.$undoSelect = false;
|
this.session.$undoSelect = false;
|
||||||
this.rangeList.attach(this.session);
|
this.rangeList.attach(this.session);
|
||||||
|
|
@ -150,7 +150,7 @@ var EditSession = require("./edit_session").EditSession;
|
||||||
this.$onAddRange = function(range) {
|
this.$onAddRange = function(range) {
|
||||||
this.rangeCount = this.rangeList.ranges.length;
|
this.rangeCount = this.rangeList.ranges.length;
|
||||||
this.ranges.unshift(range);
|
this.ranges.unshift(range);
|
||||||
this._emit("addRange", {range: range});
|
this._signal("addRange", {range: range});
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$onRemoveRange = function(removed) {
|
this.$onRemoveRange = function(removed) {
|
||||||
|
|
@ -166,11 +166,11 @@ var EditSession = require("./edit_session").EditSession;
|
||||||
this.ranges.splice(index, 1);
|
this.ranges.splice(index, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
this._emit("removeRange", {ranges: removed});
|
this._signal("removeRange", {ranges: removed});
|
||||||
|
|
||||||
if (this.rangeCount == 0 && this.inMultiSelectMode) {
|
if (this.rangeCount == 0 && this.inMultiSelectMode) {
|
||||||
this.inMultiSelectMode = false;
|
this.inMultiSelectMode = false;
|
||||||
this._emit("singleSelect");
|
this._signal("singleSelect");
|
||||||
this.session.$undoSelect = true;
|
this.session.$undoSelect = true;
|
||||||
this.rangeList.detach(this.session);
|
this.rangeList.detach(this.session);
|
||||||
}
|
}
|
||||||
|
|
@ -542,7 +542,10 @@ var Editor = require("./editor").Editor;
|
||||||
if (this.$readOnly)
|
if (this.$readOnly)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this._signal("paste", text);
|
|
||||||
|
var e = {text: text};
|
||||||
|
this._signal("paste", e);
|
||||||
|
text = e.text;
|
||||||
if (!this.inMultiSelectMode || this.inVirtualSelectionMode)
|
if (!this.inMultiSelectMode || this.inVirtualSelectionMode)
|
||||||
return this.insert(text);
|
return this.insert(text);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -143,20 +143,27 @@ var Search = function() {
|
||||||
if (options.$isMultiLine) {
|
if (options.$isMultiLine) {
|
||||||
var len = re.length;
|
var len = re.length;
|
||||||
var maxRow = lines.length - len;
|
var maxRow = lines.length - len;
|
||||||
for (var row = re.offset || 0; row <= maxRow; row++) {
|
var prevRange;
|
||||||
|
outer: for (var row = re.offset || 0; row <= maxRow; row++) {
|
||||||
for (var j = 0; j < len; j++)
|
for (var j = 0; j < len; j++)
|
||||||
if (lines[row + j].search(re[j]) == -1)
|
if (lines[row + j].search(re[j]) == -1)
|
||||||
break;
|
continue outer;
|
||||||
|
|
||||||
var startLine = lines[row];
|
var startLine = lines[row];
|
||||||
var line = lines[row + len - 1];
|
var line = lines[row + len - 1];
|
||||||
var startIndex = startLine.match(re[0])[0].length;
|
var startIndex = startLine.length - startLine.match(re[0])[0].length;
|
||||||
var endIndex = line.match(re[len - 1])[0].length;
|
var endIndex = line.match(re[len - 1])[0].length;
|
||||||
|
|
||||||
ranges.push(new Range(
|
if (prevRange && prevRange.end.row === row &&
|
||||||
row, startLine.length - startIndex,
|
prevRange.end.column > startIndex
|
||||||
row + len - 1, endIndex
|
) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
ranges.push(prevRange = new Range(
|
||||||
|
row, startIndex, row + len - 1, endIndex
|
||||||
));
|
));
|
||||||
|
if (len > 2)
|
||||||
|
row = row + len - 2;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (var i = 0; i < lines.length; i++) {
|
for (var i = 0; i < lines.length; i++) {
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@ var SnippetManager = function() {
|
||||||
// defult but can't fill :(
|
// defult but can't fill :(
|
||||||
case "FILENAME":
|
case "FILENAME":
|
||||||
case "FILEPATH":
|
case "FILEPATH":
|
||||||
return "ace.ajax.org";
|
return "";
|
||||||
case "FULLNAME":
|
case "FULLNAME":
|
||||||
return "Ace";
|
return "Ace";
|
||||||
}
|
}
|
||||||
|
|
@ -329,8 +329,11 @@ var SnippetManager = function() {
|
||||||
continue;
|
continue;
|
||||||
var id = p.tabstopId;
|
var id = p.tabstopId;
|
||||||
var i1 = tokens.indexOf(p, i + 1);
|
var i1 = tokens.indexOf(p, i + 1);
|
||||||
if (expanding[id] == p) {
|
if (expanding[id]) {
|
||||||
expanding[id] = null;
|
// if reached closing bracket clear expanding state
|
||||||
|
if (expanding[id] === p)
|
||||||
|
expanding[id] = null;
|
||||||
|
// otherwise just ignore recursive tabstop
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,8 @@ snippet from
|
||||||
# Module Docstring
|
# Module Docstring
|
||||||
snippet docs
|
snippet docs
|
||||||
'''
|
'''
|
||||||
File: ${1:`Filename('$1.py', 'foo.py')`}
|
File: ${1:FILENAME:file_name}
|
||||||
Author: ${2:`g:snips_author`}
|
Author: ${2:author}
|
||||||
Description: ${3}
|
Description: ${3}
|
||||||
'''
|
'''
|
||||||
snippet wh
|
snippet wh
|
||||||
|
|
@ -129,7 +129,7 @@ snippet "
|
||||||
"""
|
"""
|
||||||
# test function/method
|
# test function/method
|
||||||
snippet test
|
snippet test
|
||||||
def test_${1:description}(${2:`indent('.') ? 'self' : ''`}):
|
def test_${1:description}(${2:self}):
|
||||||
${3:# TODO: write code...}
|
${3:# TODO: write code...}
|
||||||
# test case
|
# test case
|
||||||
snippet testcase
|
snippet testcase
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
.ace-chrome {
|
.ace-chrome {
|
||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
|
color: black;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-chrome .ace_cursor {
|
.ace-chrome .ace_cursor {
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
.ace-dreamweaver {
|
.ace-dreamweaver {
|
||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
|
color: black;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-dreamweaver .ace_fold {
|
.ace-dreamweaver .ace_fold {
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
.ace-eclipse {
|
.ace-eclipse {
|
||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
|
color: black;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-eclipse .ace_fold {
|
.ace-eclipse .ace_fold {
|
||||||
|
|
|
||||||
|
|
@ -50,8 +50,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-kuroir .ace_fold {
|
.ace-kuroir .ace_fold {
|
||||||
background-color: ;
|
border-color: #363636;
|
||||||
border-color: #363636;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -65,4 +64,4 @@ color:#FD1732;
|
||||||
background-color:#E8E9E8;}.ace-kuroir .ace_string{color:#639300;}.ace-kuroir .ace_string.ace_regexp{color:#417E00;
|
background-color:#E8E9E8;}.ace-kuroir .ace_string{color:#639300;}.ace-kuroir .ace_string.ace_regexp{color:#417E00;
|
||||||
background-color:#C9D4BE;}.ace-kuroir .ace_comment{color:rgba(148, 148, 148, 0.91);
|
background-color:#C9D4BE;}.ace-kuroir .ace_comment{color:rgba(148, 148, 148, 0.91);
|
||||||
background-color:rgba(220, 220, 220, 0.56);}.ace-kuroir .ace_variable{color:#009ACD;}.ace-kuroir .ace_meta.ace_tag{color:#005273;}.ace-kuroir .ace_markup.ace_heading{color:#B8012D;
|
background-color:rgba(220, 220, 220, 0.56);}.ace-kuroir .ace_variable{color:#009ACD;}.ace-kuroir .ace_meta.ace_tag{color:#005273;}.ace-kuroir .ace_markup.ace_heading{color:#B8012D;
|
||||||
background-color:rgba(191, 97, 51, 0.051);}.ace-kuroir .ace_markup.ace_list{color:#8F5B26;}
|
background-color:rgba(191, 97, 51, 0.051);}.ace-kuroir .ace_markup.ace_list{color:#8F5B26;}
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
.ace-tm {
|
.ace-tm {
|
||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
|
color: black;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-tm .ace_cursor {
|
.ace-tm .ace_cursor {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
.ace-xcode .ace_gutter,
|
|
||||||
/* THIS THEME WAS AUTOGENERATED BY Theme.tmpl.css (UUID: EE3AD170-2B7F-4DE1-B724-C75F13FE0085) */
|
/* THIS THEME WAS AUTOGENERATED BY Theme.tmpl.css (UUID: EE3AD170-2B7F-4DE1-B724-C75F13FE0085) */
|
||||||
|
|
||||||
.ace-xcode .ace_gutter {
|
.ace-xcode .ace_gutter {
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,7 @@ var UndoManager = function() {
|
||||||
// Add deltas to undo stack.
|
// Add deltas to undo stack.
|
||||||
this.$doc = options.args[1];
|
this.$doc = options.args[1];
|
||||||
if (options.merge && this.hasUndo()){
|
if (options.merge && this.hasUndo()){
|
||||||
|
this.dirtyCounter--;
|
||||||
deltaSets = this.$undoStack.pop().concat(deltaSets);
|
deltaSets = this.$undoStack.pop().concat(deltaSets);
|
||||||
}
|
}
|
||||||
this.$undoStack.push(deltaSets);
|
this.$undoStack.push(deltaSets);
|
||||||
|
|
|
||||||
|
|
@ -369,7 +369,7 @@ var VirtualRenderer = function(container, theme) {
|
||||||
};
|
};
|
||||||
if (height && (force || size.height != height)) {
|
if (height && (force || size.height != height)) {
|
||||||
size.height = height;
|
size.height = height;
|
||||||
changes = this.CHANGE_SIZE;
|
changes |= this.CHANGE_SIZE;
|
||||||
|
|
||||||
size.scrollerHeight = size.height;
|
size.scrollerHeight = size.height;
|
||||||
if (this.$horizScroll)
|
if (this.$horizScroll)
|
||||||
|
|
@ -378,14 +378,11 @@ var VirtualRenderer = function(container, theme) {
|
||||||
// this.scrollBarV.setHeight(size.scrollerHeight);
|
// this.scrollBarV.setHeight(size.scrollerHeight);
|
||||||
this.scrollBarV.element.style.bottom = this.scrollBarH.getHeight() + "px";
|
this.scrollBarV.element.style.bottom = this.scrollBarH.getHeight() + "px";
|
||||||
|
|
||||||
if (this.session) {
|
changes = changes | this.CHANGE_SCROLL;
|
||||||
//this.session.setScrollTop(this.getScrollTop());
|
|
||||||
changes = changes | this.CHANGE_SCROLL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (width && (force || size.width != width)) {
|
if (width && (force || size.width != width)) {
|
||||||
changes = this.CHANGE_SIZE;
|
changes |= this.CHANGE_SIZE;
|
||||||
size.width = width;
|
size.width = width;
|
||||||
|
|
||||||
if (gutterWidth == null)
|
if (gutterWidth == null)
|
||||||
|
|
@ -404,7 +401,7 @@ var VirtualRenderer = function(container, theme) {
|
||||||
// this.scrollBarH.element.style.setWidth(size.scrollerWidth);
|
// this.scrollBarH.element.style.setWidth(size.scrollerWidth);
|
||||||
|
|
||||||
if (this.session && this.session.getUseWrapMode() && this.adjustWrapLimit() || force)
|
if (this.session && this.session.getUseWrapMode() && this.adjustWrapLimit() || force)
|
||||||
changes = changes | this.CHANGE_FULL;
|
changes |= this.CHANGE_FULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
size.$dirty = !width || !height;
|
size.$dirty = !width || !height;
|
||||||
|
|
@ -897,18 +894,19 @@ var VirtualRenderer = function(container, theme) {
|
||||||
this.$autosize();
|
this.$autosize();
|
||||||
|
|
||||||
var session = this.session;
|
var session = this.session;
|
||||||
|
var size = this.$size;
|
||||||
|
|
||||||
var hideScrollbars = this.$size.height <= 2 * this.lineHeight;
|
var hideScrollbars = size.height <= 2 * this.lineHeight;
|
||||||
var screenLines = this.session.getScreenLength();
|
var screenLines = this.session.getScreenLength();
|
||||||
var maxHeight = screenLines * this.lineHeight;
|
var maxHeight = screenLines * this.lineHeight;
|
||||||
|
|
||||||
var offset = this.scrollTop % this.lineHeight;
|
var offset = this.scrollTop % this.lineHeight;
|
||||||
var minHeight = this.$size.scrollerHeight + this.lineHeight;
|
var minHeight = size.scrollerHeight + this.lineHeight;
|
||||||
|
|
||||||
var longestLine = this.$getLongestLine();
|
var longestLine = this.$getLongestLine();
|
||||||
|
|
||||||
var horizScroll = !hideScrollbars && (this.$hScrollBarAlwaysVisible ||
|
var horizScroll = !hideScrollbars && (this.$hScrollBarAlwaysVisible ||
|
||||||
this.$size.scrollerWidth - longestLine - 2 * this.$padding < 0);
|
size.scrollerWidth - longestLine - 2 * this.$padding < 0);
|
||||||
|
|
||||||
var hScrollChanged = this.$horizScroll !== horizScroll;
|
var hScrollChanged = this.$horizScroll !== horizScroll;
|
||||||
if (hScrollChanged) {
|
if (hScrollChanged) {
|
||||||
|
|
@ -917,15 +915,15 @@ var VirtualRenderer = function(container, theme) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.$maxLines && this.$scrollPastEnd) {
|
if (!this.$maxLines && this.$scrollPastEnd) {
|
||||||
if (this.scrollTop > maxHeight - this.$size.scrollerHeight)
|
if (this.scrollTop > maxHeight - size.scrollerHeight)
|
||||||
maxHeight += Math.min(
|
maxHeight += Math.min(
|
||||||
(this.$size.scrollerHeight - this.lineHeight) * this.$scrollPastEnd,
|
(size.scrollerHeight - this.lineHeight) * this.$scrollPastEnd,
|
||||||
this.scrollTop - maxHeight + this.$size.scrollerHeight
|
this.scrollTop - maxHeight + size.scrollerHeight
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
var vScroll = !hideScrollbars && (this.$vScrollBarAlwaysVisible ||
|
var vScroll = !hideScrollbars && (this.$vScrollBarAlwaysVisible ||
|
||||||
this.$size.scrollerHeight - maxHeight < 0);
|
size.scrollerHeight - maxHeight < 0);
|
||||||
var vScrollChanged = this.$vScroll !== vScroll;
|
var vScrollChanged = this.$vScroll !== vScroll;
|
||||||
if (vScrollChanged) {
|
if (vScrollChanged) {
|
||||||
this.$vScroll = vScroll;
|
this.$vScroll = vScroll;
|
||||||
|
|
@ -933,10 +931,10 @@ var VirtualRenderer = function(container, theme) {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.session.setScrollTop(Math.max(-this.scrollMargin.top,
|
this.session.setScrollTop(Math.max(-this.scrollMargin.top,
|
||||||
Math.min(this.scrollTop, maxHeight - this.$size.scrollerHeight + this.scrollMargin.v)));
|
Math.min(this.scrollTop, maxHeight - size.scrollerHeight + this.scrollMargin.bottom)));
|
||||||
|
|
||||||
this.session.setScrollLeft(Math.max(-this.scrollMargin.left, Math.min(this.scrollLeft,
|
this.session.setScrollLeft(Math.max(-this.scrollMargin.left, Math.min(this.scrollLeft,
|
||||||
longestLine + 2 * this.$padding - this.$size.scrollerWidth + this.scrollMargin.h)));
|
longestLine + 2 * this.$padding - size.scrollerWidth + this.scrollMargin.right)));
|
||||||
|
|
||||||
var lineCount = Math.ceil(minHeight / this.lineHeight) - 1;
|
var lineCount = Math.ceil(minHeight / this.lineHeight) - 1;
|
||||||
var firstRow = Math.max(0, Math.round((this.scrollTop - offset) / this.lineHeight));
|
var firstRow = Math.max(0, Math.round((this.scrollTop - offset) / this.lineHeight));
|
||||||
|
|
@ -958,16 +956,18 @@ var VirtualRenderer = function(container, theme) {
|
||||||
firstRowHeight = session.getRowLength(firstRow) * lineHeight;
|
firstRowHeight = session.getRowLength(firstRow) * lineHeight;
|
||||||
|
|
||||||
lastRow = Math.min(session.screenToDocumentRow(lastRow, 0), session.getLength() - 1);
|
lastRow = Math.min(session.screenToDocumentRow(lastRow, 0), session.getLength() - 1);
|
||||||
minHeight = this.$size.scrollerHeight + session.getRowLength(lastRow) * lineHeight +
|
minHeight = size.scrollerHeight + session.getRowLength(lastRow) * lineHeight +
|
||||||
firstRowHeight;
|
firstRowHeight;
|
||||||
|
|
||||||
offset = this.scrollTop - firstRowScreen * lineHeight;
|
offset = this.scrollTop - firstRowScreen * lineHeight;
|
||||||
|
|
||||||
var changes = 0;
|
var changes = 0;
|
||||||
|
if (this.layerConfig.width != longestLine)
|
||||||
|
changes = this.CHANGE_H_SCROLL;
|
||||||
// Horizontal scrollbar visibility may have changed, which changes
|
// Horizontal scrollbar visibility may have changed, which changes
|
||||||
// the client height of the scroller
|
// the client height of the scroller
|
||||||
if (hScrollChanged || vScrollChanged) {
|
if (hScrollChanged || vScrollChanged) {
|
||||||
changes = this.$updateCachedSize(true, this.gutterWidth, this.$size.width, this.$size.height);
|
changes = this.$updateCachedSize(true, this.gutterWidth, size.width, size.height);
|
||||||
this._signal("scrollbarVisibilityChanged");
|
this._signal("scrollbarVisibilityChanged");
|
||||||
if (vScrollChanged)
|
if (vScrollChanged)
|
||||||
longestLine = this.$getLongestLine();
|
longestLine = this.$getLongestLine();
|
||||||
|
|
@ -984,6 +984,7 @@ var VirtualRenderer = function(container, theme) {
|
||||||
minHeight : minHeight,
|
minHeight : minHeight,
|
||||||
maxHeight : maxHeight,
|
maxHeight : maxHeight,
|
||||||
offset : offset,
|
offset : offset,
|
||||||
|
gutterOffset : Math.ceil((offset + size.height - size.scrollerHeight) / lineHeight),
|
||||||
height : this.$size.scrollerHeight
|
height : this.$size.scrollerHeight
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -1113,7 +1114,7 @@ var VirtualRenderer = function(container, theme) {
|
||||||
*
|
*
|
||||||
* Scrolls the cursor into the first visibile area of the editor
|
* Scrolls the cursor into the first visibile area of the editor
|
||||||
**/
|
**/
|
||||||
this.scrollCursorIntoView = function(cursor, offset) {
|
this.scrollCursorIntoView = function(cursor, offset, $viewMargin) {
|
||||||
// the editor is not visible
|
// the editor is not visible
|
||||||
if (this.$size.scrollerHeight === 0)
|
if (this.$size.scrollerHeight === 0)
|
||||||
return;
|
return;
|
||||||
|
|
@ -1123,17 +1124,18 @@ var VirtualRenderer = function(container, theme) {
|
||||||
var left = pos.left;
|
var left = pos.left;
|
||||||
var top = pos.top;
|
var top = pos.top;
|
||||||
|
|
||||||
|
var topMargin = $viewMargin && $viewMargin.top || 0;
|
||||||
|
var bottomMargin = $viewMargin && $viewMargin.bottom || 0;
|
||||||
|
|
||||||
var scrollTop = this.$scrollAnimation ? this.session.getScrollTop() : this.scrollTop;
|
var scrollTop = this.$scrollAnimation ? this.session.getScrollTop() : this.scrollTop;
|
||||||
|
|
||||||
if (scrollTop > top) {
|
if (scrollTop + topMargin > top) {
|
||||||
if (offset)
|
if (offset)
|
||||||
top -= offset * this.$size.scrollerHeight;
|
top -= offset * this.$size.scrollerHeight;
|
||||||
if (top == 0)
|
if (top === 0)
|
||||||
top = - this.scrollMargin.top;
|
top = -this.scrollMargin.top;
|
||||||
else if (top == 0)
|
|
||||||
top = + this.scrollMargin.bottom;
|
|
||||||
this.session.setScrollTop(top);
|
this.session.setScrollTop(top);
|
||||||
} else if (scrollTop + this.$size.scrollerHeight < top + this.lineHeight) {
|
} else if (scrollTop + this.$size.scrollerHeight - bottomMargin < top + this.lineHeight) {
|
||||||
if (offset)
|
if (offset)
|
||||||
top += offset * this.$size.scrollerHeight;
|
top += offset * this.$size.scrollerHeight;
|
||||||
this.session.setScrollTop(top + this.lineHeight - this.$size.scrollerHeight);
|
this.session.setScrollTop(top + this.lineHeight - this.$size.scrollerHeight);
|
||||||
|
|
@ -1617,6 +1619,13 @@ config.defineOptions(VirtualRenderer.prototype, "renderer", {
|
||||||
set: function(show) {this.$gutterLayer.setShowFoldWidgets(show)},
|
set: function(show) {this.$gutterLayer.setShowFoldWidgets(show)},
|
||||||
initialValue: true
|
initialValue: true
|
||||||
},
|
},
|
||||||
|
showLineNumbers: {
|
||||||
|
set: function(show) {
|
||||||
|
this.$gutterLayer.setShowLineNumbers(show);
|
||||||
|
this.$loop.schedule(this.CHANGE_GUTTER);
|
||||||
|
},
|
||||||
|
initialValue: true
|
||||||
|
},
|
||||||
displayIndentGuides: {
|
displayIndentGuides: {
|
||||||
set: function(show) {
|
set: function(show) {
|
||||||
if (this.$textLayer.setDisplayIndentGuides(show))
|
if (this.$textLayer.setDisplayIndentGuides(show))
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ window.window = window;
|
||||||
window.ace = window;
|
window.ace = window;
|
||||||
|
|
||||||
window.onerror = function(message, file, line, col, err) {
|
window.onerror = function(message, file, line, col, err) {
|
||||||
console.error("Worker " + err.stack);
|
console.error("Worker " + (err ? err.stack : message));
|
||||||
};
|
};
|
||||||
|
|
||||||
window.normalizeModule = function(parentId, moduleName) {
|
window.normalizeModule = function(parentId, moduleName) {
|
||||||
|
|
@ -176,7 +176,7 @@ window.onmessage = function(e) {
|
||||||
main = new clazz(sender);
|
main = new clazz(sender);
|
||||||
}
|
}
|
||||||
else if (msg.event && sender) {
|
else if (msg.event && sender) {
|
||||||
sender._emit(msg.event, msg.data);
|
sender._signal(msg.event, msg.data);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})(this);
|
})(this);
|
||||||
|
|
@ -35,7 +35,7 @@ var oop = require("../lib/oop");
|
||||||
var EventEmitter = require("../lib/event_emitter").EventEmitter;
|
var EventEmitter = require("../lib/event_emitter").EventEmitter;
|
||||||
var config = require("../config");
|
var config = require("../config");
|
||||||
|
|
||||||
var WorkerClient = function(topLevelNamespaces, mod, classname) {
|
var WorkerClient = function(topLevelNamespaces, mod, classname, workerUrl) {
|
||||||
this.$sendDeltaQueue = this.$sendDeltaQueue.bind(this);
|
this.$sendDeltaQueue = this.$sendDeltaQueue.bind(this);
|
||||||
this.changeListener = this.changeListener.bind(this);
|
this.changeListener = this.changeListener.bind(this);
|
||||||
this.onMessage = this.onMessage.bind(this);
|
this.onMessage = this.onMessage.bind(this);
|
||||||
|
|
@ -43,13 +43,12 @@ var WorkerClient = function(topLevelNamespaces, mod, classname) {
|
||||||
// nameToUrl is renamed to toUrl in requirejs 2
|
// nameToUrl is renamed to toUrl in requirejs 2
|
||||||
if (require.nameToUrl && !require.toUrl)
|
if (require.nameToUrl && !require.toUrl)
|
||||||
require.toUrl = require.nameToUrl;
|
require.toUrl = require.nameToUrl;
|
||||||
|
|
||||||
var workerUrl;
|
|
||||||
if (config.get("packaged") || !require.toUrl) {
|
if (config.get("packaged") || !require.toUrl) {
|
||||||
workerUrl = config.moduleUrl(mod, "worker");
|
workerUrl = workerUrl || config.moduleUrl(mod, "worker");
|
||||||
} else {
|
} else {
|
||||||
var normalizePath = this.$normalizePath;
|
var normalizePath = this.$normalizePath;
|
||||||
workerUrl = normalizePath(require.toUrl("ace/worker/worker.js", null, "_"));
|
workerUrl = workerUrl || normalizePath(require.toUrl("ace/worker/worker.js", null, "_"));
|
||||||
|
|
||||||
var tlns = {};
|
var tlns = {};
|
||||||
topLevelNamespaces.forEach(function(ns) {
|
topLevelNamespaces.forEach(function(ns) {
|
||||||
|
|
@ -57,12 +56,26 @@ var WorkerClient = function(topLevelNamespaces, mod, classname) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$worker = new Worker(workerUrl);
|
try {
|
||||||
|
this.$worker = new Worker(workerUrl);
|
||||||
|
} catch(e) {
|
||||||
|
if (e instanceof window.DOMException) {
|
||||||
|
// Likely same origin problem. Use importScripts from a shim Worker
|
||||||
|
var blob = this.$workerBlob(workerUrl);
|
||||||
|
var URL = window.URL || window.webkitURL;
|
||||||
|
var blobURL = URL.createObjectURL(blob);
|
||||||
|
|
||||||
|
this.$worker = new Worker(blobURL);
|
||||||
|
URL.revokeObjectURL(blobURL);
|
||||||
|
} else {
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
}
|
||||||
this.$worker.postMessage({
|
this.$worker.postMessage({
|
||||||
init : true,
|
init : true,
|
||||||
tlns: tlns,
|
tlns : tlns,
|
||||||
module: mod,
|
module : mod,
|
||||||
classname: classname
|
classname : classname
|
||||||
});
|
});
|
||||||
|
|
||||||
this.callbackId = 1;
|
this.callbackId = 1;
|
||||||
|
|
@ -83,7 +96,7 @@ var WorkerClient = function(topLevelNamespaces, mod, classname) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "event":
|
case "event":
|
||||||
this._emit(msg.name, {data: msg.data});
|
this._signal(msg.name, {data: msg.data});
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "call":
|
case "call":
|
||||||
|
|
@ -108,7 +121,7 @@ var WorkerClient = function(topLevelNamespaces, mod, classname) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.terminate = function() {
|
this.terminate = function() {
|
||||||
this._emit("terminate", {});
|
this._signal("terminate", {});
|
||||||
this.deltaQueue = null;
|
this.deltaQueue = null;
|
||||||
this.$worker.terminate();
|
this.$worker.terminate();
|
||||||
this.$worker = null;
|
this.$worker = null;
|
||||||
|
|
@ -163,7 +176,20 @@ var WorkerClient = function(topLevelNamespaces, mod, classname) {
|
||||||
this.call("setValue", [this.$doc.getValue()]);
|
this.call("setValue", [this.$doc.getValue()]);
|
||||||
} else
|
} else
|
||||||
this.emit("change", {data: q});
|
this.emit("change", {data: q});
|
||||||
}
|
};
|
||||||
|
|
||||||
|
this.$workerBlob = function(workerUrl) {
|
||||||
|
var script = 'importScripts("' + workerUrl + '");';
|
||||||
|
try {
|
||||||
|
var blob = new Blob([script], {'type': 'application/javascript'});
|
||||||
|
} catch (e) { // Backwards-compatibility
|
||||||
|
var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder;
|
||||||
|
var blobBuilder = new BlobBuilder();
|
||||||
|
blobBuilder.append(script);
|
||||||
|
blob = blobBuilder.getBlob('application/javascript');
|
||||||
|
}
|
||||||
|
return blob;
|
||||||
|
};
|
||||||
|
|
||||||
}).call(WorkerClient.prototype);
|
}).call(WorkerClient.prototype);
|
||||||
|
|
||||||
|
|
@ -191,7 +217,7 @@ var UIWorkerClient = function(topLevelNamespaces, mod, classname) {
|
||||||
if (msg.command)
|
if (msg.command)
|
||||||
main[msg.command].apply(main, msg.args);
|
main[msg.command].apply(main, msg.args);
|
||||||
else if (msg.event)
|
else if (msg.event)
|
||||||
sender._emit(msg.event, msg.data);
|
sender._signal(msg.event, msg.data);
|
||||||
};
|
};
|
||||||
|
|
||||||
sender.postMessage = function(msg) {
|
sender.postMessage = function(msg) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue