yks-element 1.5.2 → 1.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/07567125b93045706d81f17f7d04e262.js +120 -0
- package/lib/0d56a1f26e052a1bafd10a87782fc74b.js +3380 -0
- package/lib/27846e85433e54a3ec0ab34d62233dc5.js +186 -0
- package/lib/2f25a4dc442bc9aebc58cae30c50c3e2.js +192 -0
- package/lib/2f55cddc8eb85b63ee5b4ce0e5488230.js +67 -0
- package/lib/2fe2904fc024afaf81732563cb83e547.js +116 -0
- package/lib/3b02cca9e95276a74f3ed2bbc7a64ce6.js +409 -0
- package/lib/6e40b726d91e9138d9eaef6fd012c740.js +1332 -0
- package/lib/70efbabef77fb217f904f41dbf7fe8bf.js +380 -0
- package/lib/7cec85e554cfaf2464511da505025098.js +74 -0
- package/lib/852f0ecd7b17e3bfd700a821ff438f7e.js +330 -0
- package/lib/88730abfeb4a23e692ac7933882f12eb.js +255 -0
- package/lib/8b8336037f074d9dcbd20eab535b803f.js +227 -0
- package/lib/9979f39c4d2773e02151a6cf1558101b.js +768 -0
- package/lib/9ebb9ac2c9c875649c72722bc585d445.js +1381 -0
- package/lib/af6e31c060c273848b5fec9fdba8814d.js +3066 -0
- package/lib/babd8df6809ef43238f1b280c2cebfe3.js +265 -0
- package/lib/bb1365c0983ce5ad50060b24788b9630.js +459 -0
- package/lib/c0a8aa1d5e0611259e47c2008cb203ee.js +197 -0
- package/lib/c530988d2b1966fd10a4d99fa3877e1b.js +9 -0
- package/lib/c8acc93023012737a3bf8fb767b66838.js +1293 -0
- package/lib/d0415105402964718010284fcfa8b2ea.js +48 -0
- package/lib/d11ab4aa7dd9123fdecb075ff5c5a748.js +790 -0
- package/lib/d1907231dc06c32481fefd6d47da973b.js +344 -0
- package/lib/d429602e0ebf3c1ec040e070e9b05b9b.js +184 -0
- package/lib/e4fc956693373117f057fe9914e983fc.js +7090 -0
- package/lib/f15362a7feef894b2e7f706252e6c510.js +45 -0
- package/lib/f666b5647087bcfdf6623f8b14d56657.js +136 -0
- package/lib/fac0ce75e0690947a9e9e6f5b35c1ea8.js +1067 -0
- package/lib/fec23c6964d6cf25681d1f3e24b076a4.js +56 -0
- package/lib/yks.js +1 -1
- package/package.json +1 -1
- package/lib/6c6d192b6860b4508a14c2d04769a35e.js +0 -15404
- package/lib/c3832579be376308fa819b04e7b0c66f.js +0 -3788
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
ace.define("ace/ext/beautify",["require","exports","module","ace/token_iterator"], function(require, exports, module){// [WIP]
|
|
2
|
+
"use strict";
|
|
3
|
+
var TokenIterator = require("../token_iterator").TokenIterator;
|
|
4
|
+
function is(token, type) {
|
|
5
|
+
return token.type.lastIndexOf(type + ".xml") > -1;
|
|
6
|
+
}
|
|
7
|
+
exports.singletonTags = ["area", "base", "br", "col", "command", "embed", "hr", "html", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"];
|
|
8
|
+
exports.blockTags = ["article", "aside", "blockquote", "body", "div", "dl", "fieldset", "footer", "form", "head", "header", "html", "nav", "ol", "p", "script", "section", "style", "table", "tbody", "tfoot", "thead", "ul"];
|
|
9
|
+
exports.formatOptions = {
|
|
10
|
+
lineBreaksAfterCommasInCurlyBlock: true
|
|
11
|
+
};
|
|
12
|
+
exports.beautify = function (session) {
|
|
13
|
+
var iterator = new TokenIterator(session, 0, 0);
|
|
14
|
+
var token = iterator.getCurrentToken();
|
|
15
|
+
var tabString = session.getTabString();
|
|
16
|
+
var singletonTags = exports.singletonTags;
|
|
17
|
+
var blockTags = exports.blockTags;
|
|
18
|
+
var formatOptions = exports.formatOptions || {};
|
|
19
|
+
var nextToken;
|
|
20
|
+
var breakBefore = false;
|
|
21
|
+
var spaceBefore = false;
|
|
22
|
+
var spaceAfter = false;
|
|
23
|
+
var code = "";
|
|
24
|
+
var value = "";
|
|
25
|
+
var tagName = "";
|
|
26
|
+
var depth = 0;
|
|
27
|
+
var lastDepth = 0;
|
|
28
|
+
var lastIndent = 0;
|
|
29
|
+
var indent = 0;
|
|
30
|
+
var unindent = 0;
|
|
31
|
+
var roundDepth = 0;
|
|
32
|
+
var curlyDepth = 0;
|
|
33
|
+
var row;
|
|
34
|
+
var curRow = 0;
|
|
35
|
+
var rowsToAdd = 0;
|
|
36
|
+
var rowTokens = [];
|
|
37
|
+
var abort = false;
|
|
38
|
+
var i;
|
|
39
|
+
var indentNextLine = false;
|
|
40
|
+
var inTag = false;
|
|
41
|
+
var inCSS = false;
|
|
42
|
+
var inBlock = false;
|
|
43
|
+
var levels = { 0: 0 };
|
|
44
|
+
var parents = [];
|
|
45
|
+
var caseBody = false;
|
|
46
|
+
var trimNext = function () {
|
|
47
|
+
if (nextToken && nextToken.value && nextToken.type !== 'string.regexp')
|
|
48
|
+
nextToken.value = nextToken.value.replace(/^\s*/, "");
|
|
49
|
+
};
|
|
50
|
+
var trimLine = function () {
|
|
51
|
+
var end = code.length - 1;
|
|
52
|
+
while (true) {
|
|
53
|
+
if (end == 0)
|
|
54
|
+
break;
|
|
55
|
+
if (code[end] !== " ")
|
|
56
|
+
break;
|
|
57
|
+
end = end - 1;
|
|
58
|
+
}
|
|
59
|
+
code = code.slice(0, end + 1);
|
|
60
|
+
};
|
|
61
|
+
var trimCode = function () {
|
|
62
|
+
code = code.trimRight();
|
|
63
|
+
breakBefore = false;
|
|
64
|
+
};
|
|
65
|
+
while (token !== null) {
|
|
66
|
+
curRow = iterator.getCurrentTokenRow();
|
|
67
|
+
rowTokens = iterator.$rowTokens;
|
|
68
|
+
nextToken = iterator.stepForward();
|
|
69
|
+
if (typeof token !== "undefined") {
|
|
70
|
+
value = token.value;
|
|
71
|
+
unindent = 0;
|
|
72
|
+
inCSS = (tagName === "style" || session.$modeId === "ace/mode/css");
|
|
73
|
+
if (is(token, "tag-open")) {
|
|
74
|
+
inTag = true;
|
|
75
|
+
if (nextToken)
|
|
76
|
+
inBlock = (blockTags.indexOf(nextToken.value) !== -1);
|
|
77
|
+
if (value === "</") {
|
|
78
|
+
if (inBlock && !breakBefore && rowsToAdd < 1)
|
|
79
|
+
rowsToAdd++;
|
|
80
|
+
if (inCSS)
|
|
81
|
+
rowsToAdd = 1;
|
|
82
|
+
unindent = 1;
|
|
83
|
+
inBlock = false;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
else if (is(token, "tag-close")) {
|
|
87
|
+
inTag = false;
|
|
88
|
+
}
|
|
89
|
+
else if (is(token, "comment.start")) {
|
|
90
|
+
inBlock = true;
|
|
91
|
+
}
|
|
92
|
+
else if (is(token, "comment.end")) {
|
|
93
|
+
inBlock = false;
|
|
94
|
+
}
|
|
95
|
+
if (!inTag && !rowsToAdd && token.type === "paren.rparen" && token.value.substr(0, 1) === "}") {
|
|
96
|
+
rowsToAdd++;
|
|
97
|
+
}
|
|
98
|
+
if (curRow !== row) {
|
|
99
|
+
rowsToAdd = curRow;
|
|
100
|
+
if (row)
|
|
101
|
+
rowsToAdd -= row;
|
|
102
|
+
}
|
|
103
|
+
if (rowsToAdd) {
|
|
104
|
+
trimCode();
|
|
105
|
+
for (; rowsToAdd > 0; rowsToAdd--)
|
|
106
|
+
code += "\n";
|
|
107
|
+
breakBefore = true;
|
|
108
|
+
if (!is(token, "comment") && !token.type.match(/^(comment|string)$/))
|
|
109
|
+
value = value.trimLeft();
|
|
110
|
+
}
|
|
111
|
+
if (value) {
|
|
112
|
+
if (token.type === "keyword" && value.match(/^(if|else|elseif|for|foreach|while|switch)$/)) {
|
|
113
|
+
parents[depth] = value;
|
|
114
|
+
trimNext();
|
|
115
|
+
spaceAfter = true;
|
|
116
|
+
if (value.match(/^(else|elseif)$/)) {
|
|
117
|
+
if (code.match(/\}[\s]*$/)) {
|
|
118
|
+
trimCode();
|
|
119
|
+
spaceBefore = true;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
else if (token.type === "paren.lparen") {
|
|
124
|
+
trimNext();
|
|
125
|
+
if (value.substr(-1) === "{") {
|
|
126
|
+
spaceAfter = true;
|
|
127
|
+
indentNextLine = false;
|
|
128
|
+
if (!inTag)
|
|
129
|
+
rowsToAdd = 1;
|
|
130
|
+
}
|
|
131
|
+
if (value.substr(0, 1) === "{") {
|
|
132
|
+
spaceBefore = true;
|
|
133
|
+
if (code.substr(-1) !== '[' && code.trimRight().substr(-1) === '[') {
|
|
134
|
+
trimCode();
|
|
135
|
+
spaceBefore = false;
|
|
136
|
+
}
|
|
137
|
+
else if (code.trimRight().substr(-1) === ')') {
|
|
138
|
+
trimCode();
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
trimLine();
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
else if (token.type === "paren.rparen") {
|
|
146
|
+
unindent = 1;
|
|
147
|
+
if (value.substr(0, 1) === "}") {
|
|
148
|
+
if (parents[depth - 1] === 'case')
|
|
149
|
+
unindent++;
|
|
150
|
+
if (code.trimRight().substr(-1) === '{') {
|
|
151
|
+
trimCode();
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
spaceBefore = true;
|
|
155
|
+
if (inCSS)
|
|
156
|
+
rowsToAdd += 2;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
if (value.substr(0, 1) === "]") {
|
|
160
|
+
if (code.substr(-1) !== '}' && code.trimRight().substr(-1) === '}') {
|
|
161
|
+
spaceBefore = false;
|
|
162
|
+
indent++;
|
|
163
|
+
trimCode();
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
if (value.substr(0, 1) === ")") {
|
|
167
|
+
if (code.substr(-1) !== '(' && code.trimRight().substr(-1) === '(') {
|
|
168
|
+
spaceBefore = false;
|
|
169
|
+
indent++;
|
|
170
|
+
trimCode();
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
trimLine();
|
|
174
|
+
}
|
|
175
|
+
else if ((token.type === "keyword.operator" || token.type === "keyword") && value.match(/^(=|==|===|!=|!==|&&|\|\||and|or|xor|\+=|.=|>|>=|<|<=|=>)$/)) {
|
|
176
|
+
trimCode();
|
|
177
|
+
trimNext();
|
|
178
|
+
spaceBefore = true;
|
|
179
|
+
spaceAfter = true;
|
|
180
|
+
}
|
|
181
|
+
else if (token.type === "punctuation.operator" && value === ';') {
|
|
182
|
+
trimCode();
|
|
183
|
+
trimNext();
|
|
184
|
+
spaceAfter = true;
|
|
185
|
+
if (inCSS)
|
|
186
|
+
rowsToAdd++;
|
|
187
|
+
}
|
|
188
|
+
else if (token.type === "punctuation.operator" && value.match(/^(:|,)$/)) {
|
|
189
|
+
trimCode();
|
|
190
|
+
trimNext();
|
|
191
|
+
if (value.match(/^(,)$/) && curlyDepth > 0 && roundDepth === 0 && formatOptions.lineBreaksAfterCommasInCurlyBlock) {
|
|
192
|
+
rowsToAdd++;
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
spaceAfter = true;
|
|
196
|
+
breakBefore = false;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
else if (token.type === "support.php_tag" && value === "?>" && !breakBefore) {
|
|
200
|
+
trimCode();
|
|
201
|
+
spaceBefore = true;
|
|
202
|
+
}
|
|
203
|
+
else if (is(token, "attribute-name") && code.substr(-1).match(/^\s$/)) {
|
|
204
|
+
spaceBefore = true;
|
|
205
|
+
}
|
|
206
|
+
else if (is(token, "attribute-equals")) {
|
|
207
|
+
trimLine();
|
|
208
|
+
trimNext();
|
|
209
|
+
}
|
|
210
|
+
else if (is(token, "tag-close")) {
|
|
211
|
+
trimLine();
|
|
212
|
+
if (value === "/>")
|
|
213
|
+
spaceBefore = true;
|
|
214
|
+
}
|
|
215
|
+
else if (token.type === "keyword" && value.match(/^(case|default)$/)) {
|
|
216
|
+
if (caseBody)
|
|
217
|
+
unindent = 1;
|
|
218
|
+
}
|
|
219
|
+
if (breakBefore && !(token.type.match(/^(comment)$/) && !value.substr(0, 1).match(/^[/#]$/)) && !(token.type.match(/^(string)$/) && !value.substr(0, 1).match(/^['"@]$/))) {
|
|
220
|
+
indent = lastIndent;
|
|
221
|
+
if (depth > lastDepth) {
|
|
222
|
+
indent++;
|
|
223
|
+
for (i = depth; i > lastDepth; i--)
|
|
224
|
+
levels[i] = indent;
|
|
225
|
+
}
|
|
226
|
+
else if (depth < lastDepth)
|
|
227
|
+
indent = levels[depth];
|
|
228
|
+
lastDepth = depth;
|
|
229
|
+
lastIndent = indent;
|
|
230
|
+
if (unindent)
|
|
231
|
+
indent -= unindent;
|
|
232
|
+
if (indentNextLine && !roundDepth) {
|
|
233
|
+
indent++;
|
|
234
|
+
indentNextLine = false;
|
|
235
|
+
}
|
|
236
|
+
for (i = 0; i < indent; i++)
|
|
237
|
+
code += tabString;
|
|
238
|
+
}
|
|
239
|
+
if (token.type === "keyword" && value.match(/^(case|default)$/)) {
|
|
240
|
+
if (caseBody === false) {
|
|
241
|
+
parents[depth] = value;
|
|
242
|
+
depth++;
|
|
243
|
+
caseBody = true;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
else if (token.type === "keyword" && value.match(/^(break)$/)) {
|
|
247
|
+
if (parents[depth - 1] && parents[depth - 1].match(/^(case|default)$/)) {
|
|
248
|
+
depth--;
|
|
249
|
+
caseBody = false;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
if (token.type === "paren.lparen") {
|
|
253
|
+
roundDepth += (value.match(/\(/g) || []).length;
|
|
254
|
+
curlyDepth += (value.match(/\{/g) || []).length;
|
|
255
|
+
depth += value.length;
|
|
256
|
+
}
|
|
257
|
+
if (token.type === "keyword" && value.match(/^(if|else|elseif|for|while)$/)) {
|
|
258
|
+
indentNextLine = true;
|
|
259
|
+
roundDepth = 0;
|
|
260
|
+
}
|
|
261
|
+
else if (!roundDepth && value.trim() && token.type !== "comment")
|
|
262
|
+
indentNextLine = false;
|
|
263
|
+
if (token.type === "paren.rparen") {
|
|
264
|
+
roundDepth -= (value.match(/\)/g) || []).length;
|
|
265
|
+
curlyDepth -= (value.match(/\}/g) || []).length;
|
|
266
|
+
for (i = 0; i < value.length; i++) {
|
|
267
|
+
depth--;
|
|
268
|
+
if (value.substr(i, 1) === '}' && parents[depth] === 'case') {
|
|
269
|
+
depth--;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
if (token.type == "text")
|
|
274
|
+
value = value.replace(/\s+$/, " ");
|
|
275
|
+
if (spaceBefore && !breakBefore) {
|
|
276
|
+
trimLine();
|
|
277
|
+
if (code.substr(-1) !== "\n")
|
|
278
|
+
code += " ";
|
|
279
|
+
}
|
|
280
|
+
code += value;
|
|
281
|
+
if (spaceAfter)
|
|
282
|
+
code += " ";
|
|
283
|
+
breakBefore = false;
|
|
284
|
+
spaceBefore = false;
|
|
285
|
+
spaceAfter = false;
|
|
286
|
+
if ((is(token, "tag-close") && (inBlock || blockTags.indexOf(tagName) !== -1)) || (is(token, "doctype") && value === ">")) {
|
|
287
|
+
if (inBlock && nextToken && nextToken.value === "</")
|
|
288
|
+
rowsToAdd = -1;
|
|
289
|
+
else
|
|
290
|
+
rowsToAdd = 1;
|
|
291
|
+
}
|
|
292
|
+
if (nextToken && singletonTags.indexOf(nextToken.value) === -1) {
|
|
293
|
+
if (is(token, "tag-open") && value === "</") {
|
|
294
|
+
depth--;
|
|
295
|
+
}
|
|
296
|
+
else if (is(token, "tag-open") && value === "<") {
|
|
297
|
+
depth++;
|
|
298
|
+
}
|
|
299
|
+
else if (is(token, "tag-close") && value === "/>") {
|
|
300
|
+
depth--;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
if (is(token, "tag-name")) {
|
|
304
|
+
tagName = value;
|
|
305
|
+
}
|
|
306
|
+
row = curRow;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
token = nextToken;
|
|
310
|
+
}
|
|
311
|
+
code = code.trim();
|
|
312
|
+
session.doc.setValue(code);
|
|
313
|
+
};
|
|
314
|
+
exports.commands = [{
|
|
315
|
+
name: "beautify",
|
|
316
|
+
description: "Format selection (Beautify)",
|
|
317
|
+
exec: function (editor) {
|
|
318
|
+
exports.beautify(editor.session);
|
|
319
|
+
},
|
|
320
|
+
bindKey: "Ctrl-Shift-B"
|
|
321
|
+
}];
|
|
322
|
+
|
|
323
|
+
}); (function() {
|
|
324
|
+
ace.require(["ace/ext/beautify"], function(m) {
|
|
325
|
+
if (typeof module == "object" && typeof exports == "object" && module) {
|
|
326
|
+
module.exports = m;
|
|
327
|
+
}
|
|
328
|
+
});
|
|
329
|
+
})();
|
|
330
|
+
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
ace.define("ace/keyboard/vscode",["require","exports","module","ace/keyboard/hash_handler","ace/config"], function(require, exports, module){"use strict";
|
|
2
|
+
var HashHandler = require("../keyboard/hash_handler").HashHandler;
|
|
3
|
+
var config = require("../config");
|
|
4
|
+
exports.handler = new HashHandler();
|
|
5
|
+
exports.handler.$id = "ace/keyboard/vscode";
|
|
6
|
+
exports.handler.addCommands([{
|
|
7
|
+
name: "toggleWordWrap",
|
|
8
|
+
exec: function (editor) {
|
|
9
|
+
var wrapUsed = editor.session.getUseWrapMode();
|
|
10
|
+
editor.session.setUseWrapMode(!wrapUsed);
|
|
11
|
+
},
|
|
12
|
+
readOnly: true
|
|
13
|
+
}, {
|
|
14
|
+
name: "navigateToLastEditLocation",
|
|
15
|
+
exec: function (editor) {
|
|
16
|
+
var lastDelta = editor.session.getUndoManager().$lastDelta;
|
|
17
|
+
var range = (lastDelta.action == "remove") ? lastDelta.start : lastDelta.end;
|
|
18
|
+
editor.moveCursorTo(range.row, range.column);
|
|
19
|
+
editor.clearSelection();
|
|
20
|
+
}
|
|
21
|
+
}, {
|
|
22
|
+
name: "replaceAll",
|
|
23
|
+
exec: function (editor) {
|
|
24
|
+
if (!editor.searchBox) {
|
|
25
|
+
config.loadModule("ace/ext/searchbox", function (e) {
|
|
26
|
+
e.Search(editor, true);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
if (editor.searchBox.active === true && editor.searchBox.replaceOption.checked === true) {
|
|
31
|
+
editor.searchBox.replaceAll();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}, {
|
|
36
|
+
name: "replaceOne",
|
|
37
|
+
exec: function (editor) {
|
|
38
|
+
if (!editor.searchBox) {
|
|
39
|
+
config.loadModule("ace/ext/searchbox", function (e) {
|
|
40
|
+
e.Search(editor, true);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
if (editor.searchBox.active === true && editor.searchBox.replaceOption.checked === true) {
|
|
45
|
+
editor.searchBox.replace();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}, {
|
|
50
|
+
name: "selectAllMatches",
|
|
51
|
+
exec: function (editor) {
|
|
52
|
+
if (!editor.searchBox) {
|
|
53
|
+
config.loadModule("ace/ext/searchbox", function (e) {
|
|
54
|
+
e.Search(editor, false);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
if (editor.searchBox.active === true) {
|
|
59
|
+
editor.searchBox.findAll();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}, {
|
|
64
|
+
name: "toggleFindCaseSensitive",
|
|
65
|
+
exec: function (editor) {
|
|
66
|
+
config.loadModule("ace/ext/searchbox", function (e) {
|
|
67
|
+
e.Search(editor, false);
|
|
68
|
+
var sb = editor.searchBox;
|
|
69
|
+
sb.caseSensitiveOption.checked = !sb.caseSensitiveOption.checked;
|
|
70
|
+
sb.$syncOptions();
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}, {
|
|
74
|
+
name: "toggleFindInSelection",
|
|
75
|
+
exec: function (editor) {
|
|
76
|
+
config.loadModule("ace/ext/searchbox", function (e) {
|
|
77
|
+
e.Search(editor, false);
|
|
78
|
+
var sb = editor.searchBox;
|
|
79
|
+
sb.searchOption.checked = !sb.searchRange;
|
|
80
|
+
sb.setSearchRange(sb.searchOption.checked && sb.editor.getSelectionRange());
|
|
81
|
+
sb.$syncOptions();
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}, {
|
|
85
|
+
name: "toggleFindRegex",
|
|
86
|
+
exec: function (editor) {
|
|
87
|
+
config.loadModule("ace/ext/searchbox", function (e) {
|
|
88
|
+
e.Search(editor, false);
|
|
89
|
+
var sb = editor.searchBox;
|
|
90
|
+
sb.regExpOption.checked = !sb.regExpOption.checked;
|
|
91
|
+
sb.$syncOptions();
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}, {
|
|
95
|
+
name: "toggleFindWholeWord",
|
|
96
|
+
exec: function (editor) {
|
|
97
|
+
config.loadModule("ace/ext/searchbox", function (e) {
|
|
98
|
+
e.Search(editor, false);
|
|
99
|
+
var sb = editor.searchBox;
|
|
100
|
+
sb.wholeWordOption.checked = !sb.wholeWordOption.checked;
|
|
101
|
+
sb.$syncOptions();
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}, {
|
|
105
|
+
name: "removeSecondaryCursors",
|
|
106
|
+
exec: function (editor) {
|
|
107
|
+
var ranges = editor.selection.ranges;
|
|
108
|
+
if (ranges && ranges.length > 1)
|
|
109
|
+
editor.selection.toSingleRange(ranges[ranges.length - 1]);
|
|
110
|
+
else
|
|
111
|
+
editor.selection.clearSelection();
|
|
112
|
+
}
|
|
113
|
+
}]);
|
|
114
|
+
[{
|
|
115
|
+
bindKey: { mac: "Ctrl-G", win: "Ctrl-G" },
|
|
116
|
+
name: "gotoline"
|
|
117
|
+
}, {
|
|
118
|
+
bindKey: { mac: "Command-Shift-L|Command-F2", win: "Ctrl-Shift-L|Ctrl-F2" },
|
|
119
|
+
name: "findAll"
|
|
120
|
+
}, {
|
|
121
|
+
bindKey: { mac: "Shift-F8|Shift-Option-F8", win: "Shift-F8|Shift-Alt-F8" },
|
|
122
|
+
name: "goToPreviousError"
|
|
123
|
+
}, {
|
|
124
|
+
bindKey: { mac: "F8|Option-F8", win: "F8|Alt-F8" },
|
|
125
|
+
name: "goToNextError"
|
|
126
|
+
}, {
|
|
127
|
+
bindKey: { mac: "Command-Shift-P|F1", win: "Ctrl-Shift-P|F1" },
|
|
128
|
+
name: "openCommandPalette"
|
|
129
|
+
}, {
|
|
130
|
+
bindKey: { mac: "Shift-Option-Up", win: "Alt-Shift-Up" },
|
|
131
|
+
name: "copylinesup"
|
|
132
|
+
}, {
|
|
133
|
+
bindKey: { mac: "Shift-Option-Down", win: "Alt-Shift-Down" },
|
|
134
|
+
name: "copylinesdown"
|
|
135
|
+
}, {
|
|
136
|
+
bindKey: { mac: "Command-Shift-K", win: "Ctrl-Shift-K" },
|
|
137
|
+
name: "removeline"
|
|
138
|
+
}, {
|
|
139
|
+
bindKey: { mac: "Command-Enter", win: "Ctrl-Enter" },
|
|
140
|
+
name: "addLineAfter"
|
|
141
|
+
}, {
|
|
142
|
+
bindKey: { mac: "Command-Shift-Enter", win: "Ctrl-Shift-Enter" },
|
|
143
|
+
name: "addLineBefore"
|
|
144
|
+
}, {
|
|
145
|
+
bindKey: { mac: "Command-Shift-\\", win: "Ctrl-Shift-\\" },
|
|
146
|
+
name: "jumptomatching"
|
|
147
|
+
}, {
|
|
148
|
+
bindKey: { mac: "Command-]", win: "Ctrl-]" },
|
|
149
|
+
name: "blockindent"
|
|
150
|
+
}, {
|
|
151
|
+
bindKey: { mac: "Command-[", win: "Ctrl-[" },
|
|
152
|
+
name: "blockoutdent"
|
|
153
|
+
}, {
|
|
154
|
+
bindKey: { mac: "Ctrl-PageDown", win: "Alt-PageDown" },
|
|
155
|
+
name: "pagedown"
|
|
156
|
+
}, {
|
|
157
|
+
bindKey: { mac: "Ctrl-PageUp", win: "Alt-PageUp" },
|
|
158
|
+
name: "pageup"
|
|
159
|
+
}, {
|
|
160
|
+
bindKey: { mac: "Shift-Option-A", win: "Shift-Alt-A" },
|
|
161
|
+
name: "toggleBlockComment"
|
|
162
|
+
}, {
|
|
163
|
+
bindKey: { mac: "Option-Z", win: "Alt-Z" },
|
|
164
|
+
name: "toggleWordWrap"
|
|
165
|
+
}, {
|
|
166
|
+
bindKey: { mac: "Command-G", win: "F3|Ctrl-K Ctrl-D" },
|
|
167
|
+
name: "findnext"
|
|
168
|
+
}, {
|
|
169
|
+
bindKey: { mac: "Command-Shift-G", win: "Shift-F3" },
|
|
170
|
+
name: "findprevious"
|
|
171
|
+
}, {
|
|
172
|
+
bindKey: { mac: "Option-Enter", win: "Alt-Enter" },
|
|
173
|
+
name: "selectAllMatches"
|
|
174
|
+
}, {
|
|
175
|
+
bindKey: { mac: "Command-D", win: "Ctrl-D" },
|
|
176
|
+
name: "selectMoreAfter"
|
|
177
|
+
}, {
|
|
178
|
+
bindKey: { mac: "Command-K Command-D", win: "Ctrl-K Ctrl-D" },
|
|
179
|
+
name: "selectOrFindNext"
|
|
180
|
+
}, {
|
|
181
|
+
bindKey: { mac: "Shift-Option-I", win: "Shift-Alt-I" },
|
|
182
|
+
name: "splitSelectionIntoLines"
|
|
183
|
+
}, {
|
|
184
|
+
bindKey: { mac: "Command-K M", win: "Ctrl-K M" },
|
|
185
|
+
name: "modeSelect"
|
|
186
|
+
}, {
|
|
187
|
+
bindKey: { mac: "Command-Option-[", win: "Ctrl-Shift-[" },
|
|
188
|
+
name: "toggleFoldWidget"
|
|
189
|
+
}, {
|
|
190
|
+
bindKey: { mac: "Command-Option-]", win: "Ctrl-Shift-]" },
|
|
191
|
+
name: "toggleFoldWidget"
|
|
192
|
+
}, {
|
|
193
|
+
bindKey: { mac: "Command-K Command-0", win: "Ctrl-K Ctrl-0" },
|
|
194
|
+
name: "foldall"
|
|
195
|
+
}, {
|
|
196
|
+
bindKey: { mac: "Command-K Command-J", win: "Ctrl-K Ctrl-J" },
|
|
197
|
+
name: "unfoldall"
|
|
198
|
+
}, {
|
|
199
|
+
bindKey: { mac: "Command-K Command-1", win: "Ctrl-K Ctrl-1" },
|
|
200
|
+
name: "foldOther"
|
|
201
|
+
}, {
|
|
202
|
+
bindKey: { mac: "Command-K Command-Q", win: "Ctrl-K Ctrl-Q" },
|
|
203
|
+
name: "navigateToLastEditLocation"
|
|
204
|
+
}, {
|
|
205
|
+
bindKey: { mac: "Command-K Command-R|Command-K Command-S", win: "Ctrl-K Ctrl-R|Ctrl-K Ctrl-S" },
|
|
206
|
+
name: "showKeyboardShortcuts"
|
|
207
|
+
}, {
|
|
208
|
+
bindKey: { mac: "Command-K Command-X", win: "Ctrl-K Ctrl-X" },
|
|
209
|
+
name: "trimTrailingSpace"
|
|
210
|
+
}, {
|
|
211
|
+
bindKey: { mac: "Shift-Down|Command-Shift-Down", win: "Shift-Down|Ctrl-Shift-Down" },
|
|
212
|
+
name: "selectdown"
|
|
213
|
+
}, {
|
|
214
|
+
bindKey: { mac: "Shift-Up|Command-Shift-Up", win: "Shift-Up|Ctrl-Shift-Up" },
|
|
215
|
+
name: "selectup"
|
|
216
|
+
}, {
|
|
217
|
+
bindKey: { mac: "Command-Alt-Enter", win: "Ctrl-Alt-Enter" },
|
|
218
|
+
name: "replaceAll"
|
|
219
|
+
}, {
|
|
220
|
+
bindKey: { mac: "Command-Shift-1", win: "Ctrl-Shift-1" },
|
|
221
|
+
name: "replaceOne"
|
|
222
|
+
}, {
|
|
223
|
+
bindKey: { mac: "Option-C", win: "Alt-C" },
|
|
224
|
+
name: "toggleFindCaseSensitive"
|
|
225
|
+
}, {
|
|
226
|
+
bindKey: { mac: "Option-L", win: "Alt-L" },
|
|
227
|
+
name: "toggleFindInSelection"
|
|
228
|
+
}, {
|
|
229
|
+
bindKey: { mac: "Option-R", win: "Alt-R" },
|
|
230
|
+
name: "toggleFindRegex"
|
|
231
|
+
}, {
|
|
232
|
+
bindKey: { mac: "Option-W", win: "Alt-W" },
|
|
233
|
+
name: "toggleFindWholeWord"
|
|
234
|
+
}, {
|
|
235
|
+
bindKey: { mac: "Command-L", win: "Ctrl-L" },
|
|
236
|
+
name: "expandtoline"
|
|
237
|
+
}, {
|
|
238
|
+
bindKey: { mac: "Shift-Esc", win: "Shift-Esc" },
|
|
239
|
+
name: "removeSecondaryCursors"
|
|
240
|
+
}
|
|
241
|
+
].forEach(function (binding) {
|
|
242
|
+
var command = exports.handler.commands[binding.name];
|
|
243
|
+
if (command)
|
|
244
|
+
command.bindKey = binding.bindKey;
|
|
245
|
+
exports.handler.bindKey(binding.bindKey, command || binding.name);
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
}); (function() {
|
|
249
|
+
ace.require(["ace/keyboard/vscode"], function(m) {
|
|
250
|
+
if (typeof module == "object" && typeof exports == "object" && module) {
|
|
251
|
+
module.exports = m;
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
})();
|
|
255
|
+
|