Compare commits
1,186 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ca8da0a3f3 | ||
|
|
f10da4cdb0 | ||
|
|
d953740339 | ||
|
|
6cec0b28b2 | ||
|
|
3f31ca57ed | ||
|
|
fb7144b622 | ||
|
|
2249d06337 | ||
|
|
1514d5f374 | ||
|
|
446e3e1bf9 | ||
|
|
652dd7009c | ||
|
|
3d23e1e98f | ||
|
|
cafc7e7ce1 | ||
|
|
abdc4c7510 | ||
|
|
8c1d0ab7cf | ||
|
|
9f57989043 | ||
|
|
2a089863e2 | ||
|
|
386c508042 | ||
|
|
dc7643db8d | ||
|
|
5705a7c2c1 | ||
|
|
2e2d9bcdc9 | ||
|
|
a799a4086f | ||
|
|
af5c7a9c3b | ||
|
|
fe96eef206 | ||
|
|
0a3b002e28 | ||
|
|
60439d927f | ||
|
|
95bb17d04b | ||
|
|
2c1b565591 | ||
|
|
53ea1a8665 | ||
|
|
9534e4ea92 | ||
|
|
fa86327b3d | ||
|
|
a68e8bea01 | ||
|
|
88d8cf3447 | ||
|
|
9e9aa8f328 | ||
|
|
93c39ca5b0 | ||
|
|
0db985a3d7 | ||
|
|
ad5802be06 | ||
|
|
0abd9ec30e | ||
|
|
6d205a8f7e | ||
|
|
d2dc26f5a5 | ||
|
|
ef4537a099 | ||
|
|
46f76b4b06 | ||
|
|
71d1ca9d20 | ||
|
|
263a45db02 | ||
|
|
9323a2616b | ||
|
|
ad22b71cfe | ||
|
|
cd8099b0ad | ||
|
|
a61d304cbb | ||
|
|
e72f1d8337 | ||
|
|
d080fe51d4 | ||
|
|
32cb8c6b0e | ||
|
|
3ce8d76c89 | ||
|
|
a842dcdee3 | ||
|
|
0dcb1281cd | ||
|
|
65ad04082f | ||
|
|
b6f7e5d6a1 | ||
|
|
5a3bf2570f | ||
|
|
2d7ebc34b6 | ||
|
|
87044e8816 | ||
|
|
82453d884b | ||
|
|
636ace5178 | ||
|
|
3673aabe2a | ||
|
|
694d7431b7 | ||
|
|
89b9a8ac72 | ||
|
|
67c7da75b6 | ||
|
|
662cd11975 | ||
|
|
68d531ecb2 | ||
|
|
e58fa3e6d7 | ||
|
|
e610365e67 | ||
|
|
65b2cf2855 | ||
|
|
2008ab813f | ||
|
|
ecb699aa11 | ||
|
|
63687f693b | ||
|
|
685ba18451 | ||
|
|
1ec6eb7b5d | ||
|
|
1027dcea7c | ||
|
|
961f8c4893 | ||
|
|
27284cd29f | ||
|
|
04f4292fbc | ||
|
|
4e6d48bf2e | ||
|
|
80f43beb73 | ||
|
|
cf0c81a25f | ||
|
|
ee90854917 | ||
|
|
ff4429dd5a | ||
|
|
487408e84d | ||
|
|
2713d0a8db | ||
|
|
b0ce5630c9 | ||
|
|
d89311e596 | ||
|
|
5482db1c4d | ||
|
|
eb70d5a6c8 | ||
|
|
abe0286420 | ||
|
|
094b8a147a | ||
|
|
f0d01b93d4 | ||
|
|
ef9cc542e7 | ||
|
|
73808101cd | ||
|
|
0753f9aa12 | ||
|
|
f270b4ae69 | ||
|
|
121e0e51f4 | ||
|
|
846c2fb3d3 | ||
|
|
cd1c5a42c9 | ||
|
|
282331b133 | ||
|
|
db0313f2ad | ||
|
|
37a80b35da | ||
|
|
75f66697f6 | ||
|
|
32847a6761 | ||
|
|
0d0b0b4356 | ||
|
|
a0a31e16a2 | ||
|
|
295ae4dc81 | ||
|
|
d38849ef9f | ||
|
|
184df6d18e | ||
|
|
ff0cc12efc | ||
|
|
1b9c8bfc88 | ||
|
|
e42bc9a265 | ||
|
|
12be220297 | ||
|
|
7ae5c862c2 | ||
|
|
d8f7003fb8 | ||
|
|
76ac79f116 | ||
|
|
1a6e2f83f2 | ||
|
|
6b62974118 | ||
|
|
461faa9184 | ||
|
|
ede82e7137 | ||
|
|
f0b3aa0a6f | ||
|
|
fb5f272f81 | ||
|
|
c458f96d3a | ||
|
|
6070fe96f7 | ||
|
|
6a2d3fcb09 | ||
|
|
8b29f7f3c9 | ||
|
|
48de4711eb | ||
|
|
bb3fa62824 | ||
|
|
6bdc0d6cbb | ||
|
|
510d060cb2 | ||
|
|
da8d545985 | ||
|
|
4f655e71d9 | ||
|
|
8f686eb795 | ||
|
|
6fad60f546 | ||
|
|
1ae86f896a | ||
|
|
4e4df645cc | ||
|
|
0bf729d88f | ||
|
|
cc40177114 | ||
|
|
fcb4023e52 | ||
|
|
22f802a9ff | ||
|
|
14a8e1f5d9 | ||
|
|
a2e05ac438 | ||
|
|
f17c67cd01 | ||
|
|
9c6720edca | ||
|
|
4dd8eda928 | ||
|
|
cb83a974b4 | ||
|
|
75556854b9 | ||
|
|
7e9e5aea17 | ||
|
|
bb16d65cbb | ||
|
|
c39134411d | ||
|
|
cb0816b183 | ||
|
|
e551b090b7 | ||
|
|
c5602489f4 | ||
|
|
1c1d56b3ea | ||
|
|
a78bf8e5ef | ||
|
|
d9db903190 | ||
|
|
4af37cd722 | ||
|
|
dd69f5939c | ||
|
|
cac9e261e3 | ||
|
|
0216e8bbfd | ||
|
|
38e3452313 | ||
|
|
fb7b23e627 | ||
|
|
1b1006ac1d | ||
|
|
101656ea5c | ||
|
|
6a07619ad2 | ||
|
|
a5c619bda8 | ||
|
|
3adde642dc | ||
|
|
967177bbc5 | ||
|
|
60c639a34b | ||
|
|
de9e5226bf | ||
|
|
76e05b7fd5 | ||
|
|
2506bb0921 | ||
|
|
481bca1b09 | ||
|
|
01f5846ee3 | ||
|
|
cca4ab8b45 | ||
|
|
ae4989eea1 | ||
|
|
6df244d429 | ||
|
|
b5064a4bb3 | ||
|
|
9905267e4d | ||
|
|
bed3a18d49 | ||
|
|
49ff504639 | ||
|
|
a035cd2558 | ||
|
|
9a275f304d | ||
|
|
b6910a3094 | ||
|
|
27ad846641 | ||
|
|
34d80e81ca | ||
|
|
3c34a9852f | ||
|
|
a0fe09f3be | ||
|
|
906b6c9d8d | ||
|
|
74800e84ee | ||
|
|
8f49d3d897 | ||
|
|
9654382294 | ||
|
|
5ce334e930 | ||
|
|
7572a9543e | ||
|
|
b3da9336ee | ||
|
|
4bc34f4eae | ||
|
|
16b542aea4 | ||
|
|
60a1281708 | ||
|
|
2ff39c2192 | ||
|
|
34f57e7499 | ||
|
|
04e75ea0db | ||
|
|
b0475ce3e4 | ||
|
|
d86b2fd7ee | ||
|
|
0b20e4dc1d | ||
|
|
388f0235b7 | ||
|
|
d9e4b52ee1 | ||
|
|
703a5394e3 | ||
|
|
42b43b1fbe | ||
|
|
3e32d5bf7e | ||
|
|
385a285c58 | ||
|
|
c840471248 | ||
|
|
3fe1383cdc | ||
|
|
6b88b939c2 | ||
|
|
1621c1519c | ||
|
|
0da0566bac | ||
|
|
b93d772720 | ||
|
|
845a6d4e98 | ||
|
|
8df1eb70c5 | ||
|
|
63178a0511 | ||
|
|
9f8cb78f37 | ||
|
|
acd41efcb6 | ||
|
|
64eaf47c4d | ||
|
|
c769031e78 | ||
|
|
8a8bc206db | ||
|
|
7db217dfe0 | ||
|
|
847bfa4bfe | ||
|
|
135b9e5baf | ||
|
|
c356c14940 | ||
|
|
2d06dc6316 | ||
|
|
8c4173ba11 | ||
|
|
fe57baaae1 | ||
|
|
0c3246e0df | ||
|
|
d21be42c8a | ||
|
|
ccd5d689cc | ||
|
|
fb41c6ce4e | ||
|
|
3b703dad56 | ||
|
|
0a7d192b3d | ||
|
|
c0b300a8e8 | ||
|
|
68abe8507a | ||
|
|
d62315a740 | ||
|
|
eddc5563d8 | ||
|
|
57f6fbd768 | ||
|
|
100022564c | ||
|
|
b57f2e2ae3 | ||
|
|
264923e4df | ||
|
|
e1a5492a7f | ||
|
|
5e4facea44 | ||
|
|
37ab8daabe | ||
|
|
55bf8e56d3 | ||
|
|
ced37c0c19 | ||
|
|
a50833cfea | ||
|
|
b2b0e73e0f | ||
|
|
72edcd332d | ||
|
|
bcc2cd9b68 | ||
|
|
f4ea1ccb6a | ||
|
|
a06739af9a | ||
|
|
aceddd9f8f | ||
|
|
ad9aa35ffe | ||
|
|
b66fb6def8 | ||
|
|
0054bb8794 | ||
|
|
4603c34b10 | ||
|
|
07d01fda44 | ||
|
|
4aff48a837 | ||
|
|
4b8a9a475b | ||
|
|
eccc98b83b | ||
|
|
e7afb4f19e | ||
|
|
8919b113d1 | ||
|
|
ded43d9d69 | ||
|
|
14850f5b9e | ||
|
|
7ff1f1dd0d | ||
|
|
8ff856186d | ||
|
|
b46a0fb4f9 | ||
|
|
b9a4f293ed | ||
|
|
724b66857d | ||
|
|
56cb246c78 | ||
|
|
fed215d046 | ||
|
|
7a3257ab58 | ||
|
|
2d12ebb1df | ||
|
|
15b83aca5f | ||
|
|
60dd224d96 | ||
|
|
067a1ee68b | ||
|
|
5ea0a9b802 | ||
|
|
66ede32c42 | ||
|
|
ed5c38b7c8 | ||
|
|
b5c9b7f395 | ||
|
|
7b037f35ba | ||
|
|
52de738e8a | ||
|
|
dafa24d5e1 | ||
|
|
95eed25439 | ||
|
|
7da354d5f3 | ||
|
|
18b3c57de9 | ||
|
|
8019a21475 | ||
|
|
c5edaa3608 | ||
|
|
5a03993f65 | ||
|
|
5fc3bbbe09 | ||
|
|
6b13aedf5f | ||
|
|
ec18d9493d | ||
|
|
3fa54ce97e | ||
|
|
852e0673ca | ||
|
|
278f1d1674 | ||
|
|
232b3c0f8c | ||
|
|
d8f0ab2a16 | ||
|
|
cfdb223e7a | ||
|
|
d68050c62b | ||
|
|
119259b702 | ||
|
|
c49e5bfef9 | ||
|
|
2fc497477d | ||
|
|
e54882db64 | ||
|
|
e217418d39 | ||
|
|
354dc37ea6 | ||
|
|
29597325d9 | ||
|
|
0d4566b42b | ||
|
|
e1933043dc | ||
|
|
a71c17b46f | ||
|
|
8c1aa5c772 | ||
|
|
35155075e0 | ||
|
|
23a3ba85f0 | ||
|
|
57a07f54b3 | ||
|
|
93bd34e1cf | ||
|
|
16cdd9ddb3 | ||
|
|
fc322711ca | ||
|
|
c1a8e77760 | ||
|
|
097d19e943 | ||
|
|
f7144da4ec | ||
|
|
41df1f265f | ||
|
|
1869024de6 | ||
|
|
602a7efd5f | ||
|
|
03730ce381 | ||
|
|
f26841da41 | ||
|
|
fb32897b85 | ||
|
|
49b50ff347 | ||
|
|
a50fe34925 | ||
|
|
332472ecc6 | ||
|
|
2f32304c2e | ||
|
|
a40060c1ae | ||
|
|
b4d2cf810d | ||
|
|
a185414f64 | ||
|
|
f9de0a5661 | ||
|
|
068c950517 | ||
|
|
bd7de6b43b | ||
|
|
aa472742cc | ||
|
|
8daf190b2e | ||
|
|
f47c3ea8bd | ||
|
|
38ed6de508 | ||
|
|
d8d1e08a86 | ||
|
|
2c796133e0 | ||
|
|
1587b96b3c | ||
|
|
11d15b2f28 | ||
|
|
eec012b24e | ||
|
|
004a19855a | ||
|
|
d619e4e746 | ||
|
|
27264bb9d9 | ||
|
|
89702bf606 | ||
|
|
f471e54ef0 | ||
|
|
e0bd006ffc | ||
|
|
9f2473bce2 | ||
|
|
d097d41144 | ||
|
|
a0f7864b78 | ||
|
|
a45385be98 | ||
|
|
ef856d0f61 | ||
|
|
a70a9a88a9 | ||
|
|
11bbc03e1d | ||
|
|
1bed3ec951 | ||
|
|
bf7eba2253 | ||
|
|
7326de2a48 | ||
|
|
1721ca8a0c | ||
|
|
c5c1bb2b13 | ||
|
|
3a8b279e43 | ||
|
|
742e8c01a8 | ||
|
|
5801b75b5d | ||
|
|
a4532dd8b9 | ||
|
|
64f2fc4015 | ||
|
|
ffaf44ec0b | ||
|
|
bacaeb07d8 | ||
|
|
271cefb44a | ||
|
|
b8e3198ba8 | ||
|
|
a4d831f474 | ||
|
|
c4e937939a | ||
|
|
5562566b37 | ||
|
|
d09740f494 | ||
|
|
e83252130c | ||
|
|
072dcb1c11 | ||
|
|
989d0ac3fb | ||
|
|
775cdedefb | ||
|
|
a93646d2f7 | ||
|
|
7bb5b305be | ||
|
|
939e0739a7 | ||
|
|
8786e17e6b | ||
|
|
0a055cb725 | ||
|
|
54d80d79ab | ||
|
|
ea67201540 | ||
|
|
78b2147c3c | ||
|
|
b966cfd7da | ||
|
|
24f3bab19d | ||
|
|
90034c3a44 | ||
|
|
9ccf68dbb2 | ||
|
|
22de936727 | ||
|
|
f133231df8 | ||
|
|
e26c70ad53 | ||
|
|
f362d2e84a | ||
|
|
96061f72ae | ||
|
|
70337ea5ba | ||
|
|
78cda6bc3a | ||
|
|
c83f39e4a9 | ||
|
|
399e25ceaf | ||
|
|
4da689e71b | ||
|
|
ca9bc7a97a | ||
|
|
5b3bbba54e | ||
|
|
671a8d6543 | ||
|
|
fd4be8535f | ||
|
|
366675a7a7 | ||
|
|
2bd2e37367 | ||
|
|
e08a925870 | ||
|
|
c0b37c1ac2 | ||
|
|
2e8d7184e2 | ||
|
|
f121ca93ff | ||
|
|
b204cd7236 | ||
|
|
292d92ab8c | ||
|
|
5b30207d74 | ||
|
|
20cd631f0a | ||
|
|
8e3da36bc7 | ||
|
|
5e724c5ebd | ||
|
|
b3d0c62a8d | ||
|
|
695e24c418 | ||
|
|
3ef6bc2097 | ||
|
|
e8419e5742 | ||
|
|
2de76b5251 | ||
|
|
f3d9c588bd | ||
|
|
d068e2f737 | ||
|
|
1a70ef15e2 | ||
|
|
58d166d647 | ||
|
|
fd5a6ade03 | ||
|
|
289ada0a2f | ||
|
|
af859e2b0c | ||
|
|
94514a8456 | ||
|
|
1d39be41a6 | ||
|
|
7b01a4273e | ||
|
|
bf8e9ddf45 | ||
|
|
cef48f6887 | ||
|
|
631695a0e4 | ||
|
|
525fe1ffe3 | ||
|
|
bb827051a6 | ||
|
|
c97858705d | ||
|
|
40a9c308b9 | ||
|
|
f8bf6f253a | ||
|
|
6502a3d2cb | ||
|
|
f625dfeea3 | ||
|
|
2636e5de5f | ||
|
|
60367772a9 | ||
|
|
3af776df12 | ||
|
|
43cdfd792f | ||
|
|
a02ca596b9 | ||
|
|
ed40c1f51f | ||
|
|
9683d80f84 | ||
|
|
52e8bc3082 | ||
|
|
23c64c6ebb | ||
|
|
9cc394d3b9 | ||
|
|
38ce8b8919 | ||
|
|
28b95df12c | ||
|
|
18f999fc47 | ||
|
|
0609c8e1a8 | ||
|
|
61ca159312 | ||
|
|
cc40b8ceb8 | ||
|
|
1a6bb0591b | ||
|
|
6814187c51 | ||
|
|
29023787e5 | ||
|
|
2983c4b19f | ||
|
|
c2ce33f368 | ||
|
|
a1042e0d94 | ||
|
|
6c0bc56500 | ||
|
|
ab6aa3be5c | ||
|
|
14fc8adac2 | ||
|
|
6867d1f4c6 | ||
|
|
6e9ce4dbc8 | ||
|
|
9b8385b07d | ||
|
|
54e022fab2 | ||
|
|
47b9c6c225 | ||
|
|
cec6779003 | ||
|
|
753fa6b904 | ||
|
|
f4356993b2 | ||
|
|
4b44bad687 | ||
|
|
a33cc3223a | ||
|
|
1bb84debca | ||
|
|
c62b0b134f | ||
|
|
79eda6d2a8 | ||
|
|
961eee344c | ||
|
|
8a306d8a8e | ||
|
|
121835bed8 | ||
|
|
378a72a91c | ||
|
|
a0327aebd9 | ||
|
|
0989419251 | ||
|
|
b25f4b6a10 | ||
|
|
f68ca6266a | ||
|
|
953e452f70 | ||
|
|
e894b5f9e0 | ||
|
|
74f7d0095b | ||
|
|
c029ba57c5 | ||
|
|
8cc22b10eb | ||
|
|
ec3750edcb | ||
|
|
bde7daaf1b | ||
|
|
6593e25de6 | ||
|
|
87dcd881e3 | ||
|
|
eabb4b2cb5 | ||
|
|
6a0a108d2a | ||
|
|
a36e7bb0c1 | ||
|
|
f103d2632c | ||
|
|
f4afa89d4e | ||
|
|
a89e3d0d9d | ||
|
|
2cdd9fef70 | ||
|
|
4ff4d1ee43 | ||
|
|
6795b35135 | ||
|
|
706f2ea172 | ||
|
|
d2b6b43679 | ||
|
|
aec7db80d8 | ||
|
|
c0c99ad5c6 | ||
|
|
91db934fe6 | ||
|
|
8b996b0a09 | ||
|
|
fb16e59f03 | ||
|
|
cdaf4c1539 | ||
|
|
1bce1b2a60 | ||
|
|
dbeeea2dd9 | ||
|
|
bd95f782d8 | ||
|
|
e6660cd47c | ||
|
|
5f6782d949 | ||
|
|
e8f7419131 | ||
|
|
bb76c62c7b | ||
|
|
c0741f3511 | ||
|
|
36f62e3792 | ||
|
|
badade8f4e | ||
|
|
8a91b43b67 | ||
|
|
3d6b93b946 | ||
|
|
30f7f8a3f2 | ||
|
|
9f2fba320d | ||
|
|
09ddbeb341 | ||
|
|
7a3a84c858 | ||
|
|
0d8865bcfe | ||
|
|
69edbf9460 | ||
|
|
9bc0dbd788 | ||
|
|
f9591eb16f | ||
|
|
bf8b6806a0 | ||
|
|
3c4afde47b | ||
|
|
60dd9156fe | ||
|
|
fd2e51f120 | ||
|
|
bb4f7a0f1b | ||
|
|
df58b5b710 | ||
|
|
084dd4c132 | ||
|
|
6682c18ab3 | ||
|
|
d6c51fe898 | ||
|
|
5ba99b5fd4 | ||
|
|
97d39e2912 | ||
|
|
217635fe67 | ||
|
|
1dc42fd46e | ||
|
|
1f14f3fc32 | ||
|
|
706b7815e3 | ||
|
|
ed320af6f4 | ||
|
|
b01fe5de13 | ||
|
|
917c4da39d | ||
|
|
b8c111b832 | ||
|
|
c3411631a1 | ||
|
|
e227811a21 | ||
|
|
fe9b95f9e2 | ||
|
|
f79a7a7b0b | ||
|
|
2f56fb208c | ||
|
|
114166a0ce | ||
|
|
69dcab3479 | ||
|
|
9fb80fb72c | ||
|
|
b4dc4b7694 | ||
|
|
37aa485137 | ||
|
|
549df3c756 | ||
|
|
2fda9268f3 | ||
|
|
3752d20b13 | ||
|
|
5f8c5e0fb6 | ||
|
|
5348712ce2 | ||
|
|
4b5409c5cb | ||
|
|
b714925ed8 | ||
|
|
4115fd24b3 | ||
|
|
b5560a9cad | ||
|
|
d029129b28 | ||
|
|
b8f135a37d | ||
|
|
08bf3696e7 | ||
|
|
9b489c752b | ||
|
|
10860343ab | ||
|
|
1bd38560b4 | ||
|
|
383b798901 | ||
|
|
dc37f938c9 | ||
|
|
920cd20327 | ||
|
|
d493325973 | ||
|
|
ffc547d2c3 | ||
|
|
e2ab837178 | ||
|
|
1109188a93 | ||
|
|
146d832e19 | ||
|
|
2859373983 | ||
|
|
0842d27710 | ||
|
|
89b5597948 | ||
|
|
36198a50f4 | ||
|
|
91cc993bb2 | ||
|
|
b69f7450aa | ||
|
|
d120d050fb | ||
|
|
518166324b | ||
|
|
0eff326d62 | ||
|
|
b990ad3f90 | ||
|
|
dfee740802 | ||
|
|
5744a3c6e3 | ||
|
|
ec6ffec1e4 | ||
|
|
72dcd28905 | ||
|
|
f4990b3a56 | ||
|
|
d01cbaf698 | ||
|
|
f80dea7915 | ||
|
|
a00ce9cd72 | ||
|
|
b2612c6039 | ||
|
|
c673190bf7 | ||
|
|
b0babd3f25 | ||
|
|
7ab9ce686f | ||
|
|
80f42e13ff | ||
|
|
d40bec839d | ||
|
|
23f678229a | ||
|
|
0eaae8712e | ||
|
|
f3d4147f6b | ||
|
|
c079a49ce7 | ||
|
|
b71a09d8d0 | ||
|
|
c073766cc3 | ||
|
|
b651a424f1 | ||
|
|
9284732a28 | ||
|
|
7e55724c52 | ||
|
|
fcd1dbb98d | ||
|
|
d53c91e41a | ||
|
|
1ad5e66be0 | ||
|
|
a52b30317b | ||
|
|
c1c08945b2 | ||
|
|
d3d2e0823b | ||
|
|
3b85ddfa05 | ||
|
|
0afb5f6da6 | ||
|
|
e9faed1868 | ||
|
|
fd182ea76f | ||
|
|
a885aea2f0 | ||
|
|
4b286a5c0d | ||
|
|
a3bb907f46 | ||
|
|
5ebcf9298b | ||
|
|
4904f74dbd | ||
|
|
d3ddd74fe7 | ||
|
|
cc03e77327 | ||
|
|
779912d517 | ||
|
|
e6f01878d7 | ||
|
|
bf72097811 | ||
|
|
c3bb709318 | ||
|
|
8ed2799620 | ||
|
|
f8be5072ac | ||
|
|
f9b3655c94 | ||
|
|
ad54d2c46c | ||
|
|
1f7582b5a6 | ||
|
|
109923873a | ||
|
|
7fbfbc4c16 | ||
|
|
2ce7ed0f44 | ||
|
|
ccfb820418 | ||
|
|
b5eda22bfc | ||
|
|
299d174dc7 | ||
|
|
416f5582e8 | ||
|
|
f8b7dce3e0 | ||
|
|
63f43da96a | ||
|
|
2dcc4a3f04 | ||
|
|
0450a1a539 | ||
|
|
fdbd11d3df | ||
|
|
14f5095c92 | ||
|
|
1dd41ea75d | ||
|
|
ce070285a4 | ||
|
|
3ebc2828e6 | ||
|
|
6aaede1a2e | ||
|
|
8c86ff6fab | ||
|
|
739e86cde7 | ||
|
|
6714359998 | ||
|
|
e5b2eed5c5 | ||
|
|
e52884761d | ||
|
|
b42108a2c9 | ||
|
|
d63863ac0c | ||
|
|
fcb3331d69 | ||
|
|
08bfa14dd2 | ||
|
|
ffe22ce2be | ||
|
|
bdd54043b5 | ||
|
|
9a4bb06bb7 | ||
|
|
3ce44130d4 | ||
|
|
8db9dc255a | ||
|
|
5496351529 | ||
|
|
f25b14a328 | ||
|
|
b8c21d4c6f | ||
|
|
08b88485c8 | ||
|
|
e92b709eb2 | ||
|
|
c5031db61c | ||
|
|
d7c7cb1b4d | ||
|
|
76adcc51a0 | ||
|
|
efcbe1c010 | ||
|
|
511faeeaae | ||
|
|
19ec94a815 | ||
|
|
636cc6a96f | ||
|
|
c0343a2cba | ||
|
|
111ec1899f | ||
|
|
da5cc2e28d | ||
|
|
9a4a387de6 | ||
|
|
ce3076b4e5 | ||
|
|
84a8201dfd | ||
|
|
07fb7738db | ||
|
|
84abfa5ff8 | ||
|
|
17c75da27b | ||
|
|
a519520ae7 | ||
|
|
617cd3202a | ||
|
|
d57e010ca3 | ||
|
|
08afa03cb9 | ||
|
|
32e3ad5966 | ||
|
|
bf9eec6b23 | ||
|
|
c8483a7ae5 | ||
|
|
df92a99e93 | ||
|
|
a7cac9466d | ||
|
|
e4355adae7 | ||
|
|
1c2bc29424 | ||
|
|
df6001ca67 | ||
|
|
066180b248 | ||
|
|
66866121e9 | ||
|
|
717be26d5d | ||
|
|
77ec0af40a | ||
|
|
d0acc15e67 | ||
|
|
bec92e678d | ||
|
|
b7eacfb153 | ||
|
|
03eee835df | ||
|
|
7e2dda1e18 | ||
|
|
72a509e542 | ||
|
|
4872441bc6 | ||
|
|
ba93cc6dfa | ||
|
|
88aed65212 | ||
|
|
9ab12a6ed3 | ||
|
|
4e2d7a41f5 | ||
|
|
2cb84b3bc3 | ||
|
|
2d39aca4a7 | ||
|
|
446e497da8 | ||
|
|
473b6958bc | ||
|
|
470efff782 | ||
|
|
8f8410f01b | ||
|
|
5dc93cd627 | ||
|
|
6e82b0a3c3 | ||
|
|
307b947e96 | ||
|
|
739baebbd0 | ||
|
|
87a4e2666b | ||
|
|
05f0b3c7f2 | ||
|
|
9910c9db32 | ||
|
|
cf35fbdeec | ||
|
|
56e2819cdd | ||
|
|
f1e819cd80 | ||
|
|
12c6cf1f41 | ||
|
|
4329b6a729 | ||
|
|
b6a5e222cd | ||
|
|
ea07bfb4e7 | ||
|
|
39fd0e6c42 | ||
|
|
8dffbbe200 | ||
|
|
2327d155b4 | ||
|
|
23680b4f7e | ||
|
|
449226dac9 | ||
|
|
03d3a725ef | ||
|
|
199bc4701d | ||
|
|
effcb04a9a | ||
|
|
b5a1aaebba | ||
|
|
8416cfb42a | ||
|
|
669deb54b2 | ||
|
|
d5566938ba | ||
|
|
19f1d99a98 | ||
|
|
0582153019 | ||
|
|
4e9e553436 | ||
|
|
e8ee926097 | ||
|
|
ace5fd14a2 | ||
|
|
efea2a755b | ||
|
|
ee4bed3db1 | ||
|
|
6779345049 | ||
|
|
8018756051 | ||
|
|
feb500c86e | ||
|
|
12ef5f9f6b | ||
|
|
deb4013a13 | ||
|
|
ca170b5d3d | ||
|
|
393dc852dc | ||
|
|
0155c67b1f | ||
|
|
225985634e | ||
|
|
1ef6700be7 | ||
|
|
b146bbaea0 | ||
|
|
68ede367a6 | ||
|
|
4949e18f00 | ||
|
|
6db76f92cc | ||
|
|
54a1060a81 | ||
|
|
163a6a9243 | ||
|
|
9391e0b9bb | ||
|
|
31c2978ca7 | ||
|
|
2566dd74a5 | ||
|
|
0e3abd3f41 | ||
|
|
b2af4389fa | ||
|
|
5b697f68d1 | ||
|
|
25e70c4430 | ||
|
|
06db67de16 | ||
|
|
3631e7f720 | ||
|
|
c5689d94ca | ||
|
|
156ebc0a72 | ||
|
|
3b76a2ebef | ||
|
|
ee052c06d3 | ||
|
|
d05213cd92 | ||
|
|
9e182a1de7 | ||
|
|
14721de01f | ||
|
|
0a9dc16f22 | ||
|
|
993df16bdb | ||
|
|
75bac806b0 | ||
|
|
1bd5b56793 | ||
|
|
7767efe0f6 | ||
|
|
4d24573946 | ||
|
|
4d868a046a | ||
|
|
f5f2d823b9 | ||
|
|
052559778d | ||
|
|
1f33265ba7 | ||
|
|
187b90dd84 | ||
|
|
56631344ba | ||
|
|
cff2aeaeb7 | ||
|
|
96145bcd8a | ||
|
|
2a2efb133b | ||
|
|
5aba18ea06 | ||
|
|
3296dd7471 | ||
|
|
fdf832784f | ||
|
|
d1decf7e13 | ||
|
|
65003e259a | ||
|
|
91e6abf099 | ||
|
|
831f6c9336 | ||
|
|
ce6c0aa84b | ||
|
|
55886771a9 | ||
|
|
23055a2fcf | ||
|
|
4599dc6834 | ||
|
|
c3dd9ff510 | ||
|
|
32cbb0ffa1 | ||
|
|
f39f16e12f | ||
|
|
df68336921 | ||
|
|
0d6eb5b718 | ||
|
|
b67caa1163 | ||
|
|
a05b84f4df | ||
|
|
a7297de55f | ||
|
|
7fc47d77a3 | ||
|
|
e87dfcce7a | ||
|
|
6c38e136c1 | ||
|
|
cbd66efbf3 | ||
|
|
5b93b1d51a | ||
|
|
2119154050 | ||
|
|
1c2e388c24 | ||
|
|
d6d3f0b384 | ||
|
|
431facf08b | ||
|
|
3c13b4bf33 | ||
|
|
ea532e41bf | ||
|
|
4e23984ddb | ||
|
|
f37899463f | ||
|
|
34f34bb591 | ||
|
|
8645e67f42 | ||
|
|
f6faeb3547 | ||
|
|
a188ac7fa6 | ||
|
|
3f6e2aded9 | ||
|
|
bb10f4661d | ||
|
|
9c53d96c12 | ||
|
|
5ef28b7e11 | ||
|
|
dcd96294f7 | ||
|
|
bb55802197 | ||
|
|
ec97ad7904 | ||
|
|
90a21c012c | ||
|
|
8d45a2d209 | ||
|
|
02cf485055 | ||
|
|
207adf8eba | ||
|
|
9062f4fe40 | ||
|
|
362a69228b | ||
|
|
fbc5460320 | ||
|
|
a4921fe7ce | ||
|
|
a573fa3dec | ||
|
|
ef3262143a | ||
|
|
180fa0c4cb | ||
|
|
d76e3e29c6 | ||
|
|
f00f2bfc40 | ||
|
|
79f619364a | ||
|
|
372b5409fa | ||
|
|
00305167a2 | ||
|
|
26f96c0ea2 | ||
|
|
8e5bdc512c | ||
|
|
91bc4b82d7 | ||
|
|
65822b59fe | ||
|
|
750e53fab2 | ||
|
|
31a32f2659 | ||
|
|
d03c0957b4 | ||
|
|
f4613206be | ||
|
|
408b9c527b | ||
|
|
de51e72a3c | ||
|
|
46da3132a2 | ||
|
|
21ee784ca1 | ||
|
|
0bc7f518ad | ||
|
|
a0bf93679d | ||
|
|
1f72461ada | ||
|
|
5705c067fe | ||
|
|
6594a3fe55 | ||
|
|
a4b27cbc3a | ||
|
|
dc87483936 | ||
|
|
b04c07b448 | ||
|
|
8b950c1121 | ||
|
|
8cdb16659d | ||
|
|
59c392042a | ||
|
|
88829fbee7 | ||
|
|
12343e0e6f | ||
|
|
c8b63ee977 | ||
|
|
58404df349 | ||
|
|
3b7569542f | ||
|
|
08d2ebb5b2 | ||
|
|
6f8035f710 | ||
|
|
498af4aab8 | ||
|
|
5689573170 | ||
|
|
c72617b033 | ||
|
|
6e14e92912 | ||
|
|
09d6741a02 | ||
|
|
051128c16f | ||
|
|
6c235fee7d | ||
|
|
86e7a49666 | ||
|
|
3166b3fb90 | ||
|
|
96184bda23 | ||
|
|
0431f2dafb | ||
|
|
c1011ca875 | ||
|
|
d8c05b5138 | ||
|
|
a9117a4aee | ||
|
|
07c7c86944 | ||
|
|
bfba4f1efd | ||
|
|
56a00f3fa0 | ||
|
|
306e918920 | ||
|
|
45311cda45 | ||
|
|
08454b7ecb | ||
|
|
3694a02532 | ||
|
|
9c80485d91 | ||
|
|
5783bae058 | ||
|
|
42a368ed02 | ||
|
|
4a80bd7b3d | ||
|
|
6e9c9417fc | ||
|
|
f352165725 | ||
|
|
f4d1dc7c13 | ||
|
|
316bb55f17 | ||
|
|
32191f128b | ||
|
|
2be1a5a3d3 | ||
|
|
89c6609e97 | ||
|
|
102de76b68 | ||
|
|
b9d16078f7 | ||
|
|
4e4d8a553b | ||
|
|
a2cc97b34b | ||
|
|
2b77b9ec8b | ||
|
|
f531569824 | ||
|
|
e5edb59d00 | ||
|
|
a87b9e4dbc | ||
|
|
e672469923 | ||
|
|
7439993b1a | ||
|
|
080596e6a1 | ||
|
|
27b6d6dcd3 | ||
|
|
6b60bcbbd6 | ||
|
|
46f3d77068 | ||
|
|
c8d1df203e | ||
|
|
4299db01bd | ||
|
|
b5af2c898c | ||
|
|
e4cfb47ae1 | ||
|
|
927bf936da | ||
|
|
3bed18be1d | ||
|
|
a6ece4cbfa | ||
|
|
5e3c3b660b | ||
|
|
7981e0ca6c | ||
|
|
8ba0cd91be | ||
|
|
7a8a799c26 | ||
|
|
3eefd3365a | ||
|
|
ffc9cec9ef | ||
|
|
68096ff38d | ||
|
|
9db70f0351 | ||
|
|
471e9c6d40 | ||
|
|
297c05831e | ||
|
|
889e9248f8 | ||
|
|
e06a14ab92 | ||
|
|
f7be399bd2 | ||
|
|
cbbbf1c539 | ||
|
|
c52278a64e | ||
|
|
aab8b7f7a8 | ||
|
|
a8ba1e06d9 | ||
|
|
0f9bcfbc7d | ||
|
|
7cff8e7cff | ||
|
|
8ccb0e6fda | ||
|
|
eac48f5190 | ||
|
|
4795261b94 | ||
|
|
42f274a42c | ||
|
|
0e256ce80d | ||
|
|
e76a389e88 | ||
|
|
99f49fdc49 | ||
|
|
31e1a2d1f3 | ||
|
|
0eb2b74a66 | ||
|
|
2cf93d936e | ||
|
|
c36fac3a94 | ||
|
|
09b9348852 | ||
|
|
1e46543b05 | ||
|
|
9cbcfb35d3 | ||
|
|
750d38af6f | ||
|
|
b54d268a72 | ||
|
|
110eb26f96 | ||
|
|
7dc4bddae9 | ||
|
|
2246da0021 | ||
|
|
3dc20b0824 | ||
|
|
af16d9ca54 | ||
|
|
07ef6a115c | ||
|
|
abb1e4703b | ||
|
|
f6983739e9 | ||
|
|
36c6fcc9d4 | ||
|
|
f3af20aa15 | ||
|
|
eafe6a7997 | ||
|
|
048d9589c7 | ||
|
|
5e2c5f4e0a | ||
|
|
21bd4a15fa | ||
|
|
4ed6afc829 | ||
|
|
cd12b25ea6 | ||
|
|
9253fffb9f | ||
|
|
54ad13847a | ||
|
|
7a92c174eb | ||
|
|
0c03302a6d | ||
|
|
75e41746e6 | ||
|
|
baa0c28e69 | ||
|
|
ca41480c72 | ||
|
|
625173182d | ||
|
|
b4418d2ffd | ||
|
|
5223d19e3f | ||
|
|
7d3fdc00b0 | ||
|
|
00b3beae30 | ||
|
|
df99195544 | ||
|
|
f9fcf49c66 | ||
|
|
98dc63cce4 | ||
|
|
ee5ac2a0f2 | ||
|
|
c4012ebd46 | ||
|
|
af1aab40f5 | ||
|
|
afd9c99da2 | ||
|
|
07c99e0541 | ||
|
|
33cf210180 | ||
|
|
af09dc7f05 | ||
|
|
a206535596 | ||
|
|
300dc660e9 | ||
|
|
2bf673c41d | ||
|
|
f2da76daaf | ||
|
|
58caaad6a5 | ||
|
|
e751389d38 | ||
|
|
68f46ff7ef | ||
|
|
d44c8080bf | ||
|
|
2428de10ed | ||
|
|
c5f58503fe | ||
|
|
3d71b01022 | ||
|
|
142fc79c97 | ||
|
|
cd506ca7ad | ||
|
|
73fb35e63c | ||
|
|
811d63039d | ||
|
|
6e1aefff56 | ||
|
|
5abba7d32c | ||
|
|
dc95d03bd6 | ||
|
|
93c14b1b31 | ||
|
|
ab1b62fbb7 | ||
|
|
ff88d5aa8d | ||
|
|
9e71e4a003 | ||
|
|
c8fca3053c | ||
|
|
8d57d8765f | ||
|
|
90f3f32fb1 | ||
|
|
66f615ba94 | ||
|
|
be0d187a60 | ||
|
|
ac99690429 | ||
|
|
00f044d0cf | ||
|
|
177e0af9eb | ||
|
|
0ab6574521 | ||
|
|
f779c2e8c5 | ||
|
|
fb233da532 | ||
|
|
7f1bc7af2f | ||
|
|
6b280bf6bb | ||
|
|
35a27fd1ba | ||
|
|
ddd695ee3f | ||
|
|
f59708a5ba | ||
|
|
ef0e8da522 | ||
|
|
08edcdfc98 | ||
|
|
e9434fc1df | ||
|
|
d226ea067b | ||
|
|
3a048cdf61 | ||
|
|
f2a2e4e1a8 | ||
|
|
6fe381f633 | ||
|
|
91df7cd663 | ||
|
|
ce329df39b | ||
|
|
142761d86f | ||
|
|
30a4d12eb7 | ||
|
|
b79cb61861 | ||
|
|
5b3e1ca29d | ||
|
|
8624ab8dcb | ||
|
|
b503e65e03 | ||
|
|
c40bf3b172 | ||
|
|
5733f006a8 | ||
|
|
7bcf64401f | ||
|
|
8f109ea371 | ||
|
|
612478e39f | ||
|
|
810e196cc6 | ||
|
|
026af74016 | ||
|
|
27768230c8 | ||
|
|
2e6f12725b | ||
|
|
ccc7d6dda8 | ||
|
|
a9d194894e | ||
|
|
1240a04fff | ||
|
|
0b1630d6fa | ||
|
|
425404ff29 | ||
|
|
3cc3043951 | ||
|
|
9a5bd3cd65 | ||
|
|
6e46195102 | ||
|
|
48cd7f55dc | ||
|
|
edee507fd9 | ||
|
|
714e1a592c | ||
|
|
90b2a6cd77 | ||
|
|
37b3dc1efd | ||
|
|
b6a4a34fd2 | ||
|
|
5b151a3db4 | ||
|
|
3f7f325777 | ||
|
|
6e254f25a1 | ||
|
|
4c4ab09870 | ||
|
|
c612dac355 | ||
|
|
890fd39c92 | ||
|
|
eda5eaba39 | ||
|
|
191a79245f | ||
|
|
92dba7d44c | ||
|
|
ff42a13c4f | ||
|
|
b6a3a15232 | ||
|
|
c01725184e | ||
|
|
15dd2082f6 | ||
|
|
3a864c6056 | ||
|
|
10e2c3049c | ||
|
|
6285bf5d5a | ||
|
|
b7ee15f5d9 | ||
|
|
133db3cfe0 | ||
|
|
45c4bdcb2e | ||
|
|
61591eee5d | ||
|
|
869e1f86aa | ||
|
|
a6c21c6761 | ||
|
|
3b96539874 | ||
|
|
5affb58e40 | ||
|
|
710bf4dbe0 | ||
|
|
cde625fde3 | ||
|
|
56604c1fa5 | ||
|
|
a6c6028f7e | ||
|
|
8ecc94a181 | ||
|
|
00df72ee0d | ||
|
|
2b10c2071f | ||
|
|
24c207191c | ||
|
|
be2b684b6f | ||
|
|
5f0012f653 | ||
|
|
4307aba209 | ||
|
|
f5334ceaa2 | ||
|
|
91d581b12b | ||
|
|
e7f412c992 | ||
|
|
40ea516801 | ||
|
|
c2b097b825 | ||
|
|
a0ab8baa56 | ||
|
|
84bc9b25de | ||
|
|
6b1215bca8 | ||
|
|
69b144686a | ||
|
|
5ed4e3eded | ||
|
|
af7c370318 | ||
|
|
b58b38d74a | ||
|
|
6461d62f90 | ||
|
|
d87ba89c49 | ||
|
|
93d2b75b4f | ||
|
|
c563f15e93 | ||
|
|
4d88770435 | ||
|
|
29e1838394 | ||
|
|
8cfd45feab | ||
|
|
69b40db4f2 | ||
|
|
03edee8c30 | ||
|
|
70bc7d7dc0 | ||
|
|
e70f0773df | ||
|
|
d870d81ea0 | ||
|
|
9b8e236483 | ||
|
|
9a2ee70af8 | ||
|
|
4cb1e7b849 | ||
|
|
a910b8ee18 | ||
|
|
9002950bf7 | ||
|
|
b88bf398b5 | ||
|
|
1704cbdcc2 | ||
|
|
d03e5d1120 | ||
|
|
76230003b6 | ||
|
|
78ee0833ba | ||
|
|
0e9d413102 | ||
|
|
34ceb4e15e | ||
|
|
b42ce65a54 | ||
|
|
727c94c90a | ||
|
|
a50c0a27b9 | ||
|
|
c2fb30b313 | ||
|
|
a7798c4497 | ||
|
|
8b4c88d636 | ||
|
|
9719c770d3 | ||
|
|
55a947ec68 | ||
|
|
c2f1838dca |
616 changed files with 152124 additions and 61307 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -2,6 +2,7 @@
|
|||
.DS_Store
|
||||
*.swp
|
||||
*.tmp
|
||||
*~
|
||||
|
||||
# Project files that should not be in the repo
|
||||
.*
|
||||
|
|
|
|||
4
.gitmodules
vendored
4
.gitmodules
vendored
|
|
@ -1,6 +1,6 @@
|
|||
[submodule "doc/wiki"]
|
||||
path = doc/wiki
|
||||
url = git://github.com/ajaxorg/ace.wiki.git
|
||||
url = https://github.com/ajaxorg/ace.wiki.git
|
||||
[submodule "build"]
|
||||
path = build
|
||||
url = git://github.com/ajaxorg/ace-builds.git
|
||||
url = https://github.com/ajaxorg/ace-builds.git
|
||||
|
|
|
|||
|
|
@ -7,16 +7,9 @@ Feel free to fork and improve/enhance Ace any way you want. If you feel that the
|
|||
|
||||
There are two versions of the agreement:
|
||||
|
||||
1. [The Individual CLA](https://github.com/ajaxorg/ace/raw/master/doc/Contributor_License_Agreement-v2.pdf): use this version if you're working on an ajax.org in your spare time, or can clearly claim ownership of copyright in what you'll be submitting.
|
||||
2. [The Corporate CLA](https://github.com/ajaxorg/ace/raw/master/doc/Corporate_Contributor_License_Agreement-v2.pdf): have your corporate lawyer review and submit this if your company is going to be contributing to ajax.org projects
|
||||
1. [The Individual CLA](https://docs.google.com/a/c9.io/forms/d/1MfmfrxqD_PNlNsuK0lC2KSelRLxGLGfh_wEcG0ijVvo/viewform): use this version if you're working on the Cloud9 SDK or open source projects in your spare time, or can clearly claim ownership of copyright in what you'll be submitting.
|
||||
2. [The Corporate CLA](https://docs.google.com/a/c9.io/forms/d/1vFejn4111GdnCNuQ6BfnJDaxdsUEMD4KCo1ayovAfu0/viewform): have your corporate lawyer review and submit this if your company is going to be contributing to the Cloud9 SDK and/or open source projects.
|
||||
|
||||
If you want to contribute to an ajax.org project please print the CLA and fill it out and sign it. Then either send it by snail mail or fax to us or send it back scanned (or as a photo) by email.
|
||||
If you want to contribute to the Cloud9 SDK and/or open source projects please go to the online form, fill it out and submit it.
|
||||
|
||||
Email: ace+cla@c9.io
|
||||
|
||||
Fax: +31 (0) 206388953
|
||||
|
||||
Address: Ajax.org B.V.
|
||||
Keizersgracht 241
|
||||
1016 EA, Amsterdam
|
||||
the Netherlands
|
||||
Happy coding, Cloud9
|
||||
|
|
|
|||
|
|
@ -1,4 +1,80 @@
|
|||
Version 1.2.0-pre
|
||||
|
||||
* New Features
|
||||
- Indented soft wrap (danyaPostfactum)
|
||||
|
||||
* API Changes
|
||||
- unified delta types `{start, end, action, lines}` (Alden Daniels https://github.com/ajaxorg/ace/pull/1745)
|
||||
- "change" event listeners on session and editor get delta objects directly
|
||||
|
||||
2015.04.03 Version 1.1.9
|
||||
|
||||
- Small Enhancements and Bugfixes
|
||||
|
||||
2014.11.08 Version 1.1.8
|
||||
|
||||
* API Changes
|
||||
- `editor.commands.commandKeyBinding` now contains direct map from keys to commands instead of grouping them by hashid
|
||||
|
||||
* New Features
|
||||
- Improved autoindent for html and php modes (Adam Jimenez)
|
||||
- Find All from searchbox (Colton Voege)
|
||||
|
||||
* new language modes
|
||||
- Elixir, Elm
|
||||
|
||||
2014.09.21 Version 1.1.7
|
||||
|
||||
* Bugfixes
|
||||
- fix several bugs in autocompletion
|
||||
- workaround for inaccurate getBoundingClientRect on chrome 37
|
||||
|
||||
2014.08.17 Version 1.1.6
|
||||
|
||||
* Bugfixes
|
||||
- fix regression in double tap to highlight
|
||||
- Improved Latex Mode (Daniel Felder)
|
||||
|
||||
* API Changes
|
||||
- editor.destroy destroys editor.session too (call editor.setSession(null) to prevent that)
|
||||
|
||||
* new language modes
|
||||
- Praat (José Joaquín Atria)
|
||||
- Eiffel (Victorien Elvinger)
|
||||
- G-code (Adam Joseph Cook)
|
||||
|
||||
2014.07.09 Version 1.1.5
|
||||
|
||||
* Bugfixes
|
||||
- fix regression in autocomplete popup
|
||||
|
||||
* new language modes
|
||||
- gitignore (Devon Carew)
|
||||
|
||||
2014.07.01 Version 1.1.4
|
||||
|
||||
* New Features
|
||||
- Highlight matching tags (Adam Jimenez)
|
||||
- Improved jump to matching command (Adam Jimenez)
|
||||
|
||||
* new language modes
|
||||
- AppleScript (Yaogang Lian)
|
||||
- Vala
|
||||
|
||||
2014.03.08 Version 1.1.3
|
||||
|
||||
* New Features
|
||||
- Allow syntax checkers to be loaded from CDN (Derk-Jan Hartman)
|
||||
- Add ColdFusion behavior (Abram Adams)
|
||||
- add showLineNumbers option
|
||||
- Add html syntax checker (danyaPostfactum)
|
||||
|
||||
* new language modes
|
||||
- Gherkin (Patrick Nevels)
|
||||
- Smarty
|
||||
|
||||
2013.12.02 Version 1.1.2
|
||||
|
||||
* New Features
|
||||
- Accessibility Theme for Ace (Peter Xiao)
|
||||
- use snipetManager for expanding emmet snippets
|
||||
|
|
@ -10,7 +86,6 @@
|
|||
- add support for autocompletion and snippets (gjtorikyan danyaPostfactum and others)
|
||||
- add option to merge similar changes in undo history
|
||||
- add scrollPastEnd option
|
||||
- 6a87d97 Merge pull request #1494 from danyaPostfactum/snippetcompleter
|
||||
- use html5 dragndrop for text dragging (danyaPostfactum)
|
||||
|
||||
* API Changes
|
||||
|
|
@ -21,9 +96,8 @@
|
|||
- Protobuf (Zef Hemel)
|
||||
- Soy
|
||||
- Handlebars
|
||||
-
|
||||
|
||||
2013.06.04 Version 1.1.01
|
||||
2013.06.04 Version 1.1.1
|
||||
|
||||
- Improved emacs keybindings (Robert Krahn)
|
||||
- Added markClean, isClean methods to UndoManager (Joonsoo Jeon)
|
||||
|
|
|
|||
1
Makefile
1
Makefile
|
|
@ -13,7 +13,6 @@ pre_build:
|
|||
build: pre_build
|
||||
./Makefile.dryice.js normal
|
||||
./Makefile.dryice.js demo
|
||||
./Makefile.dryice.js bm
|
||||
|
||||
# Minimal build: call Makefile.dryice.js only if our sources changed
|
||||
basic: build/src/ace.js
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -8,7 +8,7 @@ Ace is a standalone code editor written in JavaScript. Our goal is to create a b
|
|||
Features
|
||||
--------
|
||||
|
||||
* Syntax highlighting for over 40 languages (TextMate/Sublime/_.tmlanguage_ files can be imported)
|
||||
* Syntax highlighting for over 110 languages (TextMate/Sublime/_.tmlanguage_ files can be imported)
|
||||
* Over 20 themes (TextMate/Sublime/_.tmtheme_ files can be imported)
|
||||
* Automatic indent and outdent
|
||||
* An optional command line
|
||||
|
|
@ -30,7 +30,7 @@ Take Ace for a spin!
|
|||
|
||||
Check out the Ace live [demo](http://ace.c9.io/build/kitchen-sink.html) or get a [Cloud9 IDE account](https://c9.io/) to experience Ace while editing one of your own GitHub projects.
|
||||
|
||||
If you want, you can use Ace as a textarea replacement thanks to the [Ace Bookmarklet](http://ajaxorg.github.io/ace/build/textarea/editor.html).
|
||||
If you want, you can use Ace as a textarea replacement thanks to the [Ace Bookmarklet](http://ajaxorg.github.io/ace/build/demo/bookmarklet/index.html).
|
||||
|
||||
Embedding Ace
|
||||
-------------
|
||||
|
|
@ -79,7 +79,7 @@ By default the editor only supports plain text mode; many other languages are av
|
|||
The mode can then be used like this:
|
||||
|
||||
```javascript
|
||||
var JavaScriptMode = require("ace/mode/javascript").Mode;
|
||||
var JavaScriptMode = ace.require("ace/mode/javascript").Mode;
|
||||
editor.getSession().setMode(new JavaScriptMode());
|
||||
```
|
||||
|
||||
|
|
|
|||
158
api/editor.html
158
api/editor.html
|
|
@ -390,8 +390,8 @@
|
|||
</div>
|
||||
<div class="description"><p>Creates a new <code>Editor</code> object.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">renderer</td><td class="argType" "><a href="virtual_renderer.html" class="" title="VirtualRenderer (class)" data-id="VirtualRenderer">VirtualRenderer</a></td><td class="argDescription "><p>Required. Associated <code>VirtualRenderer</code> that draws everything</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">session</td><td class="argType" "><a href="edit_session.html" class="" title="EditSession (class)" data-id="EditSession">EditSession</a></td><td class="argDescription "><p>Required. The <code>EditSession</code> to refer to</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">renderer</td><td class="argType"><a href="virtual_renderer.html" class="" title="VirtualRenderer (class)" data-id="VirtualRenderer">VirtualRenderer</a></td><td class="argDescription "><p>Required. Associated <code>VirtualRenderer</code> that draws everything</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">session</td><td class="argType"><a href="edit_session.html" class="" title="EditSession (class)" data-id="EditSession">EditSession</a></td><td class="argDescription "><p>Required. The <code>EditSession</code> to refer to</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -444,7 +444,7 @@
|
|||
</div>
|
||||
<div class="description"><p>Emitted whenever the document is changed.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">e</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. Contains a single property, <code>data</code>, which has the delta of changes</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">e</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. Contains a single property, <code>data</code>, which has the delta of changes</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -471,7 +471,7 @@
|
|||
</div>
|
||||
<div class="description"><p>Emitted when the selection style changes, via <a href="#Editor.setSelectionStyle" class="link-short" title="Editor.setSelectionStyle (class method)" data-id="Editor.setSelectionStyle"><code>Editor.setSelectionStyle()</code></a>.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">data</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. Contains one property, <code>data</code>, which indicates the new selection style</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">data</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. Contains one property, <code>data</code>, which indicates the new selection style</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -498,7 +498,7 @@
|
|||
</div>
|
||||
<div class="description"><p>Emitted whenever the <a href="edit_session.html" class="link-short" title="EditSession (class)" data-id="EditSession"><code>EditSession</code></a> changes.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">e</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. An object with two properties, <code>oldSession</code> and <code>session</code>, that represent the old and new <a href="edit_session.html" class="link-short" title="EditSession (class)" data-id="EditSession"><code>EditSession</code></a>s.</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">e</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. An object with two properties, <code>oldSession</code> and <code>session</code>, that represent the old and new <a href="edit_session.html" class="link-short" title="EditSession (class)" data-id="EditSession"><code>EditSession</code></a>s.</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -525,7 +525,7 @@
|
|||
</div>
|
||||
<div class="description"><p>Emitted when text is copied.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">text</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The copied text</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">text</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The copied text</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -564,7 +564,7 @@
|
|||
<ul class="signatures">
|
||||
<li class="signature">
|
||||
<ul>
|
||||
<li class="signature-call"><span class="eventObjName">Editor</span><span class="eventListenerStart">.on("</span><span id="Editor.event.paste" class="member-name eventMember methodClicker">paste</span><span class="eventListenerClose">", </span><span class="eventFunctionOpen">function(</span><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="argument methodClicker" title="String" data-id="String">String</a> text<span class="eventFunctionClose">))</span></li>
|
||||
<li class="signature-call"><span class="eventObjName">Editor</span><span class="eventListenerStart">.on("</span><span id="Editor.event.paste" class="member-name eventMember methodClicker">paste</span><span class="eventListenerClose">", </span><span class="eventFunctionOpen">function(</span><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="argument methodClicker" title="Object" data-id="Object">Object</a> e<span class="eventFunctionClose">))</span></li>
|
||||
</ul>
|
||||
<ul class="metaInfo">
|
||||
</ul>
|
||||
|
|
@ -577,7 +577,7 @@
|
|||
</div>
|
||||
<div class="description"><p>Emitted when text is pasted.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">text</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The pasted text</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">e</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. An object which contains one property, <code>text</code>, that represents the text to be pasted. Editing this property will alter the text that is pasted.</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -610,7 +610,7 @@
|
|||
</div>
|
||||
<div class="description"><p>Adds the selection and cursor.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">orientedRange</td><td class="argType" "><a href="range.html" class="" title="Range (class)" data-id="Range">Range</a></td><td class="argDescription "><p>Required. A range containing a cursor</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">orientedRange</td><td class="argType"><a href="range.html" class="" title="Range (class)" data-id="Range">Range</a></td><td class="argDescription "><p>Required. A range containing a cursor</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -920,9 +920,9 @@
|
|||
</div>
|
||||
<div class="description"><p>Attempts to find <code>needle</code> within the document. For more information on <code>options</code>, see <a href="search.html" class="link-short" title="Search (class)" data-id="Search"><code>Search</code></a>.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">needle</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The text to search for (optional)</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">options</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. An object defining various search properties</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">animate</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. If <code>true</code> animate scrolling</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">needle</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The text to search for (optional)</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">options</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. An object defining various search properties</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">animate</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. If <code>true</code> animate scrolling</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -954,9 +954,9 @@
|
|||
</div>
|
||||
<div class="description"><p>Finds and selects all the occurences of <code>needle</code>.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">The</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. text to find</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">The</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. search options</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">keeps</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. </p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">The</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. text to find</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">The</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. search options</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">keeps</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. </p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -983,8 +983,8 @@
|
|||
</div>
|
||||
<div class="description"><p>Performs another search for <code>needle</code> in the document. For more information on <code>options</code>, see <a href="search.html" class="link-short" title="Search (class)" data-id="Search"><code>Search</code></a>.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">options</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. search options</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">animate</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. If <code>true</code> animate scrolling</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">options</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. search options</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">animate</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. If <code>true</code> animate scrolling</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1011,8 +1011,8 @@
|
|||
</div>
|
||||
<div class="description"><p>Performs a search for <code>needle</code> backwards. For more information on <code>options</code>, see <a href="search.html" class="link-short" title="Search (class)" data-id="Search"><code>Search</code></a>.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">options</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. search options</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">animate</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. If <code>true</code> animate scrolling</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">options</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. search options</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">animate</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. If <code>true</code> animate scrolling</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1064,8 +1064,8 @@
|
|||
</div>
|
||||
<div class="description"><p>Executes a command for each selection range.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">cmd</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The command to execute</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">args</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. Any arguments for the command</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">cmd</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The command to execute</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">args</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. Any arguments for the command</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1523,8 +1523,8 @@
|
|||
</div>
|
||||
<div class="description"><p>Works like <a href="#nav=api&api=edit_session" class="link-short" title="EditSession.getTokenAt (class method)" data-id="EditSession.getTokenAt"><code>EditSession.getTokenAt()</code></a>, except it returns a number.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">row</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. </p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">column</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. </p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">row</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. </p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">column</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. </p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1966,9 +1966,9 @@
|
|||
</div>
|
||||
<div class="description"><p>Moves the cursor to the specified line number, and also into the indiciated column.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">lineNumber</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The line number to go to</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">column</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. A column number to go to</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">animate</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. If <code>true</code> animates scolling</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">lineNumber</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The line number to go to</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">column</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. A column number to go to</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">animate</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. If <code>true</code> animates scolling</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -2070,7 +2070,7 @@
|
|||
</div>
|
||||
<div class="description"><p>Inserts <code>text</code> into wherever the cursor is pointing.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">text</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The new text to add</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">text</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The new text to add</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -2132,7 +2132,7 @@
|
|||
</div>
|
||||
<div class="description"><p>Indicates if the entire row is currently visible on the screen.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">row</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The row to check</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">row</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The row to check</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -2164,7 +2164,7 @@
|
|||
</div>
|
||||
<div class="description"><p>Indicates if the row is currently visible on the screen.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">row</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The row to check</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">row</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The row to check</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -2191,7 +2191,7 @@
|
|||
</div>
|
||||
<div class="description"><p>Moves the cursor's row and column to the next matching bracket.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">select</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. </p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">select</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. </p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -2218,7 +2218,7 @@
|
|||
</div>
|
||||
<div class="description"><p>If the character before the cursor is a number, this functions changes its value by <code>amount</code>.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">amount</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The value to change the numeral by (can be negative to decrease value)</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">amount</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The value to change the numeral by (can be negative to decrease value)</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -2245,8 +2245,8 @@
|
|||
</div>
|
||||
<div class="description"><p>Moves the cursor to the specified row and column. Note that this does not de-select the current selection.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">row</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The new row number</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">column</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The new column number</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">row</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The new row number</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">column</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The new column number</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -2273,7 +2273,7 @@
|
|||
</div>
|
||||
<div class="description"><p>Moves the cursor to the position indicated by <code>pos.row</code> and <code>pos.column</code>.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">pos</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. An object with two properties, row and column</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">pos</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. An object with two properties, row and column</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -2384,7 +2384,7 @@
|
|||
</div>
|
||||
<div class="description"><p>Moves the cursor down in the document the specified number of times. Note that this does de-select the current selection.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">times</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The number of times to change navigation</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">times</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The number of times to change navigation</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -2461,7 +2461,7 @@
|
|||
</div>
|
||||
<div class="description"><p>Moves the cursor left in the document the specified number of times. Note that this does de-select the current selection.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">times</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The number of times to change navigation</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">times</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The number of times to change navigation</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -2538,7 +2538,7 @@
|
|||
</div>
|
||||
<div class="description"><p>Moves the cursor right in the document the specified number of times. Note that this does de-select the current selection.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">times</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The number of times to change navigation</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">times</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The number of times to change navigation</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -2565,8 +2565,8 @@
|
|||
</div>
|
||||
<div class="description"><p>Moves the cursor to the specified row and column. Note that this does de-select the current selection.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">row</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The new row number</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">column</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The new column number</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">row</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The new row number</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">column</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The new column number</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -2593,7 +2593,7 @@
|
|||
</div>
|
||||
<div class="description"><p>Moves the cursor up in the document the specified number of times. Note that this does de-select the current selection.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">times</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The number of times to change navigation</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">times</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The number of times to change navigation</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -3105,7 +3105,7 @@
|
|||
</div>
|
||||
<div class="description"><p>Called whenever a text "paste" happens.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">text</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The pasted text</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">text</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The pasted text</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -3277,7 +3277,7 @@
|
|||
</div>
|
||||
<div class="description"><p>Removes words of text from the editor. A "word" is defined as a string of characters bookended by whitespace.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">dir</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The direction of the deletion to occur, either "left" or "right"</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">dir</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The direction of the deletion to occur, either "left" or "right"</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -3329,7 +3329,7 @@
|
|||
</div>
|
||||
<div class="description"><p>Removes the selection marker.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">The</td><td class="argType" "><a href="range.html" class="" title="Range (class)" data-id="Range">Range</a></td><td class="argDescription "><p>Required. selection range added with <a href="#nav=api&api=multi_select" class="link-short" title="Editor.addSelectionMarker (class method)" data-id="Editor.addSelectionMarker"><code>addSelectionMarker()</code></a>.</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">The</td><td class="argType"><a href="range.html" class="" title="Range (class)" data-id="Range">Range</a></td><td class="argDescription "><p>Required. selection range added with <a href="#nav=api&api=multi_select" class="link-short" title="Editor.addSelectionMarker (class method)" data-id="Editor.addSelectionMarker"><code>addSelectionMarker()</code></a>.</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -3456,8 +3456,8 @@
|
|||
</div>
|
||||
<div class="description"><p>Replaces the first occurance of <code>options.needle</code> with the value in <code>replacement</code>.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">replacement</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The text to replace with</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">options</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. The <a href="search.html" class="link-short" title="Search (class)" data-id="Search"><code>Search</code></a> options to use</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">replacement</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The text to replace with</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">options</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. The <a href="search.html" class="link-short" title="Search (class)" data-id="Search"><code>Search</code></a> options to use</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -3484,8 +3484,8 @@
|
|||
</div>
|
||||
<div class="description"><p>Replaces all occurances of <code>options.needle</code> with the value in <code>replacement</code>.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">replacement</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The text to replace with</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">options</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. The <a href="search.html" class="link-short" title="Search (class)" data-id="Search"><code>Search</code></a> options to use</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">replacement</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The text to replace with</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">options</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. The <a href="search.html" class="link-short" title="Search (class)" data-id="Search"><code>Search</code></a> options to use</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -3512,7 +3512,7 @@
|
|||
</div>
|
||||
<div class="description"><p>Triggers a resize of the editor.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">force</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. If <code>true</code>, recomputes the size, even if the height and width haven't changed</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">force</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. If <code>true</code>, recomputes the size, even if the height and width haven't changed</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -3613,10 +3613,10 @@
|
|||
</div>
|
||||
<div class="description"><p>Scrolls to a line. If <code>center</code> is <code>true</code>, it puts the line in middle of screen (or attempts to).</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">line</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The line to scroll to</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">center</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. If <code>true</code></p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">animate</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. If <code>true</code> animates scrolling</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">callback</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Function" class="" title="Function" data-id="Function">Function</a></td><td class="argDescription "><p>Required. Function to be called when the animation has finished</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">line</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The line to scroll to</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">center</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. If <code>true</code></p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">animate</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. If <code>true</code> animates scrolling</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">callback</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Function" class="" title="Function" data-id="Function">Function</a></td><td class="argDescription "><p>Required. Function to be called when the animation has finished</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -3643,7 +3643,7 @@
|
|||
</div>
|
||||
<div class="description"><p>Moves the editor to the specified row.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">row</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. </p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">row</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. </p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -3695,8 +3695,8 @@
|
|||
</div>
|
||||
<div class="description"><p>Finds the next occurence of text in an active selection and adds it to the selections.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">dir</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The direction of lines to select: -1 for up, 1 for down</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">skip</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. If <code>true</code>, removes the active selection range</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">dir</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The direction of lines to select: -1 for up, 1 for down</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">skip</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. If <code>true</code>, removes the active selection range</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -3723,8 +3723,8 @@
|
|||
</div>
|
||||
<div class="description"><p>Adds a cursor above or below the active cursor.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">dir</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The direction of lines to select: -1 for up, 1 for down</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">skip</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. If <code>true</code>, removes the active selection range</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">dir</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The direction of lines to select: -1 for up, 1 for down</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">skip</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. If <code>true</code>, removes the active selection range</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -3825,7 +3825,7 @@
|
|||
</div>
|
||||
<div class="description"><p>Specifies whether to use behaviors or not. "Behaviors" in this case is the auto-pairing of special characters, like quotation marks, parenthesis, or brackets.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">enabled</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. Enables or disables behaviors</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">enabled</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. Enables or disables behaviors</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -3876,7 +3876,7 @@
|
|||
</div>
|
||||
<div class="description"><p>Sets the delay (in milliseconds) of the mouse drag.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">dragDelay</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. A value indicating the new delay</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">dragDelay</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. A value indicating the new delay</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -3927,7 +3927,7 @@
|
|||
</div>
|
||||
<div class="description"><p>Set a new font size (in pixels) for the editor text.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">size</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. A font size</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">size</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. A font size</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -3954,7 +3954,7 @@
|
|||
</div>
|
||||
<div class="description"><p>Determines whether or not the current line should be highlighted.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">shouldHighlight</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. Set to <code>true</code> to highlight the current line</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">shouldHighlight</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. Set to <code>true</code> to highlight the current line</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -4005,7 +4005,7 @@
|
|||
</div>
|
||||
<div class="description"><p>Determines if the currently selected word should be highlighted.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">shouldHighlight</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. Set to <code>true</code> to highlight the currently selected word</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">shouldHighlight</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. Set to <code>true</code> to highlight the currently selected word</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -4032,7 +4032,7 @@
|
|||
</div>
|
||||
<div class="description"><p>Sets a new key handler, such as "vim" or "windows".</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">keyboardHandler</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The new key handler</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">keyboardHandler</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The new key handler</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -4059,7 +4059,7 @@
|
|||
</div>
|
||||
<div class="description"><p>Pass in <code>true</code> to enable overwrites in your session, or <code>false</code> to disable. If overwrites is enabled, any text you enter will type over any text after it. If the value of <code>overwrite</code> changes, this function also emites the <code>changeOverwrite</code> event.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">overwrite</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. Defines wheter or not to set overwrites</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">overwrite</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. Defines wheter or not to set overwrites</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -4086,7 +4086,7 @@
|
|||
</div>
|
||||
<div class="description"><p>Sets the column defining where the print margin should be.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">showPrintMargin</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. Specifies the new print margin</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">showPrintMargin</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. Specifies the new print margin</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -4113,7 +4113,7 @@
|
|||
</div>
|
||||
<div class="description"><p>If <code>readOnly</code> is true, then the editor is set to read-only mode, and none of the content can change.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">readOnly</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. Specifies whether the editor can be modified or not</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">readOnly</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. Specifies whether the editor can be modified or not</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -4140,7 +4140,7 @@
|
|||
</div>
|
||||
<div class="description"><p>Sets how fast the mouse scrolling should do.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">speed</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. A value indicating the new speed (in milliseconds)</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">speed</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. A value indicating the new speed (in milliseconds)</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -4170,7 +4170,7 @@
|
|||
although this code change in the future.</p>
|
||||
<p>This function also emits the <code>'changeSelectionStyle'</code> event.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">style</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The new selection style</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">style</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The new selection style</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -4197,7 +4197,7 @@ although this code change in the future.</p>
|
|||
</div>
|
||||
<div class="description"><p>Sets a new editsession to use. This method also emits the <code>'changeSession'</code> event.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">session</td><td class="argType" "><a href="edit_session.html" class="" title="EditSession (class)" data-id="EditSession">EditSession</a></td><td class="argDescription "><p>Required. The new session to use</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">session</td><td class="argType"><a href="edit_session.html" class="" title="EditSession (class)" data-id="EditSession">EditSession</a></td><td class="argDescription "><p>Required. The new session to use</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -4224,7 +4224,7 @@ although this code change in the future.</p>
|
|||
</div>
|
||||
<div class="description"><p>Indicates whether the fold widgets are shown or not.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">show</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. Specifies whether the fold widgets are shown</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">show</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. Specifies whether the fold widgets are shown</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -4251,7 +4251,7 @@ although this code change in the future.</p>
|
|||
</div>
|
||||
<div class="description"><p>If <code>showInvisibles</code> is set to <code>true</code>, invisible characters—like spaces or new lines—are show in the editor.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">showInvisibles</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. Specifies whether or not to show invisible characters</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">showInvisibles</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. Specifies whether or not to show invisible characters</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -4278,7 +4278,7 @@ although this code change in the future.</p>
|
|||
</div>
|
||||
<div class="description"><p>If <code>showPrintMargin</code> is set to <code>true</code>, the print margin is shown in the editor.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">showPrintMargin</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. Specifies whether or not to show the print margin</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">showPrintMargin</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. Specifies whether or not to show the print margin</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -4305,7 +4305,7 @@ although this code change in the future.</p>
|
|||
</div>
|
||||
<div class="description"><p>Adds a new class, <code>style</code>, to the editor.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">style</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. A class name</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">style</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. A class name</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -4332,7 +4332,7 @@ although this code change in the future.</p>
|
|||
</div>
|
||||
<div class="description"><p>Sets a new theme for the editor. <code>theme</code> should exist, and be a directory path, like <code>ace/theme/textmate</code>.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">theme</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The path to a theme</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">theme</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The path to a theme</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -4364,8 +4364,8 @@ although this code change in the future.</p>
|
|||
</div>
|
||||
<div class="description"><p>Sets the current document to <code>val</code>.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">val</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The new value to set for the document</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">cursorPos</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. Where to set the new value. <code>undefined</code> or 0 is selectAll, -1 is at the document start, and 1 is at the end</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">val</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String" class="" title="String" data-id="String">String</a></td><td class="argDescription "><p>Required. The new value to set for the document</p>
|
||||
</td></tr><tr class="argumentRow "><td class="argName ">cursorPos</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. Where to set the new value. <code>undefined</code> or 0 is selectAll, -1 is at the document start, and 1 is at the end</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -4394,7 +4394,7 @@ when such a character is typed in.</p>
|
|||
<div class="description"><p>Specifies whether to use wrapping behaviors or not, i.e. automatically wrapping the selection with characters such as brackets
|
||||
when such a character is typed in.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">enabled</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. Enables or disables wrapping behaviors</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">enabled</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean" class="" title="Boolean" data-id="Boolean">Boolean</a></td><td class="argDescription "><p>Required. Enables or disables wrapping behaviors</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -4595,7 +4595,7 @@ when such a character is typed in.</p>
|
|||
</div>
|
||||
<div class="description"><p>Transposes the selected ranges.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">dir</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The direction to rotate selections</p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">dir</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number" class="" title="Number" data-id="Number">Number</a></td><td class="argDescription "><p>Required. The direction to rotate selections</p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -4647,7 +4647,7 @@ when such a character is typed in.</p>
|
|||
</div>
|
||||
<div class="description"><p>Removes the class <code>style</code> from the editor.</p>
|
||||
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">style</td><td class="argType" "><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. </p>
|
||||
<h4>Arguments</h4><table class="argumentTable argument-list table table-striped table-bordered"><tr class="argumentRow "><td class="argName ">style</td><td class="argType"><a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object" class="" title="Object" data-id="Object">Object</a></td><td class="argDescription "><p>Required. </p>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@
|
|||
<article id="Selection" data-title="Selection (class)" class="article">
|
||||
<div class="section description">
|
||||
<div class="memberContent"><p>Contains the cursor position and the text selection of an edit session.</p>
|
||||
<p>The row/columns used in the selection are in document coordinates representing ths coordinates as thez appear in the document before applying soft wrap and folding.</p>
|
||||
<p>The row/columns used in the selection are in document coordinates representing the coordinates as they appear in the document before applying soft wrap and folding.</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1778,4 +1778,4 @@
|
|||
<script defer src="./resources/javascripts/disqus-ext.js"></script>
|
||||
<script defer src="./resources/javascripts/ga.js"></script>
|
||||
<div id="disqus_thread"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
2
build
2
build
|
|
@ -1 +1 @@
|
|||
Subproject commit 995de31e6513ddfd5e9f66b8216f5b316fcd2253
|
||||
Subproject commit a4e495d8901876c6bafe3870a35cb8e32c827e97
|
||||
|
|
@ -20,7 +20,7 @@ function foo() {
|
|||
var bar = true;
|
||||
}</textarea><br>
|
||||
SourceUrl: <br>
|
||||
<input id="srcURL" style="width:300px" value="http://ajaxorg.github.com/ace-builds/textarea/src/"></input><br>
|
||||
<input id="srcURL" style="width:300px" value="http://ajaxorg.github.com/ace-builds/src-noconflict"></input><br>
|
||||
<button id="buBuild">Build Link</button> <br> <a href="#"></a>
|
||||
<a href="https://github.com/ajaxorg/ace/">
|
||||
<div class="fork_on_github" ></div>
|
||||
|
|
@ -49,63 +49,60 @@ function foo() {
|
|||
|
||||
<script>
|
||||
|
||||
function inject(callback) {
|
||||
var baseUrl = "src/";
|
||||
|
||||
var load = window.__ace_loader__ = function(path, module, callback) {
|
||||
function inject(options, callback) {
|
||||
var baseUrl = options.baseUrl || "../../src-noconflict";
|
||||
|
||||
var load = function(path, callback) {
|
||||
var head = document.getElementsByTagName('head')[0];
|
||||
var s = document.createElement('script');
|
||||
|
||||
s.src = baseUrl + path;
|
||||
|
||||
s.src = baseUrl + "/" + path;
|
||||
head.appendChild(s);
|
||||
|
||||
s.onload = function() {
|
||||
window.__ace_shadowed__.require([module], callback);
|
||||
|
||||
s.onload = s.onreadystatechange = function(_, isAbort) {
|
||||
if (isAbort || !s.readyState || s.readyState == "loaded" || s.readyState == "complete") {
|
||||
s = s.onload = s.onreadystatechange = null;
|
||||
if (!isAbort)
|
||||
callback();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
load('ace-bookmarklet.js', "ace/ext/textarea", function() {
|
||||
var ace = window.__ace_shadowed__;
|
||||
|
||||
ace.options.mode = "javascript";
|
||||
var Event = ace.require("ace/lib/event");
|
||||
var areas = document.getElementsByTagName("textarea");
|
||||
for (var i = 0; i < areas.length; i++) {
|
||||
Event.addListener(areas[i], "click", function(e) {
|
||||
if (e.detail == 3) {
|
||||
ace.transformTextarea(e.target, load);
|
||||
}
|
||||
});
|
||||
}
|
||||
callback && callback();
|
||||
load("ace.js", function() {
|
||||
ace.config.loadModule("ace/ext/textarea", function() {
|
||||
var event = ace.require("ace/lib/event");
|
||||
var areas = document.getElementsByTagName("textarea");
|
||||
for (var i = 0; i < areas.length; i++) {
|
||||
event.addListener(areas[i], "click", function(e) {
|
||||
if (e.detail == 3) {
|
||||
ace.transformTextarea(e.target, options.ace);
|
||||
}
|
||||
});
|
||||
}
|
||||
callback && callback();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Call the inject function to load the ace files.
|
||||
var textAce;
|
||||
inject(function () {
|
||||
inject({}, function () {
|
||||
// Transform the textarea on the page into an ace editor.
|
||||
var ace = window.__ace_shadowed__;
|
||||
var t = document.querySelector("textarea");
|
||||
textAce = ace.transformTextarea(t, window.__ace_loader__);
|
||||
textAce = ace.require("ace/ext/textarea").transformTextarea(t);
|
||||
setTimeout(function(){textAce.setDisplaySettings(true)});
|
||||
});
|
||||
|
||||
|
||||
document.getElementById("buBuild").onclick = function() {
|
||||
var injectSrc = inject.toString().split("\n").join("");
|
||||
injectSrc = injectSrc.replace('baseUrl = "src/"', 'baseUrl="' + document.getElementById("srcURL").value + '"');
|
||||
|
||||
var aceOptions = textAce.getOptions();
|
||||
var opt = [];
|
||||
for (var option in aceOptions) {
|
||||
opt.push(option + ":'" + aceOptions[option] + "'");
|
||||
}
|
||||
injectSrc = injectSrc.replace('ace.options.mode = "javascript"', 'ace.options = { ' + opt.join(",") + ' }');
|
||||
injectSrc = injectSrc.replace(/\s+/g, " ");
|
||||
|
||||
var options = textAce.getOptions();
|
||||
options.baseUrl = document.getElementById("srcURL").value;
|
||||
|
||||
var a = document.querySelector("a");
|
||||
a.href = "javascript:(" + injectSrc + ")()";
|
||||
a.href = "javascript:(" + injectSrc + ")(" + JSON.stringify(options) + ")";
|
||||
a.innerHTML = "Ace Bookmarklet Link";
|
||||
}
|
||||
|
||||
|
|
@ -8,8 +8,8 @@
|
|||
body {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#editor {
|
||||
|
||||
#editor {
|
||||
margin: 0;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
alert("Ace Rocks " + items[i]);
|
||||
}
|
||||
}</pre>
|
||||
|
||||
|
||||
<script src="src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script>
|
||||
var editor = ace.edit("editor");
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* 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
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* * 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
|
||||
|
|
@ -38,69 +38,62 @@
|
|||
|
||||
var ACE_NAMESPACE = "";
|
||||
|
||||
var global = (function() {
|
||||
return this;
|
||||
})();
|
||||
var global = (function() { return this; })();
|
||||
if (!global && typeof window != "undefined") global = window; // strict mode
|
||||
|
||||
|
||||
if (!ACE_NAMESPACE && typeof requirejs !== "undefined")
|
||||
return;
|
||||
|
||||
|
||||
var _define = function(module, deps, payload) {
|
||||
if (typeof module !== 'string') {
|
||||
if (_define.original)
|
||||
_define.original.apply(window, arguments);
|
||||
var define = function(module, deps, payload) {
|
||||
if (typeof module !== "string") {
|
||||
if (define.original)
|
||||
define.original.apply(this, arguments);
|
||||
else {
|
||||
console.error('dropping module because define wasn\'t a string.');
|
||||
console.error("dropping module because define wasn\'t a string.");
|
||||
console.trace();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (arguments.length == 2)
|
||||
payload = deps;
|
||||
|
||||
if (!_define.modules) {
|
||||
_define.modules = {};
|
||||
_define.payloads = {};
|
||||
if (!define.modules[module]) {
|
||||
define.payloads[module] = payload;
|
||||
define.modules[module] = null;
|
||||
}
|
||||
|
||||
_define.payloads[module] = payload;
|
||||
_define.modules[module] = null;
|
||||
};
|
||||
|
||||
define.modules = {};
|
||||
define.payloads = {};
|
||||
|
||||
/**
|
||||
* Get at functionality define()ed using the function above
|
||||
*/
|
||||
var _require = function(parentId, module, callback) {
|
||||
if (Object.prototype.toString.call(module) === "[object Array]") {
|
||||
if (typeof module === "string") {
|
||||
var payload = lookup(parentId, module);
|
||||
if (payload != undefined) {
|
||||
callback && callback();
|
||||
return payload;
|
||||
}
|
||||
} else if (Object.prototype.toString.call(module) === "[object Array]") {
|
||||
var params = [];
|
||||
for (var i = 0, l = module.length; i < l; ++i) {
|
||||
var dep = lookup(parentId, module[i]);
|
||||
if (!dep && _require.original)
|
||||
return _require.original.apply(window, arguments);
|
||||
if (dep == undefined && require.original)
|
||||
return;
|
||||
params.push(dep);
|
||||
}
|
||||
if (callback) {
|
||||
callback.apply(null, params);
|
||||
}
|
||||
return callback && callback.apply(null, params) || true;
|
||||
}
|
||||
else if (typeof module === 'string') {
|
||||
var payload = lookup(parentId, module);
|
||||
if (!payload && _require.original)
|
||||
return _require.original.apply(window, arguments);
|
||||
};
|
||||
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
|
||||
return payload;
|
||||
}
|
||||
else {
|
||||
if (_require.original)
|
||||
return _require.original.apply(window, arguments);
|
||||
}
|
||||
var require = function(module, callback) {
|
||||
var packagedModule = _require("", module, callback);
|
||||
if (packagedModule == undefined && require.original)
|
||||
return require.original.apply(this, arguments);
|
||||
return packagedModule;
|
||||
};
|
||||
|
||||
var normalizeModule = function(parentId, moduleName) {
|
||||
|
|
@ -119,7 +112,6 @@ var normalizeModule = function(parentId, moduleName) {
|
|||
moduleName = moduleName.replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, "");
|
||||
}
|
||||
}
|
||||
|
||||
return moduleName;
|
||||
};
|
||||
|
||||
|
|
@ -128,12 +120,11 @@ var normalizeModule = function(parentId, moduleName) {
|
|||
* definition function if needed.
|
||||
*/
|
||||
var lookup = function(parentId, moduleName) {
|
||||
|
||||
moduleName = normalizeModule(parentId, moduleName);
|
||||
|
||||
var module = _define.modules[moduleName];
|
||||
var module = define.modules[moduleName];
|
||||
if (!module) {
|
||||
module = _define.payloads[moduleName];
|
||||
module = define.payloads[moduleName];
|
||||
if (typeof module === 'function') {
|
||||
var exports = {};
|
||||
var mod = {
|
||||
|
|
@ -149,19 +140,15 @@ var lookup = function(parentId, moduleName) {
|
|||
|
||||
var returnValue = module(req, exports, mod);
|
||||
exports = returnValue || mod.exports;
|
||||
_define.modules[moduleName] = exports;
|
||||
delete _define.payloads[moduleName];
|
||||
define.modules[moduleName] = exports;
|
||||
delete define.payloads[moduleName];
|
||||
}
|
||||
module = _define.modules[moduleName] = exports || module;
|
||||
module = define.modules[moduleName] = exports || module;
|
||||
}
|
||||
return module;
|
||||
};
|
||||
|
||||
function exportAce(ns) {
|
||||
var require = function(module, callback) {
|
||||
return _require("", module, callback);
|
||||
};
|
||||
|
||||
var root = global;
|
||||
if (ns) {
|
||||
if (!global[ns])
|
||||
|
|
@ -170,13 +157,13 @@ function exportAce(ns) {
|
|||
}
|
||||
|
||||
if (!root.define || !root.define.packaged) {
|
||||
_define.original = root.define;
|
||||
root.define = _define;
|
||||
define.original = root.define;
|
||||
root.define = define;
|
||||
root.define.packaged = true;
|
||||
}
|
||||
|
||||
if (!root.require || !root.require.packaged) {
|
||||
_require.original = root.require;
|
||||
require.original = root.require;
|
||||
root.require = require;
|
||||
root.require.packaged = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ body {
|
|||
margin:0;
|
||||
padding:0;
|
||||
background-color:#e6f5fc;
|
||||
|
||||
|
||||
}
|
||||
|
||||
H2, H3, H4 {
|
||||
|
|
@ -58,7 +58,7 @@ PRE{
|
|||
position:relative;
|
||||
overflow:hidden;
|
||||
background: url(images/background.png) repeat-x 0 0;
|
||||
border-bottom:1px solid #c9e8fa;
|
||||
border-bottom:1px solid #c9e8fa;
|
||||
}
|
||||
|
||||
#header .content .signature {
|
||||
|
|
@ -224,7 +224,3 @@ UL.menu-footer LI A {
|
|||
UL.menu-footer LI A:hover {
|
||||
text-decoration:underline;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,8 @@
|
|||
// enable autocompletion and snippets
|
||||
editor.setOptions({
|
||||
enableBasicAutocompletion: true,
|
||||
enableSnippets: true
|
||||
enableSnippets: true,
|
||||
enableLiveAutocompletion: false
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -7,42 +7,62 @@
|
|||
<style type="text/css" media="screen">
|
||||
|
||||
.ace_editor {
|
||||
position: relative !important;
|
||||
border: 1px solid lightgray;
|
||||
margin: auto;
|
||||
height: 200px;
|
||||
width: 80%;
|
||||
}
|
||||
.scrollmargin {
|
||||
height: 100px;
|
||||
height: 80px;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<pre id="editor">autoresizing editor</pre>
|
||||
<pre id="editor1">autoresizing editor</pre>
|
||||
<div class="scrollmargin"></div>
|
||||
<pre id="editor2">minHeight = 2 lines</pre>
|
||||
<div class="scrollmargin"></div>
|
||||
<pre id="editor3" style="width: 40%;"></pre>
|
||||
<div class="scrollmargin"></div>
|
||||
<pre id="editor"></pre>
|
||||
|
||||
<script src="../build/src/ace.js"></script>
|
||||
<script src="kitchen-sink/require.js"></script>
|
||||
<script>
|
||||
// setup paths
|
||||
require.config({paths: { "ace" : "../lib/ace"}});
|
||||
// load ace and extensions
|
||||
require(["ace/ace"], function(ace) {
|
||||
|
||||
// create first editor
|
||||
var editor = ace.edit("editor");
|
||||
editor.setTheme("ace/theme/tomorrow");
|
||||
editor.session.setMode("ace/mode/html");
|
||||
editor.setAutoScrollEditorIntoView();
|
||||
editor.setOption("maxLines", 100);
|
||||
|
||||
var editor2 = ace.edit("editor2");
|
||||
editor2.setTheme("ace/theme/tomorrow_night_blue");
|
||||
editor2.session.setMode("ace/mode/html");
|
||||
editor2.setAutoScrollEditorIntoView();
|
||||
editor2.setOption("maxLines", 30);
|
||||
editor2.setOption("minLines", 2);
|
||||
var editor1 = ace.edit("editor1");
|
||||
editor1.setTheme("ace/theme/tomorrow_night_eighties");
|
||||
editor1.session.setMode("ace/mode/html");
|
||||
editor1.setAutoScrollEditorIntoView(true);
|
||||
editor1.setOption("maxLines", 30);
|
||||
|
||||
var editor2 = ace.edit("editor2");
|
||||
editor2.setTheme("ace/theme/tomorrow_night_blue");
|
||||
editor2.session.setMode("ace/mode/html");
|
||||
editor2.setAutoScrollEditorIntoView(true);
|
||||
editor2.setOption("maxLines", 30);
|
||||
editor2.setOption("minLines", 2);
|
||||
|
||||
var editor = ace.edit("editor3");
|
||||
editor.setOptions({
|
||||
autoScrollEditorIntoView: true,
|
||||
maxLines: 8
|
||||
});
|
||||
editor.renderer.setScrollMargin(10, 10, 10, 10);
|
||||
|
||||
var editor = ace.edit("editor");
|
||||
editor.setTheme("ace/theme/tomorrow");
|
||||
editor.session.setMode("ace/mode/html");
|
||||
editor.setAutoScrollEditorIntoView(true);
|
||||
editor.setOption("maxLines", 100);
|
||||
});
|
||||
</script>
|
||||
|
||||
<script src="./show_own_source.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -22,19 +22,20 @@
|
|||
|
||||
<pre id="editor"></pre>
|
||||
|
||||
<!-- load ace -->
|
||||
<script src="../build/src-noconflict/ace.js"></script>
|
||||
<!-- load ace emmet extension -->
|
||||
<script src="../build/src-noconflict/ext-emmet.js"></script>
|
||||
<!-- load core emmet files -->
|
||||
<script src="http://nightwing.github.io/emmet-core/emmet.js"></script>
|
||||
<!-- load emmet code and snippets compiled for browser -->
|
||||
<script src="https://cloud9ide.github.io/emmet-core/emmet.js"></script>
|
||||
|
||||
<script src="kitchen-sink/require.js"></script>
|
||||
<script>
|
||||
// trigger extension
|
||||
ace.require("ace/ext/emmet");
|
||||
// setup paths
|
||||
require.config({paths: { "ace" : "../lib/ace"}});
|
||||
// load ace and extensions
|
||||
require(["ace/ace", "ace/ext/emmet"], function(ace) {
|
||||
var editor = ace.edit("editor");
|
||||
editor.session.setMode("ace/mode/html");
|
||||
// enable emmet on the current editor
|
||||
editor.setOption("enableEmmet", true);
|
||||
editor.setOption("enableEmmet", true);
|
||||
});
|
||||
</script>
|
||||
|
||||
<script src="./show_own_source.js"></script>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<title>ACE Editor StatusBar Demo</title>
|
||||
<style type="text/css" media="screen">
|
||||
/*!important without this top: 0; bottom: 0 doesn't work */
|
||||
/*!important without this top: 0; bottom: 0 doesn't work on old ie */
|
||||
body, html {
|
||||
position: absolute;
|
||||
top: 0px; bottom: 0; left: 0; right: 0;
|
||||
|
|
|
|||
|
|
@ -22,8 +22,11 @@
|
|||
|
||||
<pre id="editor"></pre>
|
||||
|
||||
<script src="../build/src-noconflict/ace.js"></script>
|
||||
<script src="kitchen-sink/require.js"></script>
|
||||
<script>
|
||||
// setup paths
|
||||
require.config({paths: { "ace" : "../lib/ace"}});
|
||||
require(["ace/ace"], function(ace) {
|
||||
var editor = ace.edit("editor")
|
||||
editor.setTheme("ace/theme/twilight")
|
||||
editor.session.setMode("ace/mode/html")
|
||||
|
|
@ -39,6 +42,8 @@
|
|||
})
|
||||
}
|
||||
})
|
||||
editor.execCommand("showKeyboardShortcuts")
|
||||
})
|
||||
</script>
|
||||
|
||||
<script src="./show_own_source.js"></script>
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ var whitespace = require("ace/ext/whitespace");
|
|||
|
||||
var doclist = require("./doclist");
|
||||
var modelist = require("ace/ext/modelist");
|
||||
var themelist = require("ace/ext/themelist");
|
||||
var layout = require("./layout");
|
||||
var TokenTooltip = require("./token_tooltip").TokenTooltip;
|
||||
var util = require("./util");
|
||||
|
|
@ -183,21 +184,21 @@ env.editor.commands.addCommands([{
|
|||
}
|
||||
}, {
|
||||
name: "increaseFontSize",
|
||||
bindKey: "Ctrl-+",
|
||||
bindKey: "Ctrl-=|Ctrl-+",
|
||||
exec: function(editor) {
|
||||
var size = parseInt(editor.getFontSize(), 10) || 12;
|
||||
editor.setFontSize(size + 1);
|
||||
}
|
||||
}, {
|
||||
name: "decreaseFontSize",
|
||||
bindKey: "Ctrl+-",
|
||||
bindKey: "Ctrl+-|Ctrl-_",
|
||||
exec: function(editor) {
|
||||
var size = parseInt(editor.getFontSize(), 10) || 12;
|
||||
editor.setFontSize(Math.max(size - 1 || 1));
|
||||
}
|
||||
}, {
|
||||
name: "resetFontSize",
|
||||
bindKey: "Ctrl+0",
|
||||
bindKey: "Ctrl+0|Ctrl-Numpad0",
|
||||
exec: function(editor) {
|
||||
editor.setFontSize(12);
|
||||
}
|
||||
|
|
@ -250,7 +251,7 @@ commands.addCommand({
|
|||
}
|
||||
});
|
||||
|
||||
var keybindings = {
|
||||
var keybindings = {
|
||||
ace: null, // Null = use "default" keymapping
|
||||
vim: require("ace/keyboard/vim").handler,
|
||||
emacs: "ace/keyboard/emacs",
|
||||
|
|
@ -316,7 +317,7 @@ doclist.history.index = 0;
|
|||
doclist.cycleOpen = function(editor, dir) {
|
||||
var h = this.history;
|
||||
h.index += dir;
|
||||
if (h.index >= h.length)
|
||||
if (h.index >= h.length)
|
||||
h.index = 0;
|
||||
else if (h.index <= 0)
|
||||
h.index = h.length - 1;
|
||||
|
|
@ -370,6 +371,12 @@ function updateUIEditorOptions() {
|
|||
saveOption(behavioursEl, editor.getBehavioursEnabled());
|
||||
}
|
||||
|
||||
themelist.themes.forEach(function(x){ x.value = x.theme });
|
||||
fillDropdown(themeEl, {
|
||||
Bright: themelist.themes.filter(function(x){return !x.isDark}),
|
||||
Dark: themelist.themes.filter(function(x){return x.isDark}),
|
||||
});
|
||||
|
||||
event.addListener(themeEl, "mouseover", function(e){
|
||||
themeEl.desiredValue = e.target.value;
|
||||
if (!themeEl.$timer)
|
||||
|
|
@ -383,7 +390,7 @@ event.addListener(themeEl, "mouseout", function(e){
|
|||
});
|
||||
|
||||
themeEl.updateTheme = function(){
|
||||
env.split.setTheme(themeEl.desiredValue || themeEl.selectedValue);
|
||||
env.split.setTheme((themeEl.desiredValue || themeEl.selectedValue));
|
||||
themeEl.$timer = null;
|
||||
};
|
||||
|
||||
|
|
@ -408,28 +415,11 @@ bindDropdown("folding", function(value) {
|
|||
});
|
||||
|
||||
bindDropdown("soft_wrap", function(value) {
|
||||
var session = env.editor.session;
|
||||
var renderer = env.editor.renderer;
|
||||
switch (value) {
|
||||
case "off":
|
||||
session.setUseWrapMode(false);
|
||||
renderer.setPrintMarginColumn(80);
|
||||
break;
|
||||
case "free":
|
||||
session.setUseWrapMode(true);
|
||||
session.setWrapLimitRange(null, null);
|
||||
renderer.setPrintMarginColumn(80);
|
||||
break;
|
||||
default:
|
||||
session.setUseWrapMode(true);
|
||||
var col = parseInt(value, 10);
|
||||
session.setWrapLimitRange(col, col);
|
||||
renderer.setPrintMarginColumn(col);
|
||||
}
|
||||
env.editor.setOption("wrap", value);
|
||||
});
|
||||
|
||||
bindCheckbox("select_style", function(checked) {
|
||||
env.editor.setSelectionStyle(checked ? "line" : "text");
|
||||
env.editor.setOption("selectionStyle", checked ? "line" : "text");
|
||||
});
|
||||
|
||||
bindCheckbox("highlight_active", function(checked) {
|
||||
|
|
@ -492,7 +482,7 @@ bindDropdown("split", function(value) {
|
|||
sp.setSplits(1);
|
||||
} else {
|
||||
var newEditor = (sp.getSplits() == 1);
|
||||
sp.setOrientation(value == "below" ? sp.BELOW : sp.BESIDE);
|
||||
sp.setOrientation(value == "below" ? sp.BELOW : sp.BESIDE);
|
||||
sp.setSplits(2);
|
||||
|
||||
if (newEditor) {
|
||||
|
|
@ -541,7 +531,7 @@ new StatusBar(env.editor, cmdLine.container);
|
|||
|
||||
|
||||
var Emmet = require("ace/ext/emmet");
|
||||
net.loadScript("http://nightwing.github.io/emmet-core/emmet.js", function() {
|
||||
net.loadScript("https://cloud9ide.github.io/emmet-core/emmet.js", function() {
|
||||
Emmet.setCore(window.emmet);
|
||||
env.editor.setOption("enableEmmet", true);
|
||||
});
|
||||
|
|
@ -585,7 +575,11 @@ env.editSnippets = function() {
|
|||
require("ace/ext/language_tools");
|
||||
env.editor.setOptions({
|
||||
enableBasicAutocompletion: true,
|
||||
enableLiveAutocompletion: false,
|
||||
enableSnippets: true
|
||||
});
|
||||
|
||||
});
|
||||
var beautify = require("ace/ext/beautify");
|
||||
env.editor.commands.addCommands(beautify.commands);
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -29,25 +29,33 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
// allow easy access to ace in console, but not in ace code which uses strict
|
||||
function isStrict() {
|
||||
try { return !arguments.callee.caller.caller.caller}
|
||||
catch(e){ return true }
|
||||
}
|
||||
var dom = require("ace/lib/dom");
|
||||
var Range = require("ace/range").Range;
|
||||
function warn() {
|
||||
if (isStrict()) {
|
||||
var s = (new Error()).stack || "";
|
||||
s = s.split("\n");
|
||||
if (s[1] == "Error") s.shift(); // remove error description on chrome
|
||||
s.shift(); // remove warn
|
||||
s.shift(); // remove the getter
|
||||
s = s.join("\n");
|
||||
// allow easy access to ace in console, but not in ace code
|
||||
if (!/at Object.InjectedScript.|@debugger eval|snippets:\/{3}|\(<anonymous>:\d+:\d+\)/.test(s)) {
|
||||
console.error("trying to access to global variable");
|
||||
}
|
||||
}
|
||||
function def(o, key, get) {
|
||||
Object.defineProperty(o, key, {
|
||||
configurable: true,
|
||||
get: get,
|
||||
set: function(val) {
|
||||
delete o[key];
|
||||
o[key] = val;
|
||||
}
|
||||
});
|
||||
try {
|
||||
Object.defineProperty(o, key, {
|
||||
configurable: true,
|
||||
get: get,
|
||||
set: function(val) {
|
||||
delete o[key];
|
||||
o[key] = val;
|
||||
}
|
||||
});
|
||||
} catch(e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
def(window, "ace", function(){ warn(); return window.env.editor });
|
||||
def(window, "editor", function(){ warn(); return window.env.editor });
|
||||
|
|
@ -55,21 +63,155 @@ def(window, "session", function(){ warn(); return window.env.editor.session });
|
|||
def(window, "split", function(){ warn(); return window.env.split });
|
||||
|
||||
|
||||
/* for textinput debuggging
|
||||
dom.importCssString("\
|
||||
.ace_text-input {\
|
||||
position: absolute;\
|
||||
z-index: 10!important;\
|
||||
width: 6em!important;\
|
||||
height: 1em;\
|
||||
opacity: 1!important;\
|
||||
background: rgba(0, 92, 255, 0.11);\
|
||||
border: none;\
|
||||
font: inherit;\
|
||||
padding: 0 1px;\
|
||||
margin: 0 -1px;\
|
||||
text-indent: 0em;\
|
||||
}\
|
||||
")*/
|
||||
def(window, "devUtil", function(){ warn(); return exports });
|
||||
exports.showTextArea = function(argument) {
|
||||
dom.importCssString("\
|
||||
.ace_text-input {\
|
||||
position: absolute;\
|
||||
z-index: 10!important;\
|
||||
width: 6em!important;\
|
||||
height: 1em;\
|
||||
opacity: 1!important;\
|
||||
background: rgba(0, 92, 255, 0.11);\
|
||||
border: none;\
|
||||
font: inherit;\
|
||||
padding: 0 1px;\
|
||||
margin: 0 -1px;\
|
||||
text-indent: 0em;\
|
||||
}\
|
||||
");
|
||||
};
|
||||
|
||||
exports.addGlobals = function() {
|
||||
window.oop = require("ace/lib/oop");
|
||||
window.dom = require("ace/lib/dom");
|
||||
window.Range = require("ace/range").Range;
|
||||
window.Editor = require("ace/editor").Editor;
|
||||
window.assert = require("ace/test/asyncjs/assert");
|
||||
window.asyncjs = require("ace/test/asyncjs/async");
|
||||
window.UndoManager = require("ace/undomanager").UndoManager;
|
||||
window.EditSession = require("ace/edit_session").EditSession;
|
||||
window.MockRenderer = require("ace/test/mockrenderer").MockRenderer;
|
||||
window.EventEmitter = require("ace/lib/event_emitter").EventEmitter;
|
||||
|
||||
window.getSelection = getSelection;
|
||||
window.setSelection = setSelection;
|
||||
window.testSelection = testSelection;
|
||||
};
|
||||
|
||||
function getSelection(editor) {
|
||||
var data = editor.multiSelect.toJSON();
|
||||
if (!data.length) data = [data];
|
||||
data = data.map(function(x) {
|
||||
var a, c;
|
||||
if (x.isBackwards) {
|
||||
a = x.end;
|
||||
c = x.start;
|
||||
} else {
|
||||
c = x.end;
|
||||
a = x.start;
|
||||
}
|
||||
return Range.comparePoints(a, c)
|
||||
? [a.row, a.column, c.row, c.column]
|
||||
: [a.row, a.column];
|
||||
});
|
||||
return data.length > 1 ? data : data[0];
|
||||
}
|
||||
function setSelection(editor, data) {
|
||||
if (typeof data[0] == "number")
|
||||
data = [data];
|
||||
editor.selection.fromJSON(data.map(function(x) {
|
||||
var start = {row: x[0], column: x[1]};
|
||||
var end = x.length == 2 ? start : {row: x[2], column: x[3]};
|
||||
var isBackwards = Range.comparePoints(start, end) > 0;
|
||||
return isBackwards ? {
|
||||
start: end,
|
||||
end: start,
|
||||
isBackwards: true
|
||||
} : {
|
||||
start: start,
|
||||
end: end,
|
||||
isBackwards: true
|
||||
};
|
||||
}));
|
||||
}
|
||||
function testSelection(editor, data) {
|
||||
assert.equal(getSelection(editor) + "", data + "");
|
||||
}
|
||||
|
||||
exports.recordTestCase = function() {
|
||||
exports.addGlobals();
|
||||
var editor = window.editor;
|
||||
var testcase = window.testcase = [];
|
||||
var assert;
|
||||
|
||||
testcase.push({
|
||||
type: "setValue",
|
||||
data: editor.getValue()
|
||||
}, {
|
||||
type: "setSelection",
|
||||
data: getSelection(editor)
|
||||
});
|
||||
editor.commands.on("afterExec", function(e) {
|
||||
testcase.push({
|
||||
type: "exec",
|
||||
data: e
|
||||
});
|
||||
testcase.push({
|
||||
type: "value",
|
||||
data: editor.getValue()
|
||||
});
|
||||
testcase.push({
|
||||
type: "selection",
|
||||
data: getSelection(editor)
|
||||
});
|
||||
});
|
||||
editor.on("mouseup", function() {
|
||||
testcase.push({
|
||||
type: "setSelection",
|
||||
data: getSelection(editor)
|
||||
});
|
||||
});
|
||||
|
||||
testcase.toString = function() {
|
||||
var lastValue = "";
|
||||
// var lastSelection = ""
|
||||
var str = this.map(function(x) {
|
||||
var data = x.data;
|
||||
switch (x.type) {
|
||||
case "exec":
|
||||
return 'editor.execCommand("'
|
||||
+ data.command.name
|
||||
+ (data.args ? '", ' + JSON.stringify(data.args) : '"')
|
||||
+ ')';
|
||||
case "setSelection":
|
||||
return 'setSelection(editor, ' + JSON.stringify(data) + ')';
|
||||
case "setValue":
|
||||
if (lastValue != data) {
|
||||
lastValue = data;
|
||||
return 'editor.setValue(' + JSON.stringify(data) + ', -1)';
|
||||
}
|
||||
return;
|
||||
case "selection":
|
||||
return 'testSelection(editor, ' + JSON.stringify(data) + ')';
|
||||
case "value":
|
||||
if (lastValue != data) {
|
||||
lastValue = data;
|
||||
return 'assert.equal('
|
||||
+ 'editor.getValue(),'
|
||||
+ JSON.stringify(data)
|
||||
+ ')';
|
||||
}
|
||||
return;
|
||||
}
|
||||
}).filter(Boolean).join("\n");
|
||||
|
||||
return getSelection + "\n"
|
||||
+ testSelection + "\n"
|
||||
+ setSelection + "\n"
|
||||
+ "\n" + str + "\n";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ var docs = {
|
|||
"docs/textile.textile": {name: "Textile", wrapped: true},
|
||||
|
||||
"docs/c9search.c9search_results": "C9 Search Results",
|
||||
"docs/mel.mel": "MEL",
|
||||
"docs/Nix.nix": "Nix"
|
||||
};
|
||||
|
||||
|
|
@ -85,9 +86,12 @@ var ownSource = {
|
|||
/* filled from require*/
|
||||
};
|
||||
|
||||
var hugeDocs = {
|
||||
var hugeDocs = require.toUrl ? {
|
||||
"build/src/ace.js": "",
|
||||
"build/src-min/ace.js": ""
|
||||
} : {
|
||||
"src/ace.js": "",
|
||||
"src-min/ace.js": ""
|
||||
};
|
||||
|
||||
modelist.modes.forEach(function(m) {
|
||||
|
|
@ -165,13 +169,44 @@ function loadDoc(name, callback) {
|
|||
});
|
||||
}
|
||||
|
||||
function saveDoc(name, callback) {
|
||||
var doc = fileCache[name] || name;
|
||||
if (!doc || !doc.session)
|
||||
return callback("Unknown document: " + name);
|
||||
|
||||
var path = doc.path;
|
||||
var parts = path.split("/");
|
||||
if (parts[0] == "docs")
|
||||
path = "demo/kitchen-sink/" + path;
|
||||
else if (parts[0] == "ace")
|
||||
path = "lib/" + path;
|
||||
|
||||
upload(path, doc.session.getValue(), callback);
|
||||
}
|
||||
|
||||
function upload(url, data, callback) {
|
||||
url = net.qualifyURL(url);
|
||||
if (!/https?:/.test(url))
|
||||
return callback(new Error("Unsupported url scheme"));
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("PUT", url, true);
|
||||
xhr.onreadystatechange = function () {
|
||||
if (xhr.readyState === 4) {
|
||||
callback(!/^2../.test(xhr.status));
|
||||
}
|
||||
};
|
||||
xhr.send(data);
|
||||
};
|
||||
|
||||
|
||||
module.exports = {
|
||||
fileCache: fileCache,
|
||||
docs: sort(prepareDocList(docs)),
|
||||
ownSource: prepareDocList(ownSource),
|
||||
hugeDocs: prepareDocList(hugeDocs),
|
||||
initDoc: initDoc,
|
||||
loadDoc: loadDoc
|
||||
loadDoc: loadDoc,
|
||||
saveDoc: saveDoc,
|
||||
};
|
||||
module.exports.all = {
|
||||
"Mode Examples": module.exports.docs,
|
||||
|
|
|
|||
11
demo/kitchen-sink/docs/.gitignore
vendored
Normal file
11
demo/kitchen-sink/docs/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# A sample .gitignore file.
|
||||
|
||||
.buildlog
|
||||
.DS_Store
|
||||
.svn
|
||||
|
||||
# Negated patterns:
|
||||
!foo.bar
|
||||
|
||||
# Also ignore user settings...
|
||||
/.settings
|
||||
53
demo/kitchen-sink/docs/Dockerfile
Normal file
53
demo/kitchen-sink/docs/Dockerfile
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
#
|
||||
# example Dockerfile for http://docs.docker.io/en/latest/examples/postgresql_service/
|
||||
#
|
||||
|
||||
FROM ubuntu
|
||||
MAINTAINER SvenDowideit@docker.com
|
||||
|
||||
# Add the PostgreSQL PGP key to verify their Debian packages.
|
||||
# It should be the same key as https://www.postgresql.org/media/keys/ACCC4CF8.asc
|
||||
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8
|
||||
|
||||
# Add PostgreSQL's repository. It contains the most recent stable release
|
||||
# of PostgreSQL, ``9.3``.
|
||||
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list
|
||||
|
||||
# Update the Ubuntu and PostgreSQL repository indexes
|
||||
RUN apt-get update
|
||||
|
||||
# Install ``python-software-properties``, ``software-properties-common`` and PostgreSQL 9.3
|
||||
# There are some warnings (in red) that show up during the build. You can hide
|
||||
# them by prefixing each apt-get statement with DEBIAN_FRONTEND=noninteractive
|
||||
RUN apt-get -y -q install python-software-properties software-properties-common
|
||||
RUN apt-get -y -q install postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3
|
||||
|
||||
# Note: The official Debian and Ubuntu images automatically ``apt-get clean``
|
||||
# after each ``apt-get``
|
||||
|
||||
# Run the rest of the commands as the ``postgres`` user created by the ``postgres-9.3`` package when it was ``apt-get installed``
|
||||
USER postgres
|
||||
|
||||
# Create a PostgreSQL role named ``docker`` with ``docker`` as the password and
|
||||
# then create a database `docker` owned by the ``docker`` role.
|
||||
# Note: here we use ``&&\`` to run commands one after the other - the ``\``
|
||||
# allows the RUN command to span multiple lines.
|
||||
RUN /etc/init.d/postgresql start &&\
|
||||
psql --command "CREATE USER docker WITH SUPERUSER PASSWORD 'docker';" &&\
|
||||
createdb -O docker docker
|
||||
|
||||
# Adjust PostgreSQL configuration so that remote connections to the
|
||||
# database are possible.
|
||||
RUN echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/9.3/main/pg_hba.conf
|
||||
|
||||
# And add ``listen_addresses`` to ``/etc/postgresql/9.3/main/postgresql.conf``
|
||||
RUN echo "listen_addresses='*'" >> /etc/postgresql/9.3/main/postgresql.conf
|
||||
|
||||
# Expose the PostgreSQL port
|
||||
EXPOSE 5432
|
||||
|
||||
# Add VOLUMEs to allow backup of config, logs and databases
|
||||
VOLUME ["/etc/postgresql", "/var/log/postgresql", "/var/lib/postgresql"]
|
||||
|
||||
# Set the default command to run when starting the container
|
||||
CMD ["/usr/lib/postgresql/9.3/bin/postgres", "-D", "/var/lib/postgresql/9.3/main", "-c", "config_file=/etc/postgresql/9.3/main/postgresql.conf"]
|
||||
171
demo/kitchen-sink/docs/abc.abc
Normal file
171
demo/kitchen-sink/docs/abc.abc
Normal file
|
|
@ -0,0 +1,171 @@
|
|||
%abc-2.1
|
||||
H:This file contains some example English tunes
|
||||
% note that the comments (like this one) are to highlight usages
|
||||
% and would not normally be included in such detail
|
||||
O:England % the origin of all tunes is England
|
||||
|
||||
X:1 % tune no 1
|
||||
T:Dusty Miller, The % title
|
||||
T:Binny's Jig % an alternative title
|
||||
C:Trad. % traditional
|
||||
R:DH % double hornpipe
|
||||
M:3/4 % meter
|
||||
K:G % key
|
||||
B>cd BAG|FA Ac BA|B>cd BAG|DG GB AG:|
|
||||
Bdd gfg|aA Ac BA|Bdd gfa|gG GB AG:|
|
||||
BG G/2G/2G BG|FA Ac BA|BG G/2G/2G BG|DG GB AG:|
|
||||
W:Hey, the dusty miller, and his dusty coat;
|
||||
W:He will win a shilling, or he spend a groat.
|
||||
W:Dusty was the coat, dusty was the colour;
|
||||
W:Dusty was the kiss, that I got frae the miller.
|
||||
|
||||
X:2
|
||||
T:Old Sir Simon the King
|
||||
C:Trad.
|
||||
S:Offord MSS % from Offord manuscript
|
||||
N:see also Playford % reference note
|
||||
M:9/8
|
||||
R:SJ % slip jig
|
||||
N:originally in C % transcription note
|
||||
K:G
|
||||
D|GFG GAG G2D|GFG GAG F2D|EFE EFE EFG|A2G F2E D2:|
|
||||
D|GAG GAB d2D|GAG GAB c2D|[1 EFE EFE EFG|[A2G] F2E D2:|\ % no line-break in score
|
||||
M:12/8 % change of meter
|
||||
[2 E2E EFE E2E EFG|\ % no line-break in score
|
||||
M:9/8 % change of meter
|
||||
A2G F2E D2|]
|
||||
|
||||
X:3
|
||||
T:William and Nancy
|
||||
T:New Mown Hay
|
||||
T:Legacy, The
|
||||
C:Trad.
|
||||
O:England; Gloucs; Bledington % place of origin
|
||||
B:Sussex Tune Book % can be found in these books
|
||||
B:Mally's Cotswold Morris vol.1 2
|
||||
D:Morris On % can be heard on this record
|
||||
P:(AB)2(AC)2A % play the parts in this order
|
||||
M:6/8
|
||||
K:G
|
||||
[P:A] D|"G"G2G GBd|"C"e2e "G"dBG|"D7"A2d "G"BAG|"C"E2"D7"F "G"G2:|
|
||||
[P:B] d|"G"e2d B2d|"C"gfe "G"d2d| "G"e2d B2d|"C"gfe "D7"d2c|
|
||||
"G"B2B Bcd|"C"e2e "G"dBG|"D7"A2d "G"BAG|"C"E2"D7"F "G"G2:|
|
||||
% changes of meter, using inline fields
|
||||
[T:Slows][M:4/4][L:1/4][P:C]"G"d2|"C"e2 "G"d2|B2 d2|"Em"gf "A7"e2|"D7"d2 "G"d2|\
|
||||
"C"e2 "G"d2|[M:3/8][L:1/8] "G"B2 d |[M:6/8] "C"gfe "D7"d2c|
|
||||
"G"B2B Bcd|"C"e2e "G"dBG|"D7"A2d "G"BAG|"C"E2"D7"F "G"G2:|
|
||||
|
||||
X:4
|
||||
T:South Downs Jig
|
||||
R:jig
|
||||
S:Robert Harbron
|
||||
M:6/8
|
||||
L:1/8
|
||||
K:G
|
||||
|: d | dcA G3 | EFG AFE | DEF GAB | cde d2d |
|
||||
dcA G3 | EFG AFE | DEF GAB | cAF G2 :|
|
||||
B | Bcd e2c | d2B c2A | Bcd e2c | [M:9/8]d2B c2B A3 |
|
||||
[M:6/8]DGF E3 | cBA FED | DEF GAB |1 cAF G2 :|2 cAF G3 |]
|
||||
|
||||
X:5
|
||||
T:Atholl Brose
|
||||
% in this example, which reproduces Highland Bagpipe gracing,
|
||||
% the large number of grace notes mean that it is more convenient to be specific about
|
||||
% score line-breaks (using the $ symbol), rather than using code line breaks to indicate them
|
||||
I:linebreak $
|
||||
K:D
|
||||
{gcd}c<{e}A {gAGAG}A2 {gef}e>A {gAGAG}Ad|
|
||||
{gcd}c<{e}A {gAGAG}A>e {ag}a>f {gef}e>d|
|
||||
{gcd}c<{e}A {gAGAG}A2 {gef}e>A {gAGAG}Ad|
|
||||
{g}c/d/e {g}G>{d}B {gf}gG {dc}d>B:|$
|
||||
{g}c<e {gf}g>e {ag}a>e {gf}g>e|
|
||||
{g}c<e {gf}g>e {ag}a2 {GdG}a>d|
|
||||
{g}c<e {gf}g>e {ag}a>e {gf}g>f|
|
||||
{gef}e>d {gf}g>d {gBd}B<{e}G {dc}d>B|
|
||||
{g}c<e {gf}g>e {ag}a>e {gf}g>e|
|
||||
{g}c<e {gf}g>e {ag}a2 {GdG}ad|
|
||||
{g}c<{GdG}e {gf}ga {f}g>e {g}f>d|
|
||||
{g}e/f/g {Gdc}d>c {gBd}B<{e}G {dc}d2|]
|
||||
|
||||
X:6
|
||||
T:Untitled Reel
|
||||
C:Trad.
|
||||
K:D
|
||||
eg|a2ab ageg|agbg agef|g2g2 fgag|f2d2 d2:|\
|
||||
ed|cecA B2ed|cAcA E2ed|cecA B2ed|c2A2 A2:|
|
||||
K:G
|
||||
AB|cdec BcdB|ABAF GFE2|cdec BcdB|c2A2 A2:|
|
||||
|
||||
X:7
|
||||
T:Kitchen Girl
|
||||
C:Trad.
|
||||
K:D
|
||||
[c4a4] [B4g4]|efed c2cd|e2f2 gaba|g2e2 e2fg|
|
||||
a4 g4|efed cdef|g2d2 efed|c2A2 A4:|
|
||||
K:G
|
||||
ABcA BAGB|ABAG EDEG|A2AB c2d2|e3f edcB|ABcA BAGB|
|
||||
ABAG EGAB|cBAc BAG2|A4 A4:|
|
||||
|
||||
%abc-2.1
|
||||
%%pagewidth 21cm
|
||||
%%pageheight 29.7cm
|
||||
%%topspace 0.5cm
|
||||
%%topmargin 1cm
|
||||
%%botmargin 0cm
|
||||
%%leftmargin 1cm
|
||||
%%rightmargin 1cm
|
||||
%%titlespace 0cm
|
||||
%%titlefont Times-Bold 32
|
||||
%%subtitlefont Times-Bold 24
|
||||
%%composerfont Times 16
|
||||
%%vocalfont Times-Roman 14
|
||||
%%staffsep 60pt
|
||||
%%sysstaffsep 20pt
|
||||
%%musicspace 1cm
|
||||
%%vocalspace 5pt
|
||||
%%measurenb 0
|
||||
%%barsperstaff 5
|
||||
%%scale 0.7
|
||||
X: 1
|
||||
T: Canzonetta a tre voci
|
||||
C: Claudio Monteverdi (1567-1643)
|
||||
M: C
|
||||
L: 1/4
|
||||
Q: "Andante mosso" 1/4 = 110
|
||||
%%score [1 2 3]
|
||||
V: 1 clef=treble name="Soprano"sname="A"
|
||||
V: 2 clef=treble name="Alto" sname="T"
|
||||
V: 3 clef=bass middle=d name="Tenor" sname="B"
|
||||
%%MIDI program 1 75 % recorder
|
||||
%%MIDI program 2 75
|
||||
%%MIDI program 3 75
|
||||
K: Eb
|
||||
% 1 - 4
|
||||
[V: 1] |:z4 |z4 |f2ec |_ddcc |
|
||||
w: Son que-sti~i cre-spi cri-ni~e
|
||||
w: Que-sti son gli~oc-chi che mi-
|
||||
[V: 2] |:c2BG|AAGc|(F/G/A/B/)c=A|B2AA |
|
||||
w: Son que-sti~i cre-spi cri-ni~e que - - - - sto~il vi-so e
|
||||
w: Que-sti son~gli oc-chi che mi-ran - - - - do fi-so mi-
|
||||
[V: 3] |:z4 |f2ec|_ddcf |(B/c/_d/e/)ff|
|
||||
w: Son que-sti~i cre-spi cri-ni~e que - - - - sto~il
|
||||
w: Que-sti son~gli oc-chi che mi-ran - - - - do
|
||||
% 5 - 9
|
||||
[V: 1] cAB2 |cAAA |c3B|G2!fermata!Gz ::e4|
|
||||
w: que-sto~il vi-so ond' io ri-man-go~uc-ci-so. Deh,
|
||||
w: ran-do fi-so, tut-to re-stai con-qui-so.
|
||||
[V: 2] AAG2 |AFFF |A3F|=E2!fermata!Ez::c4|
|
||||
w: que-sto~il vi-so ond' io ri-man-go~uc-ci-so. Deh,
|
||||
w: ran-do fi-so tut-to re-stai con-qui-so.
|
||||
[V: 3] (ag/f/e2)|A_ddd|A3B|c2!fermata!cz ::A4|
|
||||
w: vi - - - so ond' io ti-man-go~uc-ci-so. Deh,
|
||||
w: fi - - - so tut-to re-stai con-qui-so.
|
||||
% 10 - 15
|
||||
[V: 1] f_dec |B2c2|zAGF |\
|
||||
w: dim-me-lo ben mi-o, che que-sto\
|
||||
=EFG2 |1F2z2:|2F8|] % more notes
|
||||
w: sol de-si-o_. % more lyrics
|
||||
[V: 2] ABGA |G2AA|GF=EF |(GF3/2=E//D//E)|1F2z2:|2F8|]
|
||||
w: dim-me-lo ben mi-o, che que-sto sol de-si - - - - o_.
|
||||
[V: 3] _dBc>d|e2AF|=EFc_d|c4 |1F2z2:|2F8|]
|
||||
w: dim-me-lo ben mi-o, che que-sto sol de-si-o_.
|
||||
42
demo/kitchen-sink/docs/cirru.cirru
Normal file
42
demo/kitchen-sink/docs/cirru.cirru
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
-- 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)
|
||||
|
||||
print a
|
||||
int 1
|
||||
, b c
|
||||
int 2
|
||||
, d
|
||||
|
|
@ -1,28 +1,18 @@
|
|||
.text-layer {
|
||||
font-family: Monaco, "Courier New", monospace;
|
||||
font-size: 12pX;
|
||||
font: 12px Monaco, "Courier New", monospace;
|
||||
cursor: text;
|
||||
}
|
||||
|
||||
.blinker {
|
||||
animation-duration: 1s;
|
||||
animation-name: blink;
|
||||
animation-iteration-count: infinite;
|
||||
animation-direction: alternate;
|
||||
animation-timing-function: linear;
|
||||
animation: blink 1s linear infinite alternate;
|
||||
}
|
||||
|
||||
@keyframes blink {
|
||||
0% {
|
||||
0%, 40% {
|
||||
opacity: 0;
|
||||
}
|
||||
40% {
|
||||
opacity: 0;
|
||||
}
|
||||
40.5% {
|
||||
opacity: 1
|
||||
}
|
||||
100% {
|
||||
|
||||
40.5%, 100% {
|
||||
opacity: 1
|
||||
}
|
||||
}
|
||||
30
demo/kitchen-sink/docs/eiffel.e
Normal file
30
demo/kitchen-sink/docs/eiffel.e
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
note
|
||||
description: "Represents a person."
|
||||
|
||||
class
|
||||
PERSON
|
||||
|
||||
create
|
||||
make, make_unknown
|
||||
|
||||
feature {NONE} -- Creation
|
||||
|
||||
make (a_name: like name)
|
||||
-- Create a person with `a_name' as `name'.
|
||||
do
|
||||
name := a_name
|
||||
ensure
|
||||
name = a_name
|
||||
end
|
||||
|
||||
make_unknown
|
||||
do ensure
|
||||
name = Void
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
name: detachable STRING
|
||||
-- Full name or Void if unknown.
|
||||
|
||||
end
|
||||
|
|
@ -1 +1,31 @@
|
|||
TODO
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Cloud9 Rocks!</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Size</th>
|
||||
</tr>
|
||||
<% if (!isRoot) { %>
|
||||
<tr>
|
||||
<td><a href="..">..</a></td>
|
||||
<td></td></td>
|
||||
</tr>
|
||||
<% } %>
|
||||
<% entries.forEach(function(entry) { %>
|
||||
<tr>
|
||||
<td>
|
||||
<span class="glyphicon <%= entry.mime == 'directory' ? 'folder': 'file'%>"></span>
|
||||
<a href="<%= entry.name %>"><%= entry.name %></a>
|
||||
</td>
|
||||
<td><%= entry.size %></td>
|
||||
</tr>
|
||||
<% }) %>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
42
demo/kitchen-sink/docs/elixir.ex
Normal file
42
demo/kitchen-sink/docs/elixir.ex
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
defmodule HelloModule do
|
||||
@moduledoc """
|
||||
This is supposed to be `markdown`.
|
||||
__Yes__ this is [mark](http://down.format)
|
||||
|
||||
# Truly
|
||||
|
||||
## marked
|
||||
|
||||
* with lists
|
||||
* more
|
||||
* and more
|
||||
|
||||
Even.with(code)
|
||||
blocks |> with |> samples
|
||||
|
||||
_Docs are first class citizens in Elixir_ (Jose Valim)
|
||||
"""
|
||||
|
||||
# A "Hello world" function
|
||||
def some_fun do
|
||||
IO.puts "Juhu Kinners!"
|
||||
end
|
||||
# A private function
|
||||
defp priv do
|
||||
is_regex ~r"""
|
||||
This is a regex
|
||||
spanning several
|
||||
lines.
|
||||
"""
|
||||
x = elem({ :a, :b, :c }, 0) #=> :a
|
||||
end
|
||||
end
|
||||
|
||||
test_fun = fn(x) ->
|
||||
cond do
|
||||
x > 10 ->
|
||||
:greater_than_ten
|
||||
true ->
|
||||
:maybe_ten
|
||||
end
|
||||
end
|
||||
12
demo/kitchen-sink/docs/elm.elm
Normal file
12
demo/kitchen-sink/docs/elm.elm
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{- Ace {- 4 -} Elm -}
|
||||
main = lift clock (every second)
|
||||
|
||||
clock t = collage 400 400 [ filled lightGrey (ngon 12 110)
|
||||
, outlined (solid grey) (ngon 12 110)
|
||||
, hand orange 100 t
|
||||
, hand charcoal 100 (t/60)
|
||||
, hand charcoal 60 (t/720) ]
|
||||
|
||||
hand clr len time =
|
||||
let angle = degrees (90 - 6 * inSeconds time)
|
||||
in traced (solid clr) <| segment (0,0) (len * cos angle, len * sin angle)
|
||||
31
demo/kitchen-sink/docs/gcode.gcode
Normal file
31
demo/kitchen-sink/docs/gcode.gcode
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
O003 (DIAMOND SQUARE)
|
||||
N2 G54 G90 G49 G80
|
||||
N3 M6 T1 (1.ENDMILL)
|
||||
N4 M3 S1800
|
||||
N5 G0 X-.6 Y2.050
|
||||
N6 G43 H1 Z.1
|
||||
N7 G1 Z-.3 F50.
|
||||
N8 G41 D1 Y1.45
|
||||
N9 G1 X0 F20.
|
||||
N10 G2 J-1.45
|
||||
(CUTTER COMP CANCEL)
|
||||
N11 G1 Z-.2 F50.
|
||||
N12 Y-.990
|
||||
N13 G40
|
||||
N14 G0 X-.6 Y1.590
|
||||
N15 G0 Z.1
|
||||
N16 M5 G49 G28 G91 Z0
|
||||
N17 CALL O9456
|
||||
N18 #500=0.004
|
||||
N19 #503=[#500+#501]
|
||||
N20 VC45=0.0006
|
||||
VS4=0.0007
|
||||
N21 G90 G10 L20 P3 X5.Y4. Z6.567
|
||||
N22 G0 X5000
|
||||
N23 IF [#1 LT 0.370] GOTO 49
|
||||
N24 X-0.678 Y+.990
|
||||
N25 G84.3 X-0.1
|
||||
N26 #4=#5*COS[45]
|
||||
N27 #4=#5*SIN[45]
|
||||
N28 VZOFZ=652.9658
|
||||
%
|
||||
28
demo/kitchen-sink/docs/gherkin.feature
Normal file
28
demo/kitchen-sink/docs/gherkin.feature
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
@these @are @tags
|
||||
Feature: Serve coffee
|
||||
Coffee should not be served until paid for
|
||||
Coffee should not be served until the button has been pressed
|
||||
If there is no coffee left then money should be refunded
|
||||
|
||||
Scenario Outline: Eating
|
||||
Given there are <start> cucumbers
|
||||
When I eat <eat> cucumbers
|
||||
Then I should have <left> cucumbers
|
||||
|
||||
Examples:
|
||||
| start | eat | left |
|
||||
| 12 | 5 | 7 |
|
||||
| 20 | 5 | 15 |
|
||||
|
||||
Scenario: Buy last coffee
|
||||
Given there are 1 coffees left in the machine
|
||||
And I have deposited 1$
|
||||
When I press the coffee button
|
||||
Then I should be served a "coffee"
|
||||
|
||||
# this a comment
|
||||
|
||||
"""
|
||||
this is a
|
||||
pystring
|
||||
"""
|
||||
|
|
@ -3,6 +3,6 @@
|
|||
<div id="comments">
|
||||
{{#each comments}}
|
||||
<h2><a href="/posts/{{../permalink}}#{{id}}">{{title}}</a></h2>
|
||||
<div>{{body}}</div>
|
||||
<div>{{{body}}}</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
|
|
|
|||
10
demo/kitchen-sink/docs/htaccess
Normal file
10
demo/kitchen-sink/docs/htaccess
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
Redirect /linux http://www.linux.org
|
||||
Redirect 301 /kernel http://www.linux.org
|
||||
|
||||
# comment
|
||||
RewriteEngine on
|
||||
|
||||
RewriteCond %{HTTP_USER_AGENT} ^Mozilla.*
|
||||
RewriteRule ^/$ /homepage.max.html [L]
|
||||
|
||||
RewriteRule ^/$ /homepage.std.html [L]
|
||||
|
|
@ -1 +1,4 @@
|
|||
TODO
|
||||
[.ShellClassInfo]
|
||||
IconResource=..\logo.png
|
||||
[ViewState]
|
||||
FolderType=Generic
|
||||
|
|
|
|||
6
demo/kitchen-sink/docs/io.io
Normal file
6
demo/kitchen-sink/docs/io.io
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
// computes factorial of a number
|
||||
factorial := method(n,
|
||||
if(n == 0, return 1)
|
||||
res := 1
|
||||
Range 1 to(n) foreach(i, res = res * i)
|
||||
)
|
||||
|
|
@ -2,7 +2,7 @@ for op = (:+, :*, :&, :|, :$)
|
|||
@eval ($op)(a,b,c) = ($op)(($op)(a,b),c)
|
||||
end
|
||||
|
||||
|
||||
v = α';
|
||||
function g(x,y)
|
||||
return x * y
|
||||
x + y
|
||||
|
|
|
|||
9
demo/kitchen-sink/docs/lean.lean
Normal file
9
demo/kitchen-sink/docs/lean.lean
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import logic
|
||||
section
|
||||
variables (A : Type) (p q : A → Prop)
|
||||
|
||||
example : (∀x : A, p x ∧ q x) → ∀y : A, p y :=
|
||||
assume H : ∀x : A, p x ∧ q x,
|
||||
take y : A,
|
||||
show p y, from and.elim_left (H y)
|
||||
end
|
||||
|
|
@ -8,7 +8,7 @@ integer someIntNormal = 3672;
|
|||
integer someIntHex = 0x00000000;
|
||||
integer someIntMath = PI_BY_TWO;
|
||||
|
||||
integer event = 5673; // unimplemented reserved keyword!
|
||||
integer event = 5673; // invalid.illegal
|
||||
|
||||
key someKeyTexture = TEXTURE_DEFAULT;
|
||||
string someStringSpecial = EOF;
|
||||
|
|
@ -53,12 +53,12 @@ default
|
|||
someIntHex = 0x00000000;
|
||||
someIntMath = PI_BY_TWO;
|
||||
|
||||
event = 5673; // unimplemented reserved keyword!
|
||||
event = 5673; // invalid.illegal
|
||||
|
||||
someKeyTexture = TEXTURE_DEFAULT;
|
||||
someStringSpecial = EOF;
|
||||
|
||||
llCloud(ZERO_VECTOR); // invalid deprecated function!
|
||||
llSetInventoryPermMask("some item", MASK_NEXT, PERM_ALL); // reserved.godmode
|
||||
|
||||
llWhisper(PUBLIC_CHANNEL, "Leaving \"default\" now...");
|
||||
state other;
|
||||
|
|
|
|||
52
demo/kitchen-sink/docs/mask.mask
Normal file
52
demo/kitchen-sink/docs/mask.mask
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
/* Mask Syntax Demo */
|
||||
|
||||
div > ' Test ~[name]';
|
||||
|
||||
define :userProfile {
|
||||
header {
|
||||
h4 > @title;
|
||||
button.close;
|
||||
}
|
||||
}
|
||||
|
||||
:userProfile {
|
||||
@title > ' Hello ~[: username.toUpperCase()]'
|
||||
}
|
||||
|
||||
style {
|
||||
html, body {
|
||||
background: url('name.png') 0 0 no-repeat;
|
||||
}
|
||||
}
|
||||
|
||||
button {
|
||||
event click (e) {
|
||||
this.textContent = `name ${e.clientX} !`;
|
||||
}
|
||||
}
|
||||
|
||||
md > """
|
||||
|
||||
- div
|
||||
- span
|
||||
|
||||
Hello
|
||||
|
||||
[one](http://google.com)
|
||||
|
||||
""";
|
||||
|
||||
|
||||
header .foo > 'Heading'
|
||||
|
||||
button .baz x-signal='click: test' disabled > "
|
||||
Hello,
|
||||
world
|
||||
\"Buddy\"
|
||||
"
|
||||
|
||||
var a = {
|
||||
name: `name ${window.innerWidth}`
|
||||
};
|
||||
|
||||
span .foo > "~[bind: a.name]"
|
||||
|
|
@ -1 +1,17 @@
|
|||
TODO
|
||||
%{
|
||||
%{
|
||||
Ace Matlab demo
|
||||
%}
|
||||
%}
|
||||
|
||||
classdef hello
|
||||
methods
|
||||
function greet(this)
|
||||
disp('Hello!') % say hi
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
% transpose
|
||||
a = [ 'x''y', "x\n\
|
||||
y", 1' ]' + 2'
|
||||
33
demo/kitchen-sink/docs/mel.mel
Normal file
33
demo/kitchen-sink/docs/mel.mel
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
// animated duplicates, instances script
|
||||
proc animatedDuplication (int $rangeStart, int $rangeEnd, int $numOfDuplicates, int $duplicateOrInstance)
|
||||
{
|
||||
int $range_start = $rangeStart;
|
||||
int $range_end = $rangeEnd;
|
||||
int $num_of_duplicates = $numOfDuplicates;
|
||||
int $step_size = ($range_end - $range_start) / $num_of_duplicates;
|
||||
int $i = 0;
|
||||
int $temp;
|
||||
|
||||
currentTime $range_start; // set to range start
|
||||
|
||||
string $selectedObjects[]; // to store selected objects
|
||||
$selectedObjects = `ls -sl`; // store selected objects
|
||||
select $selectedObjects;
|
||||
|
||||
while ($i <= $num_of_duplicates)
|
||||
{
|
||||
$temp = $range_start + ($step_size * $i);
|
||||
currentTime ($temp);
|
||||
// seleced the objects to duplicate or instance
|
||||
select $selectedObjects;
|
||||
if($duplicateOrInstance == 0)
|
||||
{
|
||||
duplicate;
|
||||
}
|
||||
else
|
||||
{
|
||||
instance;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
|
@ -41,8 +41,8 @@ SELECT city, temp_lo, temp_hi, prcp, "date", location
|
|||
|
||||
/**
|
||||
* Dollar quotes starting at the end of the line are colored as SQL unless
|
||||
* a special language tag is used. Pearl and Python are currently implemented
|
||||
* but lots of others are possible.
|
||||
* a special language tag is used. Dollar quote syntax coloring is implemented
|
||||
* for Perl, Python, JavaScript, and Json.
|
||||
*/
|
||||
create or replace function blob_content_chunked(
|
||||
in p_data bytea,
|
||||
|
|
@ -82,6 +82,24 @@ CREATE FUNCTION usesavedplan() RETURNS trigger AS $python$
|
|||
SD["plan"] = plan
|
||||
$python$ LANGUAGE plpythonu;
|
||||
|
||||
-- pl/v8 (javascript)
|
||||
CREATE FUNCTION plv8_test(keys text[], vals text[]) RETURNS text AS $javascript$
|
||||
var o = {};
|
||||
for(var i=0; i<keys.length; i++){
|
||||
o[keys[i]] = vals[i];
|
||||
}
|
||||
return JSON.stringify(o);
|
||||
$javascript$ LANGUAGE plv8 IMMUTABLE STRICT;
|
||||
|
||||
-- json
|
||||
select * from json_object_keys($json$
|
||||
{
|
||||
"f1": 5,
|
||||
"f2": "test",
|
||||
"f3": {}
|
||||
}
|
||||
$json$);
|
||||
|
||||
|
||||
-- psql commands
|
||||
\df cash*
|
||||
|
|
|
|||
148
demo/kitchen-sink/docs/praat.praat
Normal file
148
demo/kitchen-sink/docs/praat.praat
Normal file
|
|
@ -0,0 +1,148 @@
|
|||
form Highlighter test
|
||||
sentence My_sentence This should all be a string
|
||||
text My_text This should also all be a string
|
||||
word My_word Only the first word is a string, the rest is invalid
|
||||
boolean Binary 1
|
||||
boolean Text no
|
||||
boolean Quoted "yes"
|
||||
comment This should be a string
|
||||
real left_Range -123.6
|
||||
positive right_Range_max 3.3
|
||||
integer Int 4
|
||||
natural Nat 4
|
||||
endform
|
||||
|
||||
# External scripts
|
||||
include /path/to/file
|
||||
runScript: "/path/to/file"
|
||||
execute /path/to/file
|
||||
|
||||
stopwatch
|
||||
|
||||
# old-style procedure call
|
||||
call oldStyle "quoted" 2 unquoted string
|
||||
assert oldStyle.local = 1
|
||||
|
||||
# New-style procedure call with parens
|
||||
@newStyle("quoted", 2, "quoted string")
|
||||
if praatVersion >= 5364
|
||||
# New-style procedure call with colon
|
||||
@newStyle: "quoted", 2, "quoted string"
|
||||
endif
|
||||
|
||||
# if-block with built-in variables
|
||||
if windows
|
||||
# We are on Windows
|
||||
elsif unix = 1 or !macintosh
|
||||
exitScript: "We are on Linux"
|
||||
else macintosh == 1
|
||||
exit We are on Mac
|
||||
endif
|
||||
|
||||
# inline if with inline comment
|
||||
var = if macintosh = 1 then 0 else 1 fi ; This is an inline comment
|
||||
|
||||
# for-loop with explicit from using local variable
|
||||
# and paren-style function calls and variable interpolation
|
||||
n = numberOfSelected("Sound")
|
||||
for i from newStyle.local to n
|
||||
sound'i' = selected("Sound", i)
|
||||
sound[i] = sound'i'
|
||||
endfor
|
||||
|
||||
for i from 1 to n
|
||||
# Different styles of object selection
|
||||
select sound'i'
|
||||
sound = selected()
|
||||
sound$ = selected$("Sound")
|
||||
select Sound 'sound$'
|
||||
selectObject(sound[i])
|
||||
selectObject: sound
|
||||
|
||||
# Pause commands
|
||||
beginPause("Viewing " + sound$)
|
||||
if i > 1
|
||||
button = endPause("Stop", "Previous",
|
||||
...if i = total_sounds then "Finish" else "Next" fi,
|
||||
...3, 1)
|
||||
else
|
||||
button = endPause("Stop",
|
||||
...if i = total_sounds then "Finish" else "Next" fi,
|
||||
...2, 1)
|
||||
endif
|
||||
editor_name$ = if total_textgrids then "TextGrid " else "Sound " fi + name$
|
||||
nocheck editor 'editor_name$'
|
||||
nocheck Close
|
||||
nocheck endeditor
|
||||
|
||||
# New-style standalone command call
|
||||
Rename: "SomeName"
|
||||
|
||||
# Command call with assignment
|
||||
duration = Get total duration
|
||||
|
||||
# Multi-line command with modifier
|
||||
pitch = noprogress To Pitch (ac): 0, 75, 15, "no",
|
||||
...0.03, 0.45, 0.01, 0.35, 0.14, 600
|
||||
|
||||
# do-style command with assignment
|
||||
minimum = do("Get minimum...", 0, 0, "Hertz", "Parabolic")
|
||||
|
||||
# New-style multi-line command call with broken strings
|
||||
table = Create Table with column names: "table", 0,
|
||||
..."file subject speaker
|
||||
...f0 f1 f2 f3 " +
|
||||
..."duration response"
|
||||
|
||||
removeObject: pitch, table
|
||||
|
||||
# Picture window commands
|
||||
selectObject: sound
|
||||
# do-style command
|
||||
do("Select inner viewport...", 1, 6, 0.5, 1.5)
|
||||
Black
|
||||
Draw... 0 0 0 0 "no" Curve
|
||||
Draw inner box
|
||||
Text bottom: "yes", sound$
|
||||
Erase all
|
||||
|
||||
# Demo window commands
|
||||
demo Erase all
|
||||
demo Select inner viewport... 0 100 0 100
|
||||
demo Axes... 0 100 0 100
|
||||
demo Paint rectangle... white 0 100 0 100
|
||||
demo Text... 50 centre 50 half Click to finish
|
||||
demoWaitForInput ( )
|
||||
demo Erase all
|
||||
demo Text: 50, "centre", 50, "half", "Finished"
|
||||
endfor
|
||||
|
||||
# An old-style sendpraat block
|
||||
sendpraat Praat
|
||||
...'newline$' Create Sound as pure tone... "tone" 1 0 0.4 44100 440 0.2 0.01 0.01
|
||||
...'newline$' Play
|
||||
...'newline$' Remove
|
||||
|
||||
# A new-style sendpraat block
|
||||
beginSendPraat: "Praat"
|
||||
Create Sound as pure tone: "tone", 1, 0, 0.4, 44100, 440, 0.2, 0.01, 0.01
|
||||
duration = Get total duration
|
||||
Remove
|
||||
endSendPraat: "duration"
|
||||
appendInfoLine: "The generated sound lasted for ", duration, "seconds"
|
||||
|
||||
time = stopwatch
|
||||
clearinfo
|
||||
echo This script took
|
||||
print 'time' seconds to
|
||||
printline execute.
|
||||
|
||||
# Old-style procedure declaration
|
||||
procedure oldStyle .str1$ .num .str2$
|
||||
.local = 1
|
||||
endproc
|
||||
|
||||
# New-style procedure declaration
|
||||
procedure newStyle (.str1$, .num, .str2$)
|
||||
.local = 1
|
||||
endproc
|
||||
|
|
@ -20,7 +20,7 @@ class Range
|
|||
end
|
||||
end
|
||||
|
||||
{:id => 34, :key => "value"}
|
||||
{:id => ?", :key => "value"}
|
||||
|
||||
|
||||
herDocs = [<<'FOO', <<BAR, <<-BAZ, <<-`EXEC`] #comment
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
# Script to open a browser to current branch
|
||||
# Repo formats:
|
||||
# ssh git@github.com:richoH/gh_pr.git
|
||||
# http https://richoH@github.com/richoH/gh_pr.git
|
||||
# git git://github.com/richoH/gh_pr.git
|
||||
# ssh git@github.com:richo/gh_pr.git
|
||||
# http https://richoH@github.com/richo/gh_pr.git
|
||||
# git git://github.com/richo/gh_pr.git
|
||||
|
||||
username=`git config --get github.user`
|
||||
|
||||
|
|
|
|||
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}
|
||||
72
demo/kitchen-sink/docs/sqlserver.sqlserver
Normal file
72
demo/kitchen-sink/docs/sqlserver.sqlserver
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
-- =============================================
|
||||
-- Author: Morgan Yarbrough
|
||||
-- Create date: 4/27/2015
|
||||
-- Description: Test procedure that shows off language features.
|
||||
-- Includes non-standard folding with region comments using either
|
||||
-- line comments or block comments (both are demonstrated below).
|
||||
-- This mode imitates SSMS and it designed to be used with SQL Server theme.
|
||||
-- =============================================
|
||||
CREATE PROCEDURE dbo.TestProcedure
|
||||
|
||||
--#region parameters
|
||||
@vint INT = 1
|
||||
,@vdate DATE = NULL
|
||||
,@vdatetime DATETIME = DATEADD(dd, 1, GETDATE())
|
||||
,@vvarchar VARCHAR(MAX) = ''
|
||||
--#endregion
|
||||
|
||||
AS
|
||||
BEGIN
|
||||
|
||||
/*#region set statements */
|
||||
SET NOCOUNT ON;
|
||||
SET XACT_ABORT ON;
|
||||
SET QUOTED_IDENTIFIER ON;
|
||||
/*#endregion*/
|
||||
|
||||
/**
|
||||
* These comments will produce a fold widget
|
||||
*/
|
||||
|
||||
-- folding demonstration
|
||||
SET @vint = CASE
|
||||
WHEN @vdate IS NULL
|
||||
THEN 1
|
||||
ELSE 2
|
||||
END
|
||||
|
||||
-- another folding demonstration
|
||||
IF @vint = 1
|
||||
BEGIN
|
||||
SET @vvarchar = 'one'
|
||||
SET @vint = DATEDIFF(dd, @vdate, @vdatetime)
|
||||
END
|
||||
|
||||
-- this mode handles strings properly
|
||||
DECLARE @sql NVARCHAR(4000) = N'SELECT TOP(1) OrderID
|
||||
FROM Orders
|
||||
WHERE @OrderDate > GETDATE()'
|
||||
|
||||
-- this mode is aware of built in stored procedures
|
||||
EXECUTE sp_executesql @sql
|
||||
|
||||
-- demonstrating some syntax highlighting
|
||||
SELECT Orders.OrderID
|
||||
,Customers.CompanyName
|
||||
,DATEFROMPARTS(YEAR(GETDATE()), 1, 1) AS FirstDayOfYear
|
||||
FROM Orders
|
||||
INNER JOIN Customers
|
||||
ON Orders.CustomerID = Customers.CustomerID
|
||||
WHERE CompanyName NOT LIKE '%something'
|
||||
OR CompanyName IS NULL
|
||||
OR CompanyName IN ('bla', 'nothing')
|
||||
|
||||
-- this mode includes snippets
|
||||
-- place your cusor at the end of the line below and trigger auto complete (Ctrl+Space)
|
||||
createpr
|
||||
|
||||
-- SQL Server allows using keywords as object names (not recommended) as long as they are wrapped in brackets
|
||||
DATABASE -- keyword
|
||||
[DATABASE] -- not a keyword
|
||||
|
||||
END
|
||||
21
demo/kitchen-sink/docs/vala.vala
Normal file
21
demo/kitchen-sink/docs/vala.vala
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
using Gtk;
|
||||
|
||||
int main (string[] args) {
|
||||
Gtk.init (ref args);
|
||||
var foo = new MyFoo<string[](), MyBar<string, int>>();
|
||||
|
||||
var window = new Window();
|
||||
window.title = "Hello, World!";
|
||||
window.border_width = 10;
|
||||
window.window_position = WindowPosition.CENTER;
|
||||
window.set_default_size(350, 70);
|
||||
window.destroy.connect(Gtk.main_quit);
|
||||
|
||||
var label = new Label("Hello, World!");
|
||||
|
||||
window.add(label);
|
||||
window.show_all();
|
||||
|
||||
Gtk.main();
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -53,16 +53,16 @@ require("ace/commands/default_commands").commands.push({
|
|||
return;
|
||||
}
|
||||
|
||||
var rowCount = 10;
|
||||
var rowCount = 10;
|
||||
var w = {
|
||||
row: row,
|
||||
// rowCount: rowCount,
|
||||
fixedWidth: true,
|
||||
el: dom.createElement("div"),
|
||||
editor: editor
|
||||
editor: inlineEditor
|
||||
};
|
||||
var el = w.el;
|
||||
el.appendChild(inlineEditor.container);
|
||||
el.appendChild(inlineEditor.container);
|
||||
|
||||
if (!editor.session.widgetManager) {
|
||||
editor.session.widgetManager = new LineWidgets(editor.session);
|
||||
|
|
@ -96,9 +96,6 @@ require("ace/commands/default_commands").commands.push({
|
|||
|
||||
editor.keyBinding.addKeyboardHandler(kb);
|
||||
inlineEditor.keyBinding.addKeyboardHandler(kb);
|
||||
editor.on("changeSession", function(e) {
|
||||
w.el.parentNode && w.el.parentNode.removeChild(w.el);
|
||||
});
|
||||
inlineEditor.setTheme("ace/theme/solarized_light");
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -116,7 +116,6 @@ exports.singleLineEditor = function(el) {
|
|||
|
||||
renderer.setStyle("ace_one-line");
|
||||
var editor = new Editor(renderer);
|
||||
new MultiSelect(editor);
|
||||
editor.session.setUndoManager(new UndoManager());
|
||||
|
||||
editor.setShowPrintMargin(false);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/** vim: et:ts=4:sw=4:sts=4
|
||||
* @license RequireJS 2.1.8+ Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
|
||||
* @license RequireJS 2.1.11+ Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
|
||||
* Available via the MIT or new BSD license.
|
||||
* see: http://github.com/jrburke/requirejs for details
|
||||
*/
|
||||
|
|
@ -12,7 +12,7 @@ var requirejs, require, define;
|
|||
(function (global) {
|
||||
var req, s, head, baseElement, dataMain, src,
|
||||
interactiveScript, currentlyAddingScript, mainScript, subPath,
|
||||
version = '2.1.8+',
|
||||
version = '2.1.11+',
|
||||
commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
|
||||
cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
|
||||
jsSuffixRegExp = /\.js$/,
|
||||
|
|
@ -22,7 +22,7 @@ var requirejs, require, define;
|
|||
hasOwn = op.hasOwnProperty,
|
||||
ap = Array.prototype,
|
||||
apsp = ap.splice,
|
||||
isBrowser = !!(typeof window !== 'undefined' && navigator && window.document),
|
||||
isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document),
|
||||
isWebWorker = !isBrowser && typeof importScripts !== 'undefined',
|
||||
//PS3 indicates loaded and complete, but need to wait for complete
|
||||
//specifically. Sequence is 'loading', 'loaded', execution,
|
||||
|
|
@ -108,7 +108,10 @@ var requirejs, require, define;
|
|||
if (source) {
|
||||
eachProp(source, function (value, prop) {
|
||||
if (force || !hasProp(target, prop)) {
|
||||
if (deepStringMixin && typeof value !== 'string') {
|
||||
if (deepStringMixin && typeof value === 'object' && value &&
|
||||
!isArray(value) && !isFunction(value) &&
|
||||
!(value instanceof RegExp)) {
|
||||
|
||||
if (!target[prop]) {
|
||||
target[prop] = {};
|
||||
}
|
||||
|
|
@ -138,7 +141,7 @@ var requirejs, require, define;
|
|||
throw err;
|
||||
}
|
||||
|
||||
//Allow getting a global that expressed in
|
||||
//Allow getting a global that is expressed in
|
||||
//dot notation, like 'a.b.c'.
|
||||
function getGlobal(value) {
|
||||
if (!value) {
|
||||
|
|
@ -177,7 +180,7 @@ var requirejs, require, define;
|
|||
|
||||
if (typeof requirejs !== 'undefined') {
|
||||
if (isFunction(requirejs)) {
|
||||
//Do not overwrite and existing requirejs instance.
|
||||
//Do not overwrite an existing requirejs instance.
|
||||
return;
|
||||
}
|
||||
cfg = requirejs;
|
||||
|
|
@ -201,6 +204,7 @@ var requirejs, require, define;
|
|||
waitSeconds: 7,
|
||||
baseUrl: './',
|
||||
paths: {},
|
||||
bundles: {},
|
||||
pkgs: {},
|
||||
shim: {},
|
||||
config: {}
|
||||
|
|
@ -214,6 +218,7 @@ var requirejs, require, define;
|
|||
defQueue = [],
|
||||
defined = {},
|
||||
urlFetched = {},
|
||||
bundlesMap = {},
|
||||
requireCounter = 1,
|
||||
unnormalizedCounter = 1;
|
||||
|
||||
|
|
@ -227,8 +232,8 @@ var requirejs, require, define;
|
|||
* @param {Array} ary the array of path segments.
|
||||
*/
|
||||
function trimDots(ary) {
|
||||
var i, part;
|
||||
for (i = 0; ary[i]; i += 1) {
|
||||
var i, part, length = ary.length;
|
||||
for (i = 0; i < length; i++) {
|
||||
part = ary[i];
|
||||
if (part === '.') {
|
||||
ary.splice(i, 1);
|
||||
|
|
@ -261,7 +266,7 @@ var requirejs, require, define;
|
|||
* @returns {String} normalized name
|
||||
*/
|
||||
function normalize(name, baseName, applyMap) {
|
||||
var pkgName, pkgConfig, mapValue, nameParts, i, j, nameSegment,
|
||||
var pkgMain, mapValue, nameParts, i, j, nameSegment, lastIndex,
|
||||
foundMap, foundI, foundStarMap, starI,
|
||||
baseParts = baseName && baseName.split('/'),
|
||||
normalizedBaseParts = baseParts,
|
||||
|
|
@ -274,29 +279,26 @@ var requirejs, require, define;
|
|||
//otherwise, assume it is a top-level require that will
|
||||
//be relative to baseUrl in the end.
|
||||
if (baseName) {
|
||||
if (getOwn(config.pkgs, baseName)) {
|
||||
//If the baseName is a package name, then just treat it as one
|
||||
//name to concat the name with.
|
||||
normalizedBaseParts = baseParts = [baseName];
|
||||
} else {
|
||||
//Convert baseName to array, and lop off the last part,
|
||||
//so that . matches that 'directory' and not name of the baseName's
|
||||
//module. For instance, baseName of 'one/two/three', maps to
|
||||
//'one/two/three.js', but we want the directory, 'one/two' for
|
||||
//this normalization.
|
||||
normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);
|
||||
//Convert baseName to array, and lop off the last part,
|
||||
//so that . matches that 'directory' and not name of the baseName's
|
||||
//module. For instance, baseName of 'one/two/three', maps to
|
||||
//'one/two/three.js', but we want the directory, 'one/two' for
|
||||
//this normalization.
|
||||
normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);
|
||||
name = name.split('/');
|
||||
lastIndex = name.length - 1;
|
||||
|
||||
// If wanting node ID compatibility, strip .js from end
|
||||
// of IDs. Have to do this here, and not in nameToUrl
|
||||
// because node allows either .js or non .js to map
|
||||
// to same file.
|
||||
if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {
|
||||
name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');
|
||||
}
|
||||
|
||||
name = normalizedBaseParts.concat(name.split('/'));
|
||||
name = normalizedBaseParts.concat(name);
|
||||
trimDots(name);
|
||||
|
||||
//Some use of packages may use a . path to reference the
|
||||
//'main' module name, so normalize for that.
|
||||
pkgConfig = getOwn(config.pkgs, (pkgName = name[0]));
|
||||
name = name.join('/');
|
||||
if (pkgConfig && name === pkgName + '/' + pkgConfig.main) {
|
||||
name = pkgName;
|
||||
}
|
||||
} else if (name.indexOf('./') === 0) {
|
||||
// No baseName, so this is ID is resolved relative
|
||||
// to baseUrl, pull off the leading dot.
|
||||
|
|
@ -308,7 +310,7 @@ var requirejs, require, define;
|
|||
if (applyMap && map && (baseParts || starMap)) {
|
||||
nameParts = name.split('/');
|
||||
|
||||
for (i = nameParts.length; i > 0; i -= 1) {
|
||||
outerLoop: for (i = nameParts.length; i > 0; i -= 1) {
|
||||
nameSegment = nameParts.slice(0, i).join('/');
|
||||
|
||||
if (baseParts) {
|
||||
|
|
@ -325,16 +327,12 @@ var requirejs, require, define;
|
|||
//Match, update name to the new value.
|
||||
foundMap = mapValue;
|
||||
foundI = i;
|
||||
break;
|
||||
break outerLoop;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (foundMap) {
|
||||
break;
|
||||
}
|
||||
|
||||
//Check for a star map match, but just hold on to it,
|
||||
//if there is a shorter segment match later in a matching
|
||||
//config, then favor over this star map.
|
||||
|
|
@ -355,7 +353,11 @@ var requirejs, require, define;
|
|||
}
|
||||
}
|
||||
|
||||
return name;
|
||||
// If the name points to a package's name, use
|
||||
// the package main instead.
|
||||
pkgMain = getOwn(config.pkgs, name);
|
||||
|
||||
return pkgMain ? pkgMain : name;
|
||||
}
|
||||
|
||||
function removeScript(name) {
|
||||
|
|
@ -373,12 +375,17 @@ var requirejs, require, define;
|
|||
function hasPathFallback(id) {
|
||||
var pathConfig = getOwn(config.paths, id);
|
||||
if (pathConfig && isArray(pathConfig) && pathConfig.length > 1) {
|
||||
removeScript(id);
|
||||
//Pop off the first array value, since it failed, and
|
||||
//retry
|
||||
pathConfig.shift();
|
||||
context.require.undef(id);
|
||||
context.require([id]);
|
||||
|
||||
//Custom require that does not do map translation, since
|
||||
//ID is "absolute", already mapped/resolved.
|
||||
context.makeRequire(null, {
|
||||
skipMap: true
|
||||
})([id]);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -549,7 +556,7 @@ var requirejs, require, define;
|
|||
//local var ref to defQueue, so cannot just reassign the one
|
||||
//on context.
|
||||
apsp.apply(defQueue,
|
||||
[defQueue.length - 1, 0].concat(globalDefQueue));
|
||||
[defQueue.length, 0].concat(globalDefQueue));
|
||||
globalDefQueue = [];
|
||||
}
|
||||
}
|
||||
|
|
@ -566,7 +573,7 @@ var requirejs, require, define;
|
|||
mod.usingExports = true;
|
||||
if (mod.map.isDefine) {
|
||||
if (mod.exports) {
|
||||
return mod.exports;
|
||||
return (defined[mod.map.id] = mod.exports);
|
||||
} else {
|
||||
return (mod.exports = defined[mod.map.id] = {});
|
||||
}
|
||||
|
|
@ -580,15 +587,9 @@ var requirejs, require, define;
|
|||
id: mod.map.id,
|
||||
uri: mod.map.url,
|
||||
config: function () {
|
||||
var c,
|
||||
pkg = getOwn(config.pkgs, mod.map.id);
|
||||
// For packages, only support config targeted
|
||||
// at the main module.
|
||||
c = pkg ? getOwn(config.config, mod.map.id + '/' + pkg.main) :
|
||||
getOwn(config.config, mod.map.id);
|
||||
return c || {};
|
||||
return getOwn(config.config, mod.map.id) || {};
|
||||
},
|
||||
exports: defined[mod.map.id]
|
||||
exports: mod.exports || (mod.exports = {})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -629,7 +630,7 @@ var requirejs, require, define;
|
|||
}
|
||||
|
||||
function checkLoaded() {
|
||||
var map, modId, err, usingPathFallback,
|
||||
var err, usingPathFallback,
|
||||
waitInterval = config.waitSeconds * 1000,
|
||||
//It is possible to disable the wait interval by using waitSeconds of 0.
|
||||
expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(),
|
||||
|
|
@ -647,8 +648,8 @@ var requirejs, require, define;
|
|||
|
||||
//Figure out the state of all the modules.
|
||||
eachProp(enabledRegistry, function (mod) {
|
||||
map = mod.map;
|
||||
modId = map.id;
|
||||
var map = mod.map,
|
||||
modId = map.id;
|
||||
|
||||
//Skip things that are not enabled or in error state.
|
||||
if (!mod.enabled) {
|
||||
|
|
@ -871,17 +872,14 @@ var requirejs, require, define;
|
|||
exports = context.execCb(id, factory, depExports, exports);
|
||||
}
|
||||
|
||||
if (this.map.isDefine) {
|
||||
//If setting exports via 'module' is in play,
|
||||
//favor that over return value and exports. After that,
|
||||
//favor a non-undefined return value over exports use.
|
||||
// Favor return value over exports. If node/cjs in play,
|
||||
// then will not have a return value anyway. Favor
|
||||
// module.exports assignment over exports object.
|
||||
if (this.map.isDefine && exports === undefined) {
|
||||
cjsModule = this.module;
|
||||
if (cjsModule &&
|
||||
cjsModule.exports !== undefined &&
|
||||
//Make sure it is not already the exports value
|
||||
cjsModule.exports !== this.exports) {
|
||||
if (cjsModule) {
|
||||
exports = cjsModule.exports;
|
||||
} else if (exports === undefined && this.usingExports) {
|
||||
} else if (this.usingExports) {
|
||||
//exports already set the defined value.
|
||||
exports = this.exports;
|
||||
}
|
||||
|
|
@ -941,6 +939,7 @@ var requirejs, require, define;
|
|||
|
||||
on(pluginMap, 'defined', bind(this, function (plugin) {
|
||||
var load, normalizedMap, normalizedMod,
|
||||
bundleId = getOwn(bundlesMap, this.map.id),
|
||||
name = this.map.name,
|
||||
parentName = this.map.parentMap ? this.map.parentMap.name : null,
|
||||
localRequire = context.makeRequire(map.parentMap, {
|
||||
|
|
@ -986,6 +985,14 @@ var requirejs, require, define;
|
|||
return;
|
||||
}
|
||||
|
||||
//If a paths config, then just load that file instead to
|
||||
//resolve the plugin, as it is built into that paths layer.
|
||||
if (bundleId) {
|
||||
this.map.url = context.nameToUrl(bundleId);
|
||||
this.load();
|
||||
return;
|
||||
}
|
||||
|
||||
load = bind(this, function (value) {
|
||||
this.init([], function () { return value; }, null, {
|
||||
enabled: true
|
||||
|
|
@ -1250,31 +1257,38 @@ var requirejs, require, define;
|
|||
}
|
||||
}
|
||||
|
||||
//Save off the paths and packages since they require special processing,
|
||||
//Save off the paths since they require special processing,
|
||||
//they are additive.
|
||||
var pkgs = config.pkgs,
|
||||
shim = config.shim,
|
||||
var shim = config.shim,
|
||||
objs = {
|
||||
paths: true,
|
||||
bundles: true,
|
||||
config: true,
|
||||
map: true
|
||||
};
|
||||
|
||||
eachProp(cfg, function (value, prop) {
|
||||
if (objs[prop]) {
|
||||
if (prop === 'map') {
|
||||
if (!config.map) {
|
||||
config.map = {};
|
||||
}
|
||||
mixin(config[prop], value, true, true);
|
||||
} else {
|
||||
mixin(config[prop], value, true);
|
||||
if (!config[prop]) {
|
||||
config[prop] = {};
|
||||
}
|
||||
mixin(config[prop], value, true, true);
|
||||
} else {
|
||||
config[prop] = value;
|
||||
}
|
||||
});
|
||||
|
||||
//Reverse map the bundles
|
||||
if (cfg.bundles) {
|
||||
eachProp(cfg.bundles, function (value, prop) {
|
||||
each(value, function (v) {
|
||||
if (v !== prop) {
|
||||
bundlesMap[v] = prop;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
//Merge shim
|
||||
if (cfg.shim) {
|
||||
eachProp(cfg.shim, function (value, id) {
|
||||
|
|
@ -1295,29 +1309,25 @@ var requirejs, require, define;
|
|||
//Adjust packages if necessary.
|
||||
if (cfg.packages) {
|
||||
each(cfg.packages, function (pkgObj) {
|
||||
var location;
|
||||
var location, name;
|
||||
|
||||
pkgObj = typeof pkgObj === 'string' ? { name: pkgObj } : pkgObj;
|
||||
|
||||
name = pkgObj.name;
|
||||
location = pkgObj.location;
|
||||
if (location) {
|
||||
config.paths[name] = pkgObj.location;
|
||||
}
|
||||
|
||||
//Create a brand new object on pkgs, since currentPackages can
|
||||
//be passed in again, and config.pkgs is the internal transformed
|
||||
//state for all package configs.
|
||||
pkgs[pkgObj.name] = {
|
||||
name: pkgObj.name,
|
||||
location: location || pkgObj.name,
|
||||
//Remove leading dot in main, so main paths are normalized,
|
||||
//and remove any trailing .js, since different package
|
||||
//envs have different conventions: some use a module name,
|
||||
//some use a file name.
|
||||
main: (pkgObj.main || 'main')
|
||||
.replace(currDirRegExp, '')
|
||||
.replace(jsSuffixRegExp, '')
|
||||
};
|
||||
//Save pointer to main module ID for pkg name.
|
||||
//Remove leading dot in main, so main paths are normalized,
|
||||
//and remove any trailing .js, since different package
|
||||
//envs have different conventions: some use a module name,
|
||||
//some use a file name.
|
||||
config.pkgs[name] = pkgObj.name + '/' + (pkgObj.main || 'main')
|
||||
.replace(currDirRegExp, '')
|
||||
.replace(jsSuffixRegExp, '');
|
||||
});
|
||||
|
||||
//Done with modifications, assing packages back to context config
|
||||
config.pkgs = pkgs;
|
||||
}
|
||||
|
||||
//If there are any "waiting to execute" modules in the registry,
|
||||
|
|
@ -1464,10 +1474,21 @@ var requirejs, require, define;
|
|||
var map = makeModuleMap(id, relMap, true),
|
||||
mod = getOwn(registry, id);
|
||||
|
||||
removeScript(id);
|
||||
|
||||
delete defined[id];
|
||||
delete urlFetched[map.url];
|
||||
delete undefEvents[id];
|
||||
|
||||
//Clean queued defines too. Go backwards
|
||||
//in array so that the splices do not
|
||||
//mess up the iteration.
|
||||
eachReverse(defQueue, function(args, i) {
|
||||
if(args[0] === id) {
|
||||
defQueue.splice(i, 1);
|
||||
}
|
||||
});
|
||||
|
||||
if (mod) {
|
||||
//Hold on to listeners in case the
|
||||
//module will be attempted to be reloaded
|
||||
|
|
@ -1487,7 +1508,7 @@ var requirejs, require, define;
|
|||
/**
|
||||
* Called to enable a module if it is still in the registry
|
||||
* awaiting enablement. A second arg, parent, the parent module,
|
||||
* is passed in for context, when this method is overriden by
|
||||
* is passed in for context, when this method is overridden by
|
||||
* the optimizer. Not shown here to keep code compact.
|
||||
*/
|
||||
enable: function (depMap) {
|
||||
|
|
@ -1561,8 +1582,19 @@ var requirejs, require, define;
|
|||
* internal API, not a public one. Use toUrl for the public API.
|
||||
*/
|
||||
nameToUrl: function (moduleName, ext, skipExt) {
|
||||
var paths, pkgs, pkg, pkgPath, syms, i, parentModule, url,
|
||||
parentPath;
|
||||
var paths, syms, i, parentModule, url,
|
||||
parentPath, bundleId,
|
||||
pkgMain = getOwn(config.pkgs, moduleName);
|
||||
|
||||
if (pkgMain) {
|
||||
moduleName = pkgMain;
|
||||
}
|
||||
|
||||
bundleId = getOwn(bundlesMap, moduleName);
|
||||
|
||||
if (bundleId) {
|
||||
return context.nameToUrl(bundleId, ext, skipExt);
|
||||
}
|
||||
|
||||
//If a colon is in the URL, it indicates a protocol is used and it is just
|
||||
//an URL to a file, or if it starts with a slash, contains a query arg (i.e. ?)
|
||||
|
|
@ -1576,7 +1608,6 @@ var requirejs, require, define;
|
|||
} else {
|
||||
//A module that needs to be converted to a path.
|
||||
paths = config.paths;
|
||||
pkgs = config.pkgs;
|
||||
|
||||
syms = moduleName.split('/');
|
||||
//For each module name segment, see if there is a path
|
||||
|
|
@ -1584,7 +1615,7 @@ var requirejs, require, define;
|
|||
//and work up from it.
|
||||
for (i = syms.length; i > 0; i -= 1) {
|
||||
parentModule = syms.slice(0, i).join('/');
|
||||
pkg = getOwn(pkgs, parentModule);
|
||||
|
||||
parentPath = getOwn(paths, parentModule);
|
||||
if (parentPath) {
|
||||
//If an array, it means there are a few choices,
|
||||
|
|
@ -1594,16 +1625,6 @@ var requirejs, require, define;
|
|||
}
|
||||
syms.splice(0, i, parentPath);
|
||||
break;
|
||||
} else if (pkg) {
|
||||
//If module name is just the package name, then looking
|
||||
//for the main module.
|
||||
if (moduleName === pkg.name) {
|
||||
pkgPath = pkg.location + '/' + pkg.main;
|
||||
} else {
|
||||
pkgPath = pkg.location;
|
||||
}
|
||||
syms.splice(0, i, pkgPath);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1918,7 +1939,7 @@ var requirejs, require, define;
|
|||
}
|
||||
|
||||
//Look for a data-main script attribute, which could also adjust the baseUrl.
|
||||
if (isBrowser) {
|
||||
if (isBrowser && !cfg.skipDataMain) {
|
||||
//Figure out baseUrl. Get it from the script tag with require.js in it.
|
||||
eachReverse(scripts(), function (script) {
|
||||
//Set the 'head' where we can append children by
|
||||
|
|
|
|||
|
|
@ -46,4 +46,10 @@ body {
|
|||
position: absolute;
|
||||
right: 0;
|
||||
border-left: 1px solid;
|
||||
}
|
||||
}
|
||||
|
||||
/* .ace_text-input {
|
||||
z-index: 10!important;
|
||||
opacity: 1!important;
|
||||
background: rgb(84, 0, 255)!important;
|
||||
}*/
|
||||
|
|
|
|||
|
|
@ -32,25 +32,26 @@ define(function(require, exports, module) {
|
|||
"use strict";
|
||||
|
||||
var dom = require("ace/lib/dom");
|
||||
var oop = require("ace/lib/oop");
|
||||
var event = require("ace/lib/event");
|
||||
var Range = require("ace/range").Range;
|
||||
var Tooltip = require("ace/tooltip").Tooltip;
|
||||
|
||||
var tooltipNode;
|
||||
|
||||
var TokenTooltip = function(editor) {
|
||||
function TokenTooltip (editor) {
|
||||
if (editor.tokenTooltip)
|
||||
return;
|
||||
editor.tokenTooltip = this;
|
||||
Tooltip.call(this, editor.container);
|
||||
editor.tokenTooltip = this;
|
||||
this.editor = editor;
|
||||
|
||||
editor.tooltip = tooltipNode || this.$init();
|
||||
|
||||
this.update = this.update.bind(this);
|
||||
this.onMouseMove = this.onMouseMove.bind(this);
|
||||
this.onMouseOut = this.onMouseOut.bind(this);
|
||||
event.addListener(editor.renderer.scroller, "mousemove", this.onMouseMove);
|
||||
event.addListener(editor.renderer.content, "mouseout", this.onMouseOut);
|
||||
};
|
||||
}
|
||||
|
||||
oop.inherits(TokenTooltip, Tooltip);
|
||||
|
||||
(function(){
|
||||
this.token = {};
|
||||
|
|
@ -86,15 +87,10 @@ var TokenTooltip = function(editor) {
|
|||
}
|
||||
if (!token) {
|
||||
session.removeMarker(this.marker);
|
||||
tooltipNode.style.display = "none";
|
||||
this.isOpen = false;
|
||||
this.hide();
|
||||
return;
|
||||
}
|
||||
if (!this.isOpen) {
|
||||
tooltipNode.style.display = "";
|
||||
this.isOpen = true;
|
||||
}
|
||||
|
||||
|
||||
var tokenText = token.type;
|
||||
if (token.state)
|
||||
tokenText += "|" + token.state;
|
||||
|
|
@ -102,15 +98,15 @@ var TokenTooltip = function(editor) {
|
|||
tokenText += "\n merge";
|
||||
if (token.stateTransitions)
|
||||
tokenText += "\n " + token.stateTransitions.join("\n ");
|
||||
|
||||
|
||||
if (this.tokenText != tokenText) {
|
||||
tooltipNode.textContent = tokenText;
|
||||
this.tooltipWidth = tooltipNode.offsetWidth;
|
||||
this.tooltipHeight = tooltipNode.offsetHeight;
|
||||
this.setText(tokenText);
|
||||
this.width = this.getWidth();
|
||||
this.height = this.getHeight();
|
||||
this.tokenText = tokenText;
|
||||
}
|
||||
|
||||
this.updateTooltipPosition(this.x, this.y);
|
||||
|
||||
this.show(null, this.x, this.y);
|
||||
|
||||
this.token = token;
|
||||
session.removeMarker(this.marker);
|
||||
|
|
@ -123,56 +119,34 @@ var TokenTooltip = function(editor) {
|
|||
this.y = e.clientY;
|
||||
if (this.isOpen) {
|
||||
this.lastT = e.timeStamp;
|
||||
this.updateTooltipPosition(this.x, this.y);
|
||||
this.setPosition(this.x, this.y);
|
||||
}
|
||||
if (!this.$timer)
|
||||
this.$timer = setTimeout(this.update, 100);
|
||||
};
|
||||
|
||||
|
||||
this.onMouseOut = function(e) {
|
||||
var t = e && e.relatedTarget;
|
||||
var ct = e && e.currentTarget;
|
||||
while(t && (t = t.parentNode)) {
|
||||
if (t == ct)
|
||||
return;
|
||||
}
|
||||
tooltipNode.style.display = "none";
|
||||
if (e && e.currentTarget.contains(e.relatedTarget))
|
||||
return;
|
||||
this.hide();
|
||||
this.editor.session.removeMarker(this.marker);
|
||||
this.$timer = clearTimeout(this.$timer);
|
||||
this.isOpen = false;
|
||||
};
|
||||
|
||||
this.updateTooltipPosition = function(x, y) {
|
||||
var st = tooltipNode.style;
|
||||
if (x + 10 + this.tooltipWidth > this.maxWidth)
|
||||
x = window.innerWidth - this.tooltipWidth - 10;
|
||||
if (y > window.innerHeight * 0.75 || y + 20 + this.tooltipHeight > this.maxHeight)
|
||||
y = y - this.tooltipHeight - 30;
|
||||
|
||||
st.left = x + 10 + "px";
|
||||
st.top = y + 20 + "px";
|
||||
};
|
||||
|
||||
this.$init = function() {
|
||||
tooltipNode = document.documentElement.appendChild(dom.createElement("div"));
|
||||
var st = tooltipNode.style;
|
||||
st.position = "fixed";
|
||||
st.display = "none";
|
||||
st.background = "lightyellow";
|
||||
st.borderRadius = "";
|
||||
st.border = "1px solid gray";
|
||||
st.padding = "1px";
|
||||
st.zIndex = 1000;
|
||||
st.fontFamily = "monospace";
|
||||
st.whiteSpace = "pre-line";
|
||||
return tooltipNode;
|
||||
this.setPosition = function(x, y) {
|
||||
if (x + 10 + this.width > this.maxWidth)
|
||||
x = window.innerWidth - this.width - 10;
|
||||
if (y > window.innerHeight * 0.75 || y + 20 + this.height > this.maxHeight)
|
||||
y = y - this.height - 30;
|
||||
|
||||
Tooltip.prototype.setPosition.call(this, x + 10, y + 20);
|
||||
};
|
||||
|
||||
this.destroy = function() {
|
||||
this.onMouseOut();
|
||||
event.removeListener(this.editor.renderer.scroller, "mousemove", this.onMouseMove);
|
||||
event.removeListener(this.editor.renderer.content, "mouseout", this.onMouseOut);
|
||||
delete this.editor.tokenTooltip;
|
||||
delete this.editor.tokenTooltip;
|
||||
};
|
||||
|
||||
}).call(TokenTooltip.prototype);
|
||||
|
|
@ -180,4 +154,3 @@ var TokenTooltip = function(editor) {
|
|||
exports.TokenTooltip = TokenTooltip;
|
||||
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ function optgroup(values) {
|
|||
return values.map(function(item) {
|
||||
if (typeof item == "string")
|
||||
item = {name: item, caption: item};
|
||||
return elt("option", {value: item.name}, item.caption || item.desc);
|
||||
return elt("option", {value: item.value || item.name}, item.caption || item.desc);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,24 +23,27 @@
|
|||
|
||||
<pre id="editor"></pre>
|
||||
|
||||
<script src="../build/src-noconflict/ace.js"></script>
|
||||
<script src="../build/src-noconflict/ext-modelist.js"></script>
|
||||
<script src="kitchen-sink/require.js"></script>
|
||||
<script>
|
||||
// setup paths
|
||||
require.config({paths: { "ace" : "../lib/ace"}});
|
||||
// load ace and extensions
|
||||
require(["ace/ace", "ace/ext/modelist"], function(ace) {
|
||||
var editor = ace.edit("editor");
|
||||
editor.setTheme("ace/theme/twilight");
|
||||
(function () {
|
||||
var modelist = ace.require('ace/ext/modelist');
|
||||
var modelist = ace.require("ace/ext/modelist");
|
||||
// the file path could come from an xmlhttp request, a drop event,
|
||||
// or any other scriptable file loading process.
|
||||
// Extensions could consume the modelist and use it to dynamically
|
||||
// set the editor mode. Webmasters could use it in their scripts
|
||||
// for site specific purposes as well.
|
||||
var filePath = 'blahblah/weee/some.js';
|
||||
var filePath = "blahblah/weee/some.js";
|
||||
var mode = modelist.getModeForPath(filePath).mode;
|
||||
console.log(mode);
|
||||
editor.session.setMode(mode);
|
||||
}());
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
<script src="./show_own_source.js"></script>
|
||||
|
|
|
|||
20
demo/r.js/build.js
Normal file
20
demo/r.js/build.js
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
({
|
||||
optimize: "none",
|
||||
preserveLicenseComments: false,
|
||||
name: "node_modules/almond/almond",
|
||||
baseUrl: "../../",
|
||||
paths: {
|
||||
ace : "lib/ace",
|
||||
demo: "demo/kitchen-sink"
|
||||
},
|
||||
packages: [
|
||||
],
|
||||
include: [
|
||||
"ace/ace"
|
||||
],
|
||||
exclude: [
|
||||
],
|
||||
out: "./packed.js",
|
||||
useStrict: true,
|
||||
wrap: false
|
||||
})
|
||||
36
demo/r.js/editor.html
Normal file
36
demo/r.js/editor.html
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Editor</title>
|
||||
<link rel="stylesheet" href="../kitchen-sink/styles.css" type="text/css" media="screen" charset="utf-8">
|
||||
</head>
|
||||
<body>
|
||||
<div id="optionsPanel" style="position:absolute;height:100%;width:260px">
|
||||
<a href="http://c9.io" title="Cloud9 IDE | Your code anywhere, anytime">
|
||||
<img id="c9-logo" src="../kitchen-sink/logo.png" style="width: 172px;margin: -9px 30px -12px 51px;">
|
||||
</a>
|
||||
</div>
|
||||
<pre id="editor-container">
|
||||
<div style="color:black; padding: 10px">
|
||||
demo showing Ace usage with r.js:
|
||||
|
||||
install r.js and almond
|
||||
and run `<code>r.js -o demo/r.js/build.js</code>`
|
||||
|
||||
note that you also need ace/build/src to lazy load modes and themes
|
||||
require("ace/config").set("basePath", "../../build/src");
|
||||
require("ace/config").set("packaged", true);
|
||||
<div>
|
||||
</pre>
|
||||
|
||||
<script src="./packed.js" data-ace-base="src" type="text/javascript" charset="utf-8"></script>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
require("ace/config").set("basePath", "../../build/src")
|
||||
require("ace/config").set("packaged", true)
|
||||
var editor = require("ace/ace").edit("editor-container");
|
||||
editor.session.setMode("ace/mode/javascript");
|
||||
// editor.session.setValue("var editor = Ace!")
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -29,14 +29,20 @@
|
|||
}</pre>
|
||||
|
||||
<script src="../demo/kitchen-sink/require.js"></script>
|
||||
<script src="../build/src/ace.js" charset="utf-8"></script>
|
||||
<script>
|
||||
var editor = ace.edit("editor");
|
||||
editor.setTheme("ace/theme/twilight");
|
||||
editor.session.setMode("ace/mode/javascript");
|
||||
require(["ace/requirejs/text!src/ace"], function(e){
|
||||
editor.setValue(e);
|
||||
})
|
||||
require.config({paths: {ace: "../build/src"}})
|
||||
define('testace', ['ace/ace'],
|
||||
function(ace, langtools) {
|
||||
console.log("This is the testace module");
|
||||
var editor = ace.edit("editor");
|
||||
editor.setTheme("ace/theme/twilight");
|
||||
editor.session.setMode("ace/mode/javascript");
|
||||
require(["ace/requirejs/text!src/ace"], function(e){
|
||||
editor.setValue(e);
|
||||
})
|
||||
}
|
||||
);
|
||||
require(['testace'])
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -5,19 +5,18 @@
|
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<title>Editor</title>
|
||||
<style type="text/css" media="screen">
|
||||
|
||||
.ace_editor {
|
||||
position: relative !important;
|
||||
border: 1px solid lightgray;
|
||||
margin: auto;
|
||||
height: 200px;
|
||||
width: 80%;
|
||||
}
|
||||
.ace_editor {
|
||||
position: relative !important;
|
||||
border: 1px solid lightgray;
|
||||
margin: auto;
|
||||
height: 200px;
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.ace_editor.fullScreen {
|
||||
height: auto;
|
||||
width: auto;
|
||||
border: 0;
|
||||
height: auto;
|
||||
width: auto;
|
||||
border: 0;
|
||||
margin: 0;
|
||||
position: fixed !important;
|
||||
top: 0;
|
||||
|
|
@ -25,17 +24,16 @@
|
|||
left: 0;
|
||||
right: 0;
|
||||
z-index: 10;
|
||||
background: white;
|
||||
}
|
||||
|
||||
.fullScreen {
|
||||
overflow: hidden
|
||||
}
|
||||
.fullScreen {
|
||||
overflow: hidden
|
||||
}
|
||||
|
||||
.scrollmargin {
|
||||
height: 500px;
|
||||
.scrollmargin {
|
||||
height: 500px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.large-button {
|
||||
color: lightblue;
|
||||
|
|
@ -56,7 +54,7 @@
|
|||
<body>
|
||||
<div class="scrollmargin">
|
||||
<span onclick="scroll()" class="large-button">
|
||||
scroll down ⇓
|
||||
scroll down ⇓
|
||||
</span>
|
||||
</div>
|
||||
<pre id="editor">function foo(items) {
|
||||
|
|
@ -76,28 +74,35 @@
|
|||
|
||||
</div>
|
||||
|
||||
<script src="../build/src/ace.js"></script>
|
||||
<script src="kitchen-sink/require.js"></script>
|
||||
<script>
|
||||
require.config({paths: { "ace" : "../lib/ace"}});
|
||||
require(["ace/ace", "ace/ext/themelist"], function(ace) {
|
||||
|
||||
var $ = document.getElementById.bind(document);
|
||||
var dom = require("ace/lib/dom");
|
||||
|
||||
//add command to all new editor instaces
|
||||
require("ace/commands/default_commands").commands.push({
|
||||
name: "Toggle Fullscreen",
|
||||
bindKey: "F11",
|
||||
exec: function(editor) {
|
||||
dom.toggleCssClass(document.body, "fullScreen")
|
||||
dom.toggleCssClass(editor.container, "fullScreen")
|
||||
editor.setAutoScrollEditorIntoView()
|
||||
editor.resize()
|
||||
}
|
||||
name: "Toggle Fullscreen",
|
||||
bindKey: "F11",
|
||||
exec: function(editor) {
|
||||
var fullScreen = dom.toggleCssClass(document.body, "fullScreen")
|
||||
dom.setCssClass(editor.container, "fullScreen", fullScreen)
|
||||
editor.setAutoScrollEditorIntoView(!fullScreen)
|
||||
editor.resize()
|
||||
}
|
||||
})
|
||||
|
||||
// create first editor
|
||||
var editor = ace.edit("editor");
|
||||
editor.setTheme("ace/theme/twilight");
|
||||
editor.session.setMode("ace/mode/javascript");
|
||||
editor.setAutoScrollEditorIntoView();
|
||||
editor.renderer.setScrollMargin(10, 10);
|
||||
editor.setOptions({
|
||||
// "scrollPastEnd": 0.8,
|
||||
autoScrollEditorIntoView: true
|
||||
});
|
||||
|
||||
var count = 1;
|
||||
function add() {
|
||||
|
|
@ -110,12 +115,13 @@ function add() {
|
|||
oldEl.parentNode.insertBefore(el, pad.nextSibling)
|
||||
|
||||
count++
|
||||
var theme = "ace/theme/" + themes[Math.floor(themes.length * Math.random() - 1e-5)]
|
||||
var theme = themes[Math.floor(themes.length * Math.random() - 1e-5)]
|
||||
editor = ace.edit(el)
|
||||
editor.setTheme(theme)
|
||||
editor.session.setMode("ace/mode/javascript")
|
||||
|
||||
editor.setAutoScrollEditorIntoView()
|
||||
editor.setOptions({
|
||||
mode: "ace/mode/javascript",
|
||||
theme: theme,
|
||||
autoScrollEditorIntoView: true
|
||||
})
|
||||
|
||||
editor.setValue([
|
||||
"this is editor number: ", count, "\n",
|
||||
|
|
@ -126,7 +132,6 @@ function add() {
|
|||
scroll()
|
||||
}
|
||||
|
||||
|
||||
function scroll(speed) {
|
||||
var top = editor.container.getBoundingClientRect().top
|
||||
speed = speed || 10
|
||||
|
|
@ -139,14 +144,11 @@ function scroll(speed) {
|
|||
}
|
||||
}
|
||||
|
||||
var themes = {
|
||||
bright: [ "chrome", "clouds", "crimson_editor", "dawn", "dreamweaver", "eclipse", "github",
|
||||
"solarized_light", "textmate", "tomorrow"],
|
||||
dark: [ "clouds_midnight", "cobalt", "idle_fingers", "kr_theme", "merbivore", "merbivore_soft",
|
||||
"mono_industrial", "monokai", "pastel_on_dark", "solarized_dark", "terminal", "tomorrow_night",
|
||||
"tomorrow_night_blue", "tomorrow_night_bright", "tomorrow_night_eighties", "twilight", "vibrant_ink"]
|
||||
}
|
||||
themes = [].concat(themes.bright, themes.dark);
|
||||
var themes = require("ace/ext/themelist").themes.map(function(t){return t.theme});
|
||||
|
||||
window.add = add;
|
||||
window.scroll = scroll;
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -23,9 +23,12 @@
|
|||
|
||||
<pre id="editor"></pre>
|
||||
|
||||
<script src="../build/src-noconflict/ace.js"></script>
|
||||
<script src="../build/src-noconflict/ext-settings_menu.js"></script>
|
||||
<script src="kitchen-sink/require.js"></script>
|
||||
<script>
|
||||
// setup paths
|
||||
require.config({paths: { "ace" : "../lib/ace"}});
|
||||
// load ace and extensions
|
||||
require(["ace/ace", "ace/ext/settings_menu"], function(ace) {
|
||||
var editor = ace.edit("editor");
|
||||
ace.require('ace/ext/settings_menu').init(editor);
|
||||
editor.setTheme("ace/theme/twilight");
|
||||
|
|
@ -38,6 +41,7 @@
|
|||
},
|
||||
readOnly: true
|
||||
}]);
|
||||
})
|
||||
</script>
|
||||
|
||||
<script src="./show_own_source.js"></script>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,16 @@
|
|||
ace.require("ace/lib/net").get(document.baseURI, function(t){
|
||||
editor.setValue(t, 1);
|
||||
})
|
||||
if (typeof ace == "undefined" && typeof require == "undefined") {
|
||||
document.body.innerHTML = "<p style='padding: 20px 50px;'>couldn't find ace.js file, <br>"
|
||||
+ "to build it run <code>node Makefile.dryice.js full<code>"
|
||||
} else if (typeof ace == "undefined" && typeof require != "undefined") {
|
||||
require(["ace/ace"], setValue)
|
||||
} else {
|
||||
require = ace.require;
|
||||
setValue()
|
||||
}
|
||||
|
||||
function setValue() {
|
||||
require("ace/lib/net").get(document.baseURI, function(t){
|
||||
var el = document.getElementById("editor");
|
||||
el.env.editor.setValue(t, 1);
|
||||
})
|
||||
}
|
||||
83
demo/static-highlighter.html
Normal file
83
demo/static-highlighter.html
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>Static Code highlighter using Ace</title>
|
||||
<meta name="author" content="Matthew Kastor">
|
||||
<style type="text/css">
|
||||
.code {
|
||||
width: 50%;
|
||||
white-space: pre-wrap;
|
||||
border: solid lightgrey 1px
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h2>Client Side Syntax Highlighting</h2>
|
||||
|
||||
<p>Syntax highlighting using Ace language modes and themes.</p>
|
||||
|
||||
<div class="code" ace-mode="ace/mode/css" ace-theme="ace/theme/chrome" ace-gutter="true">
|
||||
.code {
|
||||
width: 50%;
|
||||
white-space: pre-wrap;
|
||||
border: solid lightgrey 1px
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
<pre class="code" ace-mode="ace/mode/javascript" ace-theme="ace/theme/twilight">
|
||||
function wobble (flam) {
|
||||
return flam.wobbled = true;
|
||||
}
|
||||
|
||||
</pre>
|
||||
|
||||
|
||||
<div class="code" ace-mode="ace/mode/lua" ace-theme="ace/theme/chrome" ace-gutter="true" style="width: 30em;">
|
||||
--[[--
|
||||
num_args takes in 5.1 byte code and extracts the number of arguments from its function header.
|
||||
--]]--
|
||||
|
||||
function int(t)
|
||||
return t:byte(1) + t:byte(2) * 0x100 + t:byte(3) * 0x10000 + t:byte(4) * 0x1000000
|
||||
end
|
||||
|
||||
function num_args(func)
|
||||
local dump = string.dump(func)
|
||||
local offset, cursor = int(dump:sub(13)), offset + 26
|
||||
--Get the params and var flag (whether there's a ... in the param)
|
||||
return dump:sub(cursor):byte(), dump:sub(cursor+1):byte()
|
||||
end
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<script src="kitchen-sink/require.js"></script>
|
||||
<script>
|
||||
require.config({paths: { "ace" : "../lib/ace"}});
|
||||
|
||||
require(["ace/ace", "ace/ext/static_highlight"], function(ace) {
|
||||
var highlight = ace.require("ace/ext/static_highlight")
|
||||
var dom = ace.require("ace/lib/dom")
|
||||
function qsa(sel) {
|
||||
return Array.apply(null, document.querySelectorAll(sel));
|
||||
}
|
||||
|
||||
qsa(".code").forEach(function (codeEl) {
|
||||
highlight(codeEl, {
|
||||
mode: codeEl.getAttribute("ace-mode"),
|
||||
theme: codeEl.getAttribute("ace-theme"),
|
||||
startLineNumber: 1,
|
||||
showGutter: codeEl.getAttribute("ace-gutter"),
|
||||
trim: true
|
||||
}, function (highlighted) {
|
||||
|
||||
});
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||
"http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>Static Code highlighter using Ace</title>
|
||||
<meta name="author" content="Matthew Kastor">
|
||||
<style type="text/css">
|
||||
.code {
|
||||
width: 50%;
|
||||
position: relative;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h2>Client Side Syntax Highlighting</h2>
|
||||
|
||||
<p>Syntax highlighting using Ace language modes and themes.</p>
|
||||
|
||||
<div class="code" ace-mode="ace/mode/css" ace-theme="ace/theme/chrome" ace-gutter="true">
|
||||
.code {
|
||||
width: 50%;
|
||||
|
||||
position: relative;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
<pre class="code" ace-mode="ace/mode/javascript" ace-theme="ace/theme/twilight">
|
||||
function wobble (flam) {
|
||||
return flam.wobbled = true;
|
||||
}
|
||||
|
||||
// the scrollbars are from overflow auto on .ace_editor.
|
||||
|
||||
</pre>
|
||||
|
||||
<script src="../../build/src-noconflict/ace.js"></script>
|
||||
<script src="../../build/src-noconflict/ext-static_highlight.js"></script>
|
||||
|
||||
<script>
|
||||
var highlight = ace.require("ace/ext/static_highlight")
|
||||
var dom = ace.require("ace/lib/dom")
|
||||
function qsa(sel) {
|
||||
return [].slice.call(document.querySelectorAll(sel));
|
||||
}
|
||||
|
||||
qsa(".code").forEach(function (codeEl) {
|
||||
highlight(codeEl, {
|
||||
mode: codeEl.getAttribute('ace-mode'),
|
||||
theme: codeEl.getAttribute('ace-theme'),
|
||||
startLineNumber: 1,
|
||||
showGutter: codeEl.getAttribute("ace-gutter"),
|
||||
trim: true
|
||||
}, function (highlighted) {
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -2,15 +2,13 @@
|
|||
* Simple node.js server, which generates the synax highlighted version of itself
|
||||
* using the Ace modes and themes on the server and serving a static web page.
|
||||
*/
|
||||
// $'
|
||||
|
||||
// include ace search path and modules
|
||||
require("amd-loader");
|
||||
|
||||
// load jsdom, which is required by Ace
|
||||
require("../../lib/ace/test/mockdom");
|
||||
|
||||
var http = require("http");
|
||||
var fs = require("fs");
|
||||
var resolve = require("path").resolve;
|
||||
|
||||
// load the highlighter and the desired mode and theme
|
||||
var highlighter = require("../../lib/ace/ext/static_highlight");
|
||||
|
|
@ -20,15 +18,22 @@ var theme = require("../../lib/ace/theme/twilight");
|
|||
var port = process.env.PORT || 2222;
|
||||
|
||||
http.createServer(function(req, res) {
|
||||
var url = req.url;
|
||||
var path = /[^#?\x00]*/.exec(url)[0];
|
||||
var root = resolve(__dirname + "/../../").replace(/\\/g, "/");
|
||||
path = resolve(root + "/" + path).replace(/\\/g, "/");
|
||||
if (path.indexOf(root + "/") != 0)
|
||||
path = __filename;
|
||||
res.writeHead(200, {"Content-Type": "text/html; charset=utf-8"});
|
||||
fs.readFile(__filename, "utf8", function(err, data) {
|
||||
fs.readFile(path, "utf8", function(err, data) {
|
||||
if (err) data = err.message;
|
||||
var highlighted = highlighter.render(data, new JavaScriptMode(), theme);
|
||||
res.end(
|
||||
'<html><body>\n' +
|
||||
'<style type="text/css" media="screen">\n' +
|
||||
highlighted.css +
|
||||
'</style>\n' +
|
||||
highlighted.html +
|
||||
highlighted.html +
|
||||
'</body></html>'
|
||||
);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -41,15 +41,19 @@
|
|||
<pre id="editor"></pre>
|
||||
<div id="statusBar">ace rocks!</div>
|
||||
|
||||
<script src="../build/src-noconflict/ace.js"></script>
|
||||
<script src="../build/src-noconflict/ext-statusbar.js"></script>
|
||||
<script src="kitchen-sink/require.js"></script>
|
||||
<script>
|
||||
// setup paths
|
||||
require.config({paths: { "ace" : "../lib/ace"}});
|
||||
// load ace and extensions
|
||||
require(["ace/ace", "ace/ext/statusbar"], function(ace) {
|
||||
var editor = ace.edit("editor");
|
||||
var StatusBar = ace.require('ace/ext/statusbar').StatusBar;
|
||||
var StatusBar = ace.require("ace/ext/statusbar").StatusBar;
|
||||
// create a simple selection status indicator
|
||||
var statusBar = new StatusBar(editor, document.getElementById('statusBar'));
|
||||
var statusBar = new StatusBar(editor, document.getElementById("statusBar"));
|
||||
editor.setTheme("ace/theme/dawn");
|
||||
editor.session.setMode("ace/mode/html");
|
||||
});
|
||||
</script>
|
||||
|
||||
<script src="./show_own_source.js"></script>
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 2.6 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 2.8 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 3.1 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 17 KiB |
|
|
@ -1,52 +1,62 @@
|
|||
var editor;
|
||||
var embedded_editor;
|
||||
$(function() {
|
||||
ace.config.set("workerPath", "build/src-min");
|
||||
editor = ace.edit("ace_editor_demo");
|
||||
editor.container.style.opacity = "";
|
||||
embedded_editor = ace.edit("embedded_ace_code");
|
||||
embedded_editor.container.style.opacity = "";
|
||||
editor.session.setMode("ace/mode/javascript");
|
||||
embedded_editor.session.setMode("ace/mode/html");
|
||||
|
||||
editor.setOptions({
|
||||
maxLines: 30
|
||||
})
|
||||
|
||||
ace.config.loadModule("ace/ext/emmet", function() {
|
||||
ace.require("ace/lib/net").loadScript("http://nightwing.github.io/emmet-core/emmet.js", function() {
|
||||
embedded_editor.setOption("enableEmmet", true);
|
||||
editor.setOption("enableEmmet", true);
|
||||
});
|
||||
|
||||
embedded_editor.setOptions({
|
||||
enableSnippets: true,
|
||||
enableBasicAutocompletion: true
|
||||
});
|
||||
});
|
||||
|
||||
ace.config.loadModule("ace/ext/language_tools", function() {
|
||||
embedded_editor.setOptions({
|
||||
enableSnippets: true,
|
||||
enableBasicAutocompletion: true
|
||||
});
|
||||
if (typeof ace !== "undefined") {
|
||||
ace.config.set("workerPath", "build/src-min");
|
||||
editor = ace.edit("ace_editor_demo");
|
||||
editor.container.style.opacity = "";
|
||||
embedded_editor = ace.edit("embedded_ace_code");
|
||||
embedded_editor.container.style.opacity = "";
|
||||
embedded_editor.session.setMode("ace/mode/html");
|
||||
embedded_editor.setAutoScrollEditorIntoView(true);
|
||||
embedded_editor.setOption("maxLines", 40);
|
||||
|
||||
editor.setOptions({
|
||||
enableSnippets: true,
|
||||
enableBasicAutocompletion: true
|
||||
maxLines: 30,
|
||||
mode: "ace/mode/javascript",
|
||||
autoScrollEditorIntoView: true
|
||||
});
|
||||
|
||||
ace.config.loadModule("ace/ext/emmet", function() {
|
||||
ace.require("ace/lib/net").loadScript("http://cloud9ide.github.io/emmet-core/emmet.js", function() {
|
||||
embedded_editor.setOption("enableEmmet", true);
|
||||
editor.setOption("enableEmmet", true);
|
||||
});
|
||||
});
|
||||
|
||||
ace.config.loadModule("ace/ext/language_tools", function() {
|
||||
embedded_editor.setOptions({
|
||||
enableSnippets: true,
|
||||
enableBasicAutocompletion: true
|
||||
});
|
||||
editor.setOptions({
|
||||
enableSnippets: true,
|
||||
enableBasicAutocompletion: true
|
||||
});
|
||||
});
|
||||
} else {
|
||||
document.body.insertAdjacentHTML("afterbegin", '<div class="bs-docs-example">\
|
||||
<div class="alert alert-error">\
|
||||
<button type="button" class="close" data-dismiss="alert">\xd7</button>\
|
||||
<strong>Oh No!</strong> Couldn\'t load <code>build/src/ace.js</code>.<br>\
|
||||
You can build it by running <code>node Makefile.dryice.js</code><br>\
|
||||
Or download older version by running <code>git submodule update --init --recursive</code><br>\
|
||||
</div>\
|
||||
</div>');
|
||||
}
|
||||
$("ul.menu-list").mousedown(function(e) {
|
||||
if (e.button === 1) {
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
embedded_editor.setAutoScrollEditorIntoView(true);
|
||||
editor.setAutoScrollEditorIntoView(true);
|
||||
|
||||
$("ul.menu-list li").click(function(e) {
|
||||
if (e.target.tagName === "LI") {
|
||||
console.log($(this).find("a"));
|
||||
window.location = $(this).find("a").attr("href");
|
||||
}
|
||||
else if (e.target.tagName === "P" || e.target.tagName === "IMG") {
|
||||
var anchor = $(e.target).siblings();
|
||||
window.location = anchor.attr("href");
|
||||
if (e.target.tagName !== "A") {
|
||||
var href = $(this).find("a").attr("href");
|
||||
if (e.button == 1)
|
||||
window.open(href, "_blank");
|
||||
else
|
||||
window.location = href;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -137,22 +147,22 @@ $(function() {
|
|||
});
|
||||
});
|
||||
|
||||
$(window).on("hashchange", function(e) {
|
||||
_gaq.push(['_trackPageview',location.pathname + location.search + location.hash]);
|
||||
tabs.each(function() {
|
||||
$(window).on("hashchange", function(e) {
|
||||
_gaq.push(['_trackPageview',location.pathname + location.search + location.hash]);
|
||||
tabs.each(function() {
|
||||
var idx = $.bbq.getState("nav") || "about";
|
||||
var section = e.fragment.split("&")[1] || "";
|
||||
$(this).find(tab_a_selector + "[href='#" + idx + "']").triggerHandler('click');
|
||||
|
||||
|
||||
// handles dropping in from new link
|
||||
var api = $.bbq.getState("api");
|
||||
if (api) {
|
||||
$(tab_a_selector + "[href='./api/" + api + ".html']").triggerHandler('click');
|
||||
}
|
||||
});
|
||||
}).trigger("hashchange");
|
||||
});
|
||||
}).trigger("hashchange");
|
||||
|
||||
highlight();
|
||||
highlight();
|
||||
});
|
||||
|
||||
|
||||
|
|
@ -161,7 +171,11 @@ function highlight() {
|
|||
var highlighter = ace.require("ace/ext/static_highlight")
|
||||
var dom = ace.require("ace/lib/dom")
|
||||
function qsa(sel) {
|
||||
return [].slice.call(document.querySelectorAll(sel));
|
||||
var els = document.querySelectorAll(sel);
|
||||
var result = [];
|
||||
for (var i = 0, l = els.length; i < l; i++)
|
||||
result[i] = els[i];
|
||||
return result;
|
||||
}
|
||||
|
||||
qsa("code[class]").forEach(function(el) {
|
||||
|
|
|
|||
59
experiments/debug_mem_leak.html
Normal file
59
experiments/debug_mem_leak.html
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<script src="../demo/kitchen-sink/require.js"></script>
|
||||
<script type="text/javascript">
|
||||
require.config({
|
||||
paths: { ace: "../lib/ace" },
|
||||
waitSeconds: 0
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<p><button onclick="toggleEditor()">Toggle editor</button></p>
|
||||
|
||||
<div id="container"></div>
|
||||
<script>
|
||||
var editor;
|
||||
var counter = 0
|
||||
|
||||
function toggleEditor() {
|
||||
if (!editor) {
|
||||
var root = document.createElement("div");
|
||||
root.style.height = "100px";
|
||||
root.setAttribute("id", "editor");
|
||||
root.textContent = "function foo(items) {\nvar x = 'All this is syntax highlighted';\nreturn x;\n}";
|
||||
|
||||
document.getElementById("container").appendChild(root);
|
||||
|
||||
editor = ace.edit(root);
|
||||
|
||||
if (counter++ % 2)
|
||||
editor.setTheme("ace/theme/monokai");
|
||||
else
|
||||
editor.setTheme("ace/theme/clouds");
|
||||
|
||||
editor.session.setMode("ace/mode/javascript");
|
||||
} else {
|
||||
editor.destroy();
|
||||
var el = editor.container;
|
||||
el.parentNode.removeChild(el);
|
||||
|
||||
editor.container = null
|
||||
editor.renderer = null
|
||||
|
||||
editor = null;
|
||||
|
||||
var root = document.getElementById("editor")
|
||||
if (root)
|
||||
root.parentNode.removeChild(root);
|
||||
}
|
||||
}
|
||||
require(["ace/ace"], function(ace) {
|
||||
window.ace = ace;
|
||||
toggleEditor();
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
384
index.html
384
index.html
File diff suppressed because one or more lines are too long
|
|
@ -11,16 +11,10 @@
|
|||
commit %commit%
|
||||
-->
|
||||
|
||||
<!--DEVEL-->
|
||||
<link rel="stylesheet" href="demo/kitchen-sink/styles.css" type="text/css" media="screen" charset="utf-8">
|
||||
<script async="true" src="http://use.edgefonts.net/source-code-pro.js"></script>
|
||||
<!--DEVEL-->
|
||||
<link rel="stylesheet" href="demo/kitchen-sink/styles.css" type="text/css" media="screen" charset="utf-8">
|
||||
<script async="true" src="https://use.edgefonts.net/source-code-pro.js"></script>
|
||||
|
||||
<link href="./doc/site/images/favicon.ico" rel="icon" type="image/x-icon">
|
||||
<!--PACKAGE
|
||||
<link rel="stylesheet" href="kitchen-sink/styles.css" type="text/css" media="screen" charset="utf-8">
|
||||
<script async="true" src="http://use.edgefonts.net/source-code-pro.js"></script>
|
||||
PACKAGE-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="optionsPanel" style="position:absolute;height:100%;width:260px">
|
||||
|
|
@ -63,40 +57,7 @@
|
|||
<label for="theme">Theme</label>
|
||||
</td><td>
|
||||
<select id="theme" size="1">
|
||||
<optgroup label="Bright">
|
||||
<option value="ace/theme/chrome">Chrome</option>
|
||||
<option value="ace/theme/clouds">Clouds</option>
|
||||
<option value="ace/theme/crimson_editor">Crimson Editor</option>
|
||||
<option value="ace/theme/dawn">Dawn</option>
|
||||
<option value="ace/theme/dreamweaver">Dreamweaver</option>
|
||||
<option value="ace/theme/eclipse">Eclipse</option>
|
||||
<option value="ace/theme/github">GitHub</option>
|
||||
<option value="ace/theme/solarized_light">Solarized Light</option>
|
||||
<option value="ace/theme/textmate" selected="selected">TextMate</option>
|
||||
<option value="ace/theme/tomorrow">Tomorrow</option>
|
||||
<option value="ace/theme/xcode">XCode</option>
|
||||
</optgroup>
|
||||
<optgroup label="Dark">
|
||||
<option value="ace/theme/ambiance">Ambiance</option>
|
||||
<option value="ace/theme/chaos">Chaos</option>
|
||||
<option value="ace/theme/clouds_midnight">Clouds Midnight</option>
|
||||
<option value="ace/theme/cobalt">Cobalt</option>
|
||||
<option value="ace/theme/idle_fingers">idleFingers</option>
|
||||
<option value="ace/theme/kr_theme">krTheme</option>
|
||||
<option value="ace/theme/merbivore">Merbivore</option>
|
||||
<option value="ace/theme/merbivore_soft">Merbivore Soft</option>
|
||||
<option value="ace/theme/mono_industrial">Mono Industrial</option>
|
||||
<option value="ace/theme/monokai">Monokai</option>
|
||||
<option value="ace/theme/pastel_on_dark">Pastel on dark</option>
|
||||
<option value="ace/theme/solarized_dark">Solarized Dark</option>
|
||||
<option value="ace/theme/terminal">Terminal</option>
|
||||
<option value="ace/theme/tomorrow_night">Tomorrow Night</option>
|
||||
<option value="ace/theme/tomorrow_night_blue">Tomorrow Night Blue</option>
|
||||
<option value="ace/theme/tomorrow_night_bright">Tomorrow Night Bright</option>
|
||||
<option value="ace/theme/tomorrow_night_eighties">Tomorrow Night 80s</option>
|
||||
<option value="ace/theme/twilight">Twilight</option>
|
||||
<option value="ace/theme/vibrant_ink">Vibrant Ink</option>
|
||||
</optgroup>
|
||||
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
@ -296,7 +257,9 @@
|
|||
<a href="http://ace.c9.io">
|
||||
<img id="ace-logo" src="doc/site/images/ace-logo.png" style="width: 134px;margin: 46px 0px 4px 66px;">
|
||||
</a>
|
||||
|
||||
<div><a target="_test" href="./lib/ace/test/tests.html"
|
||||
style="color: whitesmoke; text-align: left; padding: 1em;">tests</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -320,7 +283,7 @@
|
|||
<script src="src/ace.js" data-ace-base="src" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="src/keybinding-vim.js"></script>
|
||||
<script src="src/keybinding-emacs.js"></script>
|
||||
<script src="kitchen-sink/demo.js"></script>
|
||||
<script src="demo/kitchen-sink/demo.js"></script>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
require("kitchen-sink/demo");
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -46,14 +46,15 @@ var Editor = require("./editor").Editor;
|
|||
var EditSession = require("./edit_session").EditSession;
|
||||
var UndoManager = require("./undomanager").UndoManager;
|
||||
var Renderer = require("./virtual_renderer").VirtualRenderer;
|
||||
var MultiSelect = require("./multi_select").MultiSelect;
|
||||
|
||||
// The following require()s are for inclusion in the built ace file
|
||||
require("./worker/worker_client");
|
||||
require("./keyboard/hash_handler");
|
||||
require("./placeholder");
|
||||
require("./multi_select");
|
||||
require("./mode/folding/fold_mode");
|
||||
require("./theme/textmate");
|
||||
require("./ext/error_marker");
|
||||
|
||||
exports.config = require("./config");
|
||||
|
||||
|
|
@ -73,19 +74,28 @@ exports.require = require;
|
|||
exports.edit = function(el) {
|
||||
if (typeof(el) == "string") {
|
||||
var _id = el;
|
||||
var el = document.getElementById(_id);
|
||||
el = document.getElementById(_id);
|
||||
if (!el)
|
||||
throw new Error("ace.edit can't find div #" + _id);
|
||||
}
|
||||
|
||||
if (el.env && el.env.editor instanceof Editor)
|
||||
if (el && el.env && el.env.editor instanceof Editor)
|
||||
return el.env.editor;
|
||||
|
||||
var doc = exports.createEditSession(dom.getInnerText(el));
|
||||
el.innerHTML = '';
|
||||
var value = "";
|
||||
if (el && /input|textarea/i.test(el.tagName)) {
|
||||
var oldNode = el;
|
||||
value = oldNode.value;
|
||||
el = dom.createElement("pre");
|
||||
oldNode.parentNode.replaceChild(el, oldNode);
|
||||
} else {
|
||||
value = dom.getInnerText(el);
|
||||
el.innerHTML = '';
|
||||
}
|
||||
|
||||
var doc = exports.createEditSession(value);
|
||||
|
||||
var editor = new Editor(new Renderer(el));
|
||||
new MultiSelect(editor);
|
||||
editor.setSession(doc);
|
||||
|
||||
var env = {
|
||||
|
|
@ -93,11 +103,13 @@ exports.edit = function(el) {
|
|||
editor: editor,
|
||||
onResize: editor.resize.bind(editor, null)
|
||||
};
|
||||
if (oldNode) env.textarea = oldNode;
|
||||
event.addListener(window, "resize", env.onResize);
|
||||
editor.on("destroy", function() {
|
||||
event.removeListener(window, "resize", env.onResize);
|
||||
env.editor.container.env = null; // prevent memory leak on old ie
|
||||
});
|
||||
el.env = editor.env = env;
|
||||
editor.container.env = editor.env = env;
|
||||
return editor;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ var EventEmitter = require("./lib/event_emitter").EventEmitter;
|
|||
|
||||
/**
|
||||
*
|
||||
* Defines the floating pointer in the document. Whenever text is inserted or deleted before the cursor, the position of the cursor is updated.
|
||||
* Defines a floating pointer in the document. Whenever text is inserted or deleted before the cursor, the position of the anchor is updated.
|
||||
*
|
||||
* @class Anchor
|
||||
**/
|
||||
|
|
@ -99,69 +99,54 @@ var Anchor = exports.Anchor = function(doc, row, column) {
|
|||
* - `value`: An object describing the new Anchor position
|
||||
*
|
||||
**/
|
||||
this.onChange = function(e) {
|
||||
var delta = e.data;
|
||||
var range = delta.range;
|
||||
|
||||
if (range.start.row == range.end.row && range.start.row != this.row)
|
||||
this.onChange = function(delta) {
|
||||
if (delta.start.row == delta.end.row && delta.start.row != this.row)
|
||||
return;
|
||||
|
||||
if (range.start.row > this.row)
|
||||
if (delta.start.row > this.row)
|
||||
return;
|
||||
|
||||
if (range.start.row == this.row && range.start.column > this.column)
|
||||
return;
|
||||
|
||||
var row = this.row;
|
||||
var column = this.column;
|
||||
var start = range.start;
|
||||
var end = range.end;
|
||||
|
||||
if (delta.action === "insertText") {
|
||||
if (start.row === row && start.column <= column) {
|
||||
if (start.column === column && this.$insertRight) {
|
||||
// do nothing
|
||||
} else if (start.row === end.row) {
|
||||
column += end.column - start.column;
|
||||
} else {
|
||||
column -= start.column;
|
||||
row += end.row - start.row;
|
||||
}
|
||||
} else if (start.row !== end.row && start.row < row) {
|
||||
row += end.row - start.row;
|
||||
}
|
||||
} else if (delta.action === "insertLines") {
|
||||
if (start.row <= row) {
|
||||
row += end.row - start.row;
|
||||
}
|
||||
} else if (delta.action === "removeText") {
|
||||
if (start.row === row && start.column < column) {
|
||||
if (end.column >= column)
|
||||
column = start.column;
|
||||
else
|
||||
column = Math.max(0, column - (end.column - start.column));
|
||||
|
||||
} else if (start.row !== end.row && start.row < row) {
|
||||
if (end.row === row)
|
||||
column = Math.max(0, column - end.column) + start.column;
|
||||
row -= (end.row - start.row);
|
||||
} else if (end.row === row) {
|
||||
row -= end.row - start.row;
|
||||
column = Math.max(0, column - end.column) + start.column;
|
||||
}
|
||||
} else if (delta.action == "removeLines") {
|
||||
if (start.row <= row) {
|
||||
if (end.row <= row)
|
||||
row -= end.row - start.row;
|
||||
else {
|
||||
row = start.row;
|
||||
column = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.setPosition(row, column, true);
|
||||
|
||||
var point = $getTransformedPoint(delta, {row: this.row, column: this.column}, this.$insertRight);
|
||||
this.setPosition(point.row, point.column, true);
|
||||
};
|
||||
|
||||
function $pointsInOrder(point1, point2, equalPointsInOrder) {
|
||||
var bColIsAfter = equalPointsInOrder ? point1.column <= point2.column : point1.column < point2.column;
|
||||
return (point1.row < point2.row) || (point1.row == point2.row && bColIsAfter);
|
||||
}
|
||||
|
||||
function $getTransformedPoint(delta, point, moveIfEqual) {
|
||||
// Get delta info.
|
||||
var deltaIsInsert = delta.action == "insert";
|
||||
var deltaRowShift = (deltaIsInsert ? 1 : -1) * (delta.end.row - delta.start.row);
|
||||
var deltaColShift = (deltaIsInsert ? 1 : -1) * (delta.end.column - delta.start.column);
|
||||
var deltaStart = delta.start;
|
||||
var deltaEnd = deltaIsInsert ? deltaStart : delta.end; // Collapse insert range.
|
||||
|
||||
// DELTA AFTER POINT: No change needed.
|
||||
if ($pointsInOrder(point, deltaStart, moveIfEqual)) {
|
||||
return {
|
||||
row: point.row,
|
||||
column: point.column
|
||||
};
|
||||
}
|
||||
|
||||
// DELTA BEFORE POINT: Move point by delta shift.
|
||||
if ($pointsInOrder(deltaEnd, point, !moveIfEqual)) {
|
||||
return {
|
||||
row: point.row + deltaRowShift,
|
||||
column: point.column + (point.row == deltaEnd.row ? deltaColShift : 0)
|
||||
};
|
||||
}
|
||||
|
||||
// DELTA ENVELOPS POINT (delete only): Move point to delta start.
|
||||
// TODO warn if delta.action != "remove" ?
|
||||
|
||||
return {
|
||||
row: deltaStart.row,
|
||||
column: deltaStart.column
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the anchor position to the specified row and column. If `noClip` is `true`, the position is not clipped.
|
||||
|
|
@ -191,14 +176,14 @@ var Anchor = exports.Anchor = function(doc, row, column) {
|
|||
|
||||
this.row = pos.row;
|
||||
this.column = pos.column;
|
||||
this._emit("change", {
|
||||
this._signal("change", {
|
||||
old: old,
|
||||
value: pos
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* When called, the `'change'` event listener is removed.
|
||||
* When called, the `"change"` event listener is removed.
|
||||
*
|
||||
**/
|
||||
this.detach = function() {
|
||||
|
|
|
|||
|
|
@ -57,20 +57,55 @@ module.exports = {
|
|||
doc.insert({row: 1, column: 1}, "123");
|
||||
assert.position(anchor.getPosition(), 1, 7);
|
||||
},
|
||||
|
||||
"test insert text at anchor should not move anchor when insertRight is true": function() {
|
||||
var doc = new Document("juhu\nkinners");
|
||||
var anchor = new Anchor(doc, 1, 4);
|
||||
anchor.$insertRight = true;
|
||||
|
||||
doc.insert({row: 1, column: 4}, "123");
|
||||
assert.position(anchor.getPosition(), 1, 4);
|
||||
},
|
||||
|
||||
"test insert lines before cursor should move anchor row": function() {
|
||||
var doc = new Document("juhu\nkinners");
|
||||
var anchor = new Anchor(doc, 1, 4);
|
||||
|
||||
doc.insertLines(1, ["123", "456"]);
|
||||
doc.insertFullLines(1, ["123", "456"]);
|
||||
assert.position(anchor.getPosition(), 3, 4);
|
||||
},
|
||||
|
||||
"test insert lines at anchor position should move anchor down": function() {
|
||||
var doc = new Document("juhu\nkinners");
|
||||
var anchor = new Anchor(doc, 1, 0);
|
||||
|
||||
doc.insertLines(1, ["line"]);
|
||||
assert.position(anchor.getPosition(), 2, 0);
|
||||
},
|
||||
|
||||
"test insert lines at anchor position should not move anchor down when insertRight is true and column is 0": function() {
|
||||
var doc = new Document("juhu\nkinners");
|
||||
var anchor = new Anchor(doc, 1, 0);
|
||||
anchor.$insertRight = true;
|
||||
|
||||
doc.insertLines(1, ["line"]);
|
||||
assert.position(anchor.getPosition(), 1, 0);
|
||||
},
|
||||
|
||||
"test insert lines at anchor row should move anchor down when column > 0": function() {
|
||||
var doc = new Document("juhu\nkinners");
|
||||
var anchor = new Anchor(doc, 1, 2);
|
||||
anchor.$insertRight = true;
|
||||
|
||||
doc.insertLines(1, ["line"]);
|
||||
assert.position(anchor.getPosition(), 2, 2);
|
||||
},
|
||||
|
||||
"test insert new line before cursor should move anchor column": function() {
|
||||
var doc = new Document("juhu\nkinners");
|
||||
var anchor = new Anchor(doc, 1, 4);
|
||||
|
||||
doc.insertNewLine({row: 0, column: 0});
|
||||
doc.insertMergedLines({row: 0, column: 0}, ['', '']);
|
||||
assert.position(anchor.getPosition(), 2, 4);
|
||||
},
|
||||
|
||||
|
|
@ -78,7 +113,7 @@ module.exports = {
|
|||
var doc = new Document("juhu\nkinners");
|
||||
var anchor = new Anchor(doc, 1, 4);
|
||||
|
||||
doc.insertNewLine({row: 1, column: 2});
|
||||
doc.insertMergedLines({row: 1, column: 2}, ['', '']);
|
||||
assert.position(anchor.getPosition(), 2, 2);
|
||||
},
|
||||
|
||||
|
|
@ -110,7 +145,7 @@ module.exports = {
|
|||
var doc = new Document("juhu\n1\n2\nkinners");
|
||||
var anchor = new Anchor(doc, 3, 4);
|
||||
|
||||
doc.removeLines(1, 2);
|
||||
doc.removeFullLines(1, 2);
|
||||
assert.position(anchor.getPosition(), 1, 4);
|
||||
},
|
||||
|
||||
|
|
@ -134,7 +169,7 @@ module.exports = {
|
|||
var doc = new Document("juhu\nkinners\n123");
|
||||
var anchor = new Anchor(doc, 1, 5);
|
||||
|
||||
doc.removeLines(1, 1);
|
||||
doc.removeFullLines(1, 1);
|
||||
assert.position(anchor.getPosition(), 1, 0);
|
||||
},
|
||||
|
||||
|
|
@ -173,9 +208,9 @@ module.exports = {
|
|||
var doc = new Document("juhu\nkinners\n123");
|
||||
var anchor = new Anchor(doc, 2, 4);
|
||||
|
||||
doc.removeLines(0, 3);
|
||||
doc.removeFullLines(0, 3);
|
||||
assert.position(anchor.getPosition(), 0, 0);
|
||||
doc.insertLines(0, ["a", "b", "c"]);
|
||||
doc.insertFullLines(0, ["a", "b", "c"]);
|
||||
assert.position(anchor.getPosition(), 3, 0);
|
||||
assert.equal(doc.getValue(), "a\nb\nc\n");
|
||||
}
|
||||
|
|
|
|||
108
lib/ace/apply_delta.js
Normal file
108
lib/ace/apply_delta.js
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
/* ***** 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";
|
||||
|
||||
function throwDeltaError(delta, errorText){
|
||||
console.log("Invalid Delta:", delta);
|
||||
throw "Invalid Delta: " + errorText;
|
||||
}
|
||||
|
||||
function positionInDocument(docLines, position) {
|
||||
return position.row >= 0 && position.row < docLines.length &&
|
||||
position.column >= 0 && position.column <= docLines[position.row].length;
|
||||
}
|
||||
|
||||
function validateDelta(docLines, delta) {
|
||||
// Validate action string.
|
||||
if (delta.action != "insert" && delta.action != "remove")
|
||||
throwDeltaError(delta, "delta.action must be 'insert' or 'remove'");
|
||||
|
||||
// Validate lines type.
|
||||
if (!(delta.lines instanceof Array))
|
||||
throwDeltaError(delta, "delta.lines must be an Array");
|
||||
|
||||
// Validate range type.
|
||||
if (!delta.start || !delta.end)
|
||||
throwDeltaError(delta, "delta.start/end must be an present");
|
||||
|
||||
// Validate that the start point is contained in the document.
|
||||
var start = delta.start;
|
||||
if (!positionInDocument(docLines, delta.start))
|
||||
throwDeltaError(delta, "delta.start must be contained in document");
|
||||
|
||||
// Validate that the end point is contained in the document (remove deltas only).
|
||||
var end = delta.end;
|
||||
if (delta.action == "remove" && !positionInDocument(docLines, end))
|
||||
throwDeltaError(delta, "delta.end must contained in document for 'remove' actions");
|
||||
|
||||
// Validate that the .range size matches the .lines size.
|
||||
var numRangeRows = end.row - start.row;
|
||||
var numRangeLastLineChars = (end.column - (numRangeRows == 0 ? start.column : 0));
|
||||
if (numRangeRows != delta.lines.length - 1 || delta.lines[numRangeRows].length != numRangeLastLineChars)
|
||||
throwDeltaError(delta, "delta.range must match delta lines");
|
||||
}
|
||||
|
||||
exports.applyDelta = function(docLines, delta, doNotValidate) {
|
||||
// disabled validation since it breaks autocompletion popup
|
||||
// if (!doNotValidate)
|
||||
// validateDelta(docLines, delta);
|
||||
|
||||
var row = delta.start.row;
|
||||
var startColumn = delta.start.column;
|
||||
var line = docLines[row] || "";
|
||||
switch (delta.action) {
|
||||
case "insert":
|
||||
var lines = delta.lines;
|
||||
if (lines.length === 1) {
|
||||
docLines[row] = line.substring(0, startColumn) + delta.lines[0] + line.substring(startColumn);
|
||||
} else {
|
||||
var args = [row, 1].concat(delta.lines);
|
||||
docLines.splice.apply(docLines, args);
|
||||
docLines[row] = line.substring(0, startColumn) + docLines[row];
|
||||
docLines[row + delta.lines.length - 1] += line.substring(startColumn);
|
||||
}
|
||||
break;
|
||||
case "remove":
|
||||
var endColumn = delta.end.column;
|
||||
var endRow = delta.end.row;
|
||||
if (row === endRow) {
|
||||
docLines[row] = line.substring(0, startColumn) + line.substring(endColumn);
|
||||
} else {
|
||||
docLines.splice(
|
||||
row, endRow - row + 1,
|
||||
line.substring(0, startColumn) + docLines[endRow].substring(endColumn)
|
||||
);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -36,9 +36,14 @@ var AcePopup = require("./autocomplete/popup").AcePopup;
|
|||
var util = require("./autocomplete/util");
|
||||
var event = require("./lib/event");
|
||||
var lang = require("./lib/lang");
|
||||
var dom = require("./lib/dom");
|
||||
var snippetManager = require("./snippets").snippetManager;
|
||||
|
||||
var Autocomplete = function() {
|
||||
this.autoInsert = false;
|
||||
this.autoSelect = true;
|
||||
this.exactMatch = false;
|
||||
this.gatherCompletionsId = 0;
|
||||
this.keyboardHandler = new HashHandler();
|
||||
this.keyboardHandler.bindKeys(this.commands);
|
||||
|
||||
|
|
@ -46,19 +51,31 @@ var Autocomplete = function() {
|
|||
this.changeListener = this.changeListener.bind(this);
|
||||
this.mousedownListener = this.mousedownListener.bind(this);
|
||||
this.mousewheelListener = this.mousewheelListener.bind(this);
|
||||
|
||||
|
||||
this.changeTimer = lang.delayedCall(function() {
|
||||
this.updateCompletions(true);
|
||||
}.bind(this))
|
||||
}.bind(this));
|
||||
|
||||
this.tooltipTimer = lang.delayedCall(this.updateDocTooltip.bind(this), 50);
|
||||
};
|
||||
|
||||
(function() {
|
||||
|
||||
this.$init = function() {
|
||||
this.popup = new AcePopup(document.body || document.documentElement);
|
||||
this.popup.on("click", function(e) {
|
||||
this.insertMatch();
|
||||
e.stop();
|
||||
}.bind(this));
|
||||
this.popup.focus = this.editor.focus.bind(this.editor);
|
||||
this.popup.on("show", this.tooltipTimer.bind(null, null));
|
||||
this.popup.on("select", this.tooltipTimer.bind(null, null));
|
||||
this.popup.on("changeHoverMarker", this.tooltipTimer.bind(null, null));
|
||||
return this.popup;
|
||||
};
|
||||
|
||||
this.getPopup = function() {
|
||||
return this.popup || this.$init();
|
||||
};
|
||||
|
||||
this.openPopup = function(editor, prefix, keepPopupPosition) {
|
||||
|
|
@ -67,35 +84,45 @@ var Autocomplete = function() {
|
|||
|
||||
this.popup.setData(this.completions.filtered);
|
||||
|
||||
editor.keyBinding.addKeyboardHandler(this.keyboardHandler);
|
||||
|
||||
var renderer = editor.renderer;
|
||||
this.popup.setRow(this.autoSelect ? 0 : -1);
|
||||
if (!keepPopupPosition) {
|
||||
this.popup.setTheme(editor.getTheme());
|
||||
this.popup.setFontSize(editor.getFontSize());
|
||||
|
||||
var lineHeight = renderer.layerConfig.lineHeight;
|
||||
|
||||
var pos = renderer.$cursorLayer.getPixelPosition(this.base, true);
|
||||
|
||||
var pos = renderer.$cursorLayer.getPixelPosition(this.base, true);
|
||||
pos.left -= this.popup.getTextLeftOffset();
|
||||
|
||||
|
||||
var rect = editor.container.getBoundingClientRect();
|
||||
pos.top += rect.top - renderer.layerConfig.offset;
|
||||
pos.left += rect.left;
|
||||
pos.left += renderer.$gutterLayer.gutterWidth;
|
||||
pos.left += rect.left - editor.renderer.scrollLeft;
|
||||
pos.left += renderer.gutterWidth;
|
||||
|
||||
this.popup.show(pos, lineHeight);
|
||||
} else if (keepPopupPosition && !prefix) {
|
||||
this.detach();
|
||||
}
|
||||
};
|
||||
|
||||
this.detach = function() {
|
||||
this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler);
|
||||
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("mousewheel", this.mousewheelListener);
|
||||
this.changeTimer.cancel();
|
||||
|
||||
if (this.popup)
|
||||
this.hideDocTooltip();
|
||||
|
||||
this.gatherCompletionsId += 1;
|
||||
if (this.popup && this.popup.isOpen)
|
||||
this.popup.hide();
|
||||
|
||||
if (this.base)
|
||||
this.base.detach();
|
||||
this.activated = false;
|
||||
this.completions = this.base = null;
|
||||
};
|
||||
|
|
@ -111,9 +138,18 @@ var Autocomplete = function() {
|
|||
this.detach();
|
||||
};
|
||||
|
||||
this.blurListener = function() {
|
||||
if (document.activeElement != this.editor.textInput.getElement())
|
||||
this.blurListener = function(e) {
|
||||
// we have to check if activeElement is a child of popup because
|
||||
// on IE preventDefault doesn't stop scrollbar from being focussed
|
||||
var el = document.activeElement;
|
||||
var text = this.editor.textInput.getElement();
|
||||
var fromTooltip = e.relatedTarget && e.relatedTarget == this.tooltipNode;
|
||||
var container = this.popup && this.popup.container;
|
||||
if (el != text && el.parentNode != container && !fromTooltip
|
||||
&& el != this.tooltipNode && e.relatedTarget != text
|
||||
) {
|
||||
this.detach();
|
||||
}
|
||||
};
|
||||
|
||||
this.mousedownListener = function(e) {
|
||||
|
|
@ -129,7 +165,7 @@ var Autocomplete = function() {
|
|||
var max = this.popup.session.getLength() - 1;
|
||||
|
||||
switch(where) {
|
||||
case "up": row = row < 0 ? max : row - 1; break;
|
||||
case "up": row = row <= 0 ? max : row - 1; break;
|
||||
case "down": row = row >= max ? -1 : row + 1; break;
|
||||
case "start": row = 0; break;
|
||||
case "end": row = max; break;
|
||||
|
|
@ -143,8 +179,9 @@ var Autocomplete = function() {
|
|||
data = this.popup.getData(this.popup.getRow());
|
||||
if (!data)
|
||||
return false;
|
||||
|
||||
if (data.completer && data.completer.insertMatch) {
|
||||
data.completer.insertMatch(this.editor);
|
||||
data.completer.insertMatch(this.editor, data);
|
||||
} else {
|
||||
if (this.completions.filterText) {
|
||||
var ranges = this.editor.selection.getAllRanges();
|
||||
|
|
@ -161,6 +198,7 @@ var Autocomplete = function() {
|
|||
this.detach();
|
||||
};
|
||||
|
||||
|
||||
this.commands = {
|
||||
"Up": function(editor) { editor.completer.goTo("up"); },
|
||||
"Down": function(editor) { editor.completer.goTo("down"); },
|
||||
|
|
@ -168,10 +206,15 @@ var Autocomplete = function() {
|
|||
"Ctrl-Down|Ctrl-End": function(editor) { editor.completer.goTo("end"); },
|
||||
|
||||
"Esc": function(editor) { editor.completer.detach(); },
|
||||
"Space": function(editor) { editor.completer.detach(); editor.insert(" ");},
|
||||
"Return": function(editor) { editor.completer.insertMatch(); },
|
||||
"Return": function(editor) { return editor.completer.insertMatch(); },
|
||||
"Shift-Return": function(editor) { editor.completer.insertMatch(true); },
|
||||
"Tab": function(editor) { editor.completer.insertMatch(); },
|
||||
"Tab": function(editor) {
|
||||
var result = editor.completer.insertMatch();
|
||||
if (!result && !editor.tabstopManager)
|
||||
editor.completer.goTo("down");
|
||||
else
|
||||
return result;
|
||||
},
|
||||
|
||||
"PageUp": function(editor) { editor.completer.popup.gotoPageUp(); },
|
||||
"PageDown": function(editor) { editor.completer.popup.gotoPageDown(); }
|
||||
|
|
@ -180,24 +223,27 @@ var Autocomplete = function() {
|
|||
this.gatherCompletions = function(editor, callback) {
|
||||
var session = editor.getSession();
|
||||
var pos = editor.getCursorPosition();
|
||||
|
||||
|
||||
var line = session.getLine(pos.row);
|
||||
var prefix = util.retrievePrecedingIdentifier(line, pos.column);
|
||||
|
||||
this.base = editor.getCursorPosition();
|
||||
this.base.column -= prefix.length;
|
||||
|
||||
this.base = session.doc.createAnchor(pos.row, pos.column - prefix.length);
|
||||
this.base.$insertRight = true;
|
||||
|
||||
var matches = [];
|
||||
util.parForEach(editor.completers, function(completer, next) {
|
||||
var total = editor.completers.length;
|
||||
editor.completers.forEach(function(completer, i) {
|
||||
completer.getCompletions(editor, session, pos, prefix, function(err, results) {
|
||||
if (!err)
|
||||
matches = matches.concat(results);
|
||||
next();
|
||||
});
|
||||
}, function() {
|
||||
callback(null, {
|
||||
prefix: prefix,
|
||||
matches: matches
|
||||
// Fetch prefix again, because they may have changed by now
|
||||
var pos = editor.getCursorPosition();
|
||||
var line = session.getLine(pos.row);
|
||||
callback(null, {
|
||||
prefix: util.retrievePrecedingIdentifier(line, pos.column, results[0] && results[0].identifierRegex),
|
||||
matches: matches,
|
||||
finished: (--total === 0)
|
||||
});
|
||||
});
|
||||
});
|
||||
return true;
|
||||
|
|
@ -206,7 +252,7 @@ var Autocomplete = function() {
|
|||
this.showPopup = function(editor) {
|
||||
if (this.editor)
|
||||
this.detach();
|
||||
|
||||
|
||||
this.activated = true;
|
||||
|
||||
this.editor = editor;
|
||||
|
|
@ -216,15 +262,14 @@ var Autocomplete = function() {
|
|||
editor.completer = this;
|
||||
}
|
||||
|
||||
editor.keyBinding.addKeyboardHandler(this.keyboardHandler);
|
||||
editor.on("changeSelection", this.changeListener);
|
||||
editor.on("blur", this.blurListener);
|
||||
editor.on("mousedown", this.mousedownListener);
|
||||
editor.on("mousewheel", this.mousewheelListener);
|
||||
|
||||
|
||||
this.updateCompletions();
|
||||
};
|
||||
|
||||
|
||||
this.updateCompletions = function(keepPopupPosition) {
|
||||
if (keepPopupPosition && this.base && this.completions) {
|
||||
var pos = this.editor.getCursorPosition();
|
||||
|
|
@ -234,33 +279,126 @@ var Autocomplete = function() {
|
|||
this.completions.setFilter(prefix);
|
||||
if (!this.completions.filtered.length)
|
||||
return this.detach();
|
||||
if (this.completions.filtered.length == 1
|
||||
&& this.completions.filtered[0].value == prefix
|
||||
&& !this.completions.filtered[0].snippet)
|
||||
return this.detach();
|
||||
this.openPopup(this.editor, prefix, keepPopupPosition);
|
||||
return;
|
||||
}
|
||||
|
||||
// Save current gatherCompletions session, session is close when a match is insert
|
||||
var _id = this.gatherCompletionsId;
|
||||
this.gatherCompletions(this.editor, function(err, results) {
|
||||
var matches = results && results.matches;
|
||||
if (!matches || !matches.length)
|
||||
// Only detach if result gathering is finished
|
||||
var detachIfFinished = function() {
|
||||
if (!results.finished) return;
|
||||
return this.detach();
|
||||
// TODO reenable this when we have proper change tracking
|
||||
// if (matches.length == 1)
|
||||
// return this.insertMatch(matches[0]);
|
||||
}.bind(this);
|
||||
|
||||
var prefix = results.prefix;
|
||||
var matches = results && results.matches;
|
||||
|
||||
if (!matches || !matches.length)
|
||||
return detachIfFinished();
|
||||
|
||||
// Wrong prefix or wrong session -> ignore
|
||||
if (prefix.indexOf(results.prefix) !== 0 || _id != this.gatherCompletionsId)
|
||||
return;
|
||||
|
||||
this.completions = new FilteredList(matches);
|
||||
this.completions.setFilter(results.prefix);
|
||||
if (!this.completions.filtered.length)
|
||||
return this.detach();
|
||||
this.openPopup(this.editor, results.prefix, keepPopupPosition);
|
||||
|
||||
if (this.exactMatch)
|
||||
this.completions.exactMatch = true;
|
||||
|
||||
this.completions.setFilter(prefix);
|
||||
var filtered = this.completions.filtered;
|
||||
|
||||
// No results
|
||||
if (!filtered.length)
|
||||
return detachIfFinished();
|
||||
|
||||
// One result equals to the prefix
|
||||
if (filtered.length == 1 && filtered[0].value == prefix && !filtered[0].snippet)
|
||||
return detachIfFinished();
|
||||
|
||||
// Autoinsert if one result
|
||||
if (this.autoInsert && filtered.length == 1 && results.finished)
|
||||
return this.insertMatch(filtered[0]);
|
||||
|
||||
this.openPopup(this.editor, prefix, keepPopupPosition);
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
this.cancelContextMenu = function() {
|
||||
var stop = function(e) {
|
||||
this.editor.off("nativecontextmenu", stop);
|
||||
if (e && e.domEvent)
|
||||
event.stopEvent(e.domEvent);
|
||||
}.bind(this);
|
||||
setTimeout(stop, 10);
|
||||
this.editor.on("nativecontextmenu", stop);
|
||||
this.editor.$mouseHandler.cancelContextMenu();
|
||||
};
|
||||
|
||||
this.updateDocTooltip = function() {
|
||||
var popup = this.popup;
|
||||
var all = popup.data;
|
||||
var selected = all && (all[popup.getHoveredRow()] || all[popup.getRow()]);
|
||||
var doc = null;
|
||||
if (!selected || !this.editor || !this.popup.isOpen)
|
||||
return this.hideDocTooltip();
|
||||
this.editor.completers.some(function(completer) {
|
||||
if (completer.getDocTooltip)
|
||||
doc = completer.getDocTooltip(selected);
|
||||
return doc;
|
||||
});
|
||||
if (!doc)
|
||||
doc = selected;
|
||||
|
||||
if (typeof doc == "string")
|
||||
doc = {docText: doc};
|
||||
if (!doc || !(doc.docHTML || doc.docText))
|
||||
return this.hideDocTooltip();
|
||||
this.showDocTooltip(doc);
|
||||
};
|
||||
|
||||
this.showDocTooltip = function(item) {
|
||||
if (!this.tooltipNode) {
|
||||
this.tooltipNode = dom.createElement("div");
|
||||
this.tooltipNode.className = "ace_tooltip ace_doc-tooltip";
|
||||
this.tooltipNode.style.margin = 0;
|
||||
this.tooltipNode.style.pointerEvents = "auto";
|
||||
this.tooltipNode.tabIndex = -1;
|
||||
this.tooltipNode.onblur = this.blurListener.bind(this);
|
||||
}
|
||||
|
||||
var tooltipNode = this.tooltipNode;
|
||||
if (item.docHTML) {
|
||||
tooltipNode.innerHTML = item.docHTML;
|
||||
} else if (item.docText) {
|
||||
tooltipNode.textContent = item.docText;
|
||||
}
|
||||
|
||||
if (!tooltipNode.parentNode)
|
||||
document.body.appendChild(tooltipNode);
|
||||
var popup = this.popup;
|
||||
var rect = popup.container.getBoundingClientRect();
|
||||
tooltipNode.style.top = popup.container.style.top;
|
||||
tooltipNode.style.bottom = popup.container.style.bottom;
|
||||
|
||||
if (window.innerWidth - rect.right < 320) {
|
||||
tooltipNode.style.right = window.innerWidth - rect.left + "px";
|
||||
tooltipNode.style.left = "";
|
||||
} else {
|
||||
tooltipNode.style.left = (rect.right + 1) + "px";
|
||||
tooltipNode.style.right = "";
|
||||
}
|
||||
tooltipNode.style.display = "block";
|
||||
};
|
||||
|
||||
this.hideDocTooltip = function() {
|
||||
this.tooltipTimer.cancel();
|
||||
if (!this.tooltipNode) return;
|
||||
var el = this.tooltipNode;
|
||||
if (!this.editor.isFocused() && document.activeElement == el)
|
||||
this.editor.focus();
|
||||
this.tooltipNode = null;
|
||||
if (el.parentNode)
|
||||
el.parentNode.removeChild(el);
|
||||
};
|
||||
|
||||
}).call(Autocomplete.prototype);
|
||||
|
|
@ -270,17 +408,20 @@ Autocomplete.startCommand = {
|
|||
exec: function(editor) {
|
||||
if (!editor.completer)
|
||||
editor.completer = new Autocomplete();
|
||||
editor.completer.autoInsert = false;
|
||||
editor.completer.autoSelect = true;
|
||||
editor.completer.showPopup(editor);
|
||||
// needed for firefox on mac
|
||||
// prevent ctrl-space opening context menu on firefox on mac
|
||||
editor.completer.cancelContextMenu();
|
||||
},
|
||||
bindKey: "Ctrl-Space|Ctrl-Shift-Space|Alt-Space"
|
||||
};
|
||||
|
||||
var FilteredList = function(array, filterText, mutateData) {
|
||||
var FilteredList = function(array, filterText) {
|
||||
this.all = array;
|
||||
this.filtered = array;
|
||||
this.filterText = filterText || "";
|
||||
this.exactMatch = false;
|
||||
};
|
||||
(function(){
|
||||
this.setFilter = function(str) {
|
||||
|
|
@ -294,16 +435,16 @@ var FilteredList = function(array, filterText, mutateData) {
|
|||
matches = matches.sort(function(a, b) {
|
||||
return b.exactMatch - a.exactMatch || b.score - a.score;
|
||||
});
|
||||
|
||||
|
||||
// make unique
|
||||
var prev = null;
|
||||
matches = matches.filter(function(item){
|
||||
var caption = item.value || item.caption || item.snippet;
|
||||
var caption = item.snippet || item.caption || item.value;
|
||||
if (caption === prev) return false;
|
||||
prev = caption;
|
||||
return true;
|
||||
});
|
||||
|
||||
|
||||
this.filtered = matches;
|
||||
};
|
||||
this.filterCompletions = function(items, needle) {
|
||||
|
|
@ -317,23 +458,29 @@ var FilteredList = function(array, filterText, mutateData) {
|
|||
var matchMask = 0;
|
||||
var penalty = 0;
|
||||
var index, distance;
|
||||
// caption char iteration is faster in Chrome but slower in Firefox, so lets use indexOf
|
||||
for (var j = 0; j < needle.length; j++) {
|
||||
// TODO add penalty on case mismatch
|
||||
var i1 = caption.indexOf(lower[j], lastIndex + 1);
|
||||
var i2 = caption.indexOf(upper[j], lastIndex + 1);
|
||||
index = (i1 >= 0) ? ((i2 < 0 || i1 < i2) ? i1 : i2) : i2;
|
||||
if (index < 0)
|
||||
|
||||
if (this.exactMatch) {
|
||||
if (needle !== caption.substr(0, needle.length))
|
||||
continue loop;
|
||||
distance = index - lastIndex - 1;
|
||||
if (distance > 0) {
|
||||
// first char mismatch should be more sensitive
|
||||
if (lastIndex === -1)
|
||||
penalty += 10;
|
||||
penalty += distance;
|
||||
}else{
|
||||
// caption char iteration is faster in Chrome but slower in Firefox, so lets use indexOf
|
||||
for (var j = 0; j < needle.length; j++) {
|
||||
// TODO add penalty on case mismatch
|
||||
var i1 = caption.indexOf(lower[j], lastIndex + 1);
|
||||
var i2 = caption.indexOf(upper[j], lastIndex + 1);
|
||||
index = (i1 >= 0) ? ((i2 < 0 || i1 < i2) ? i1 : i2) : i2;
|
||||
if (index < 0)
|
||||
continue loop;
|
||||
distance = index - lastIndex - 1;
|
||||
if (distance > 0) {
|
||||
// first char mismatch should be more sensitive
|
||||
if (lastIndex === -1)
|
||||
penalty += 10;
|
||||
penalty += distance;
|
||||
}
|
||||
matchMask = matchMask | (1 << index);
|
||||
lastIndex = index;
|
||||
}
|
||||
matchMask = matchMask | (1 << index);
|
||||
lastIndex = index;
|
||||
}
|
||||
item.matchMask = matchMask;
|
||||
item.exactMatch = penalty ? 0 : 1;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var EditSession = require("../edit_session").EditSession;
|
||||
var Renderer = require("../virtual_renderer").VirtualRenderer;
|
||||
var Editor = require("../editor").Editor;
|
||||
var Range = require("../range").Range;
|
||||
|
|
@ -43,7 +42,7 @@ var $singleLineEditor = function(el) {
|
|||
var renderer = new Renderer(el);
|
||||
|
||||
renderer.$maxLines = 4;
|
||||
|
||||
|
||||
var editor = new Editor(renderer);
|
||||
|
||||
editor.setHighlightActiveLine(false);
|
||||
|
|
@ -52,6 +51,7 @@ var $singleLineEditor = function(el) {
|
|||
editor.renderer.setHighlightGutterLine(false);
|
||||
|
||||
editor.$mouseHandler.$focusWaitTimout = 0;
|
||||
editor.$highlightTagPending = true;
|
||||
|
||||
return editor;
|
||||
};
|
||||
|
|
@ -59,14 +59,15 @@ var $singleLineEditor = function(el) {
|
|||
var AcePopup = function(parentNode) {
|
||||
var el = dom.createElement("div");
|
||||
var popup = new $singleLineEditor(el);
|
||||
|
||||
|
||||
if (parentNode)
|
||||
parentNode.appendChild(el);
|
||||
el.style.display = "none";
|
||||
popup.renderer.content.style.cursor = "default";
|
||||
popup.renderer.setStyle("ace_autocomplete");
|
||||
|
||||
|
||||
popup.setOption("displayIndentGuides", false);
|
||||
popup.setOption("dragDelay", 150);
|
||||
|
||||
var noop = function(){};
|
||||
|
||||
|
|
@ -86,8 +87,7 @@ var AcePopup = function(parentNode) {
|
|||
|
||||
popup.on("mousedown", function(e) {
|
||||
var pos = e.getDocumentPosition();
|
||||
popup.moveCursorToPosition(pos);
|
||||
popup.selection.clearSelection();
|
||||
popup.selection.moveToPosition(pos);
|
||||
selectionMarker.start.row = selectionMarker.end.row = pos.row;
|
||||
e.stop();
|
||||
});
|
||||
|
|
@ -103,7 +103,7 @@ var AcePopup = function(parentNode) {
|
|||
popup.session.removeMarker(hoverMarker.id);
|
||||
hoverMarker.id = null;
|
||||
}
|
||||
}
|
||||
};
|
||||
popup.setSelectOnHover(false);
|
||||
popup.on("mousemove", function(e) {
|
||||
if (!lastMouseEvent) {
|
||||
|
|
@ -155,11 +155,11 @@ var AcePopup = function(parentNode) {
|
|||
popup.getHoveredRow = function() {
|
||||
return hoverMarker.start.row;
|
||||
};
|
||||
|
||||
|
||||
event.addListener(popup.container, "mouseout", hideHoverMarker);
|
||||
popup.on("hide", hideHoverMarker);
|
||||
popup.on("changeSelection", hideHoverMarker);
|
||||
|
||||
|
||||
popup.session.doc.getLength = function() {
|
||||
return popup.data.length;
|
||||
};
|
||||
|
|
@ -171,15 +171,15 @@ var AcePopup = function(parentNode) {
|
|||
};
|
||||
|
||||
var bgTokenizer = popup.session.bgTokenizer;
|
||||
bgTokenizer.$tokenizeRow = function(i) {
|
||||
var data = popup.data[i];
|
||||
bgTokenizer.$tokenizeRow = function(row) {
|
||||
var data = popup.data[row];
|
||||
var tokens = [];
|
||||
if (!data)
|
||||
return tokens;
|
||||
if (typeof data == "string")
|
||||
data = {value: data};
|
||||
if (!data.caption)
|
||||
data.caption = data.value;
|
||||
data.caption = data.value || data.name;
|
||||
|
||||
var last = -1;
|
||||
var flag, c;
|
||||
|
|
@ -196,26 +196,32 @@ var AcePopup = function(parentNode) {
|
|||
|
||||
if (data.meta) {
|
||||
var maxW = popup.renderer.$size.scrollerWidth / popup.renderer.layerConfig.characterWidth;
|
||||
if (data.meta.length + data.caption.length < maxW - 2)
|
||||
tokens.push({type: "rightAlignedText", value: data.meta});
|
||||
var metaData = data.meta;
|
||||
if (metaData.length + data.caption.length > maxW - 2) {
|
||||
// trim meta to fit this popup and add ellipsis
|
||||
metaData = metaData.substr(0, maxW - data.caption.length - 3) + "\u2026"
|
||||
}
|
||||
tokens.push({type: "rightAlignedText", value: metaData});
|
||||
}
|
||||
return tokens;
|
||||
};
|
||||
bgTokenizer.$updateOnChange = noop;
|
||||
bgTokenizer.start = noop;
|
||||
|
||||
|
||||
popup.session.$computeWidth = function() {
|
||||
return this.screenWidth = 0;
|
||||
}
|
||||
};
|
||||
|
||||
popup.$blockScrolling = Infinity;
|
||||
|
||||
// public
|
||||
popup.isOpen = false;
|
||||
popup.isTopdown = false;
|
||||
|
||||
|
||||
popup.data = [];
|
||||
popup.setData = function(list) {
|
||||
popup.data = list || [];
|
||||
popup.setValue(lang.stringRepeat("\n", list.length), -1);
|
||||
popup.data = list || [];
|
||||
popup.setRow(0);
|
||||
};
|
||||
popup.getData = function(row) {
|
||||
|
|
@ -236,10 +242,11 @@ var AcePopup = function(parentNode) {
|
|||
popup._signal("select");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
popup.on("changeSelection", function() {
|
||||
if (popup.isOpen)
|
||||
popup.setRow(popup.selection.lead.row);
|
||||
popup.renderer.scrollCursorIntoView();
|
||||
});
|
||||
|
||||
popup.hide = function() {
|
||||
|
|
@ -250,6 +257,7 @@ var AcePopup = function(parentNode) {
|
|||
popup.show = function(pos, lineHeight, topdownOnly) {
|
||||
var el = this.container;
|
||||
var screenHeight = window.innerHeight;
|
||||
var screenWidth = window.innerWidth;
|
||||
var renderer = this.renderer;
|
||||
// var maxLines = Math.min(renderer.$maxLines, this.session.getLength());
|
||||
var maxH = renderer.$maxLines * lineHeight * 1.4;
|
||||
|
|
@ -265,19 +273,24 @@ var AcePopup = function(parentNode) {
|
|||
popup.isTopdown = true;
|
||||
}
|
||||
|
||||
el.style.left = pos.left + "px";
|
||||
el.style.display = "";
|
||||
this.renderer.$textLayer.checkForSizeChanges();
|
||||
|
||||
var left = pos.left;
|
||||
if (left + el.offsetWidth > screenWidth)
|
||||
left = screenWidth - el.offsetWidth;
|
||||
|
||||
el.style.left = left + "px";
|
||||
|
||||
this._signal("show");
|
||||
lastMouseEvent = null;
|
||||
popup.isOpen = true;
|
||||
};
|
||||
|
||||
|
||||
popup.getTextLeftOffset = function() {
|
||||
return this.$borderSize + this.renderer.$padding + this.$imageSize;
|
||||
};
|
||||
|
||||
|
||||
popup.$imageSize = 0;
|
||||
popup.$borderSize = 1;
|
||||
|
||||
|
|
@ -285,19 +298,24 @@ var AcePopup = function(parentNode) {
|
|||
};
|
||||
|
||||
dom.importCssString("\
|
||||
.ace_autocomplete.ace-tm .ace_marker-layer .ace_active-line {\
|
||||
.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\
|
||||
background-color: #CAD6FA;\
|
||||
z-index: 1;\
|
||||
}\
|
||||
.ace_autocomplete.ace-tm .ace_line-hover {\
|
||||
.ace_editor.ace_autocomplete .ace_line-hover {\
|
||||
border: 1px solid #abbffe;\
|
||||
margin-top: -1px;\
|
||||
background: rgba(233,233,253,0.4);\
|
||||
}\
|
||||
.ace_autocomplete .ace_line-hover {\
|
||||
.ace_editor.ace_autocomplete .ace_line-hover {\
|
||||
position: absolute;\
|
||||
z-index: 2;\
|
||||
}\
|
||||
.ace_editor.ace_autocomplete .ace_scroller {\
|
||||
background: none;\
|
||||
border: none;\
|
||||
box-shadow: none;\
|
||||
}\
|
||||
.ace_rightAlignedText {\
|
||||
color: gray;\
|
||||
display: inline-block;\
|
||||
|
|
@ -306,11 +324,11 @@ dom.importCssString("\
|
|||
text-align: right;\
|
||||
z-index: -1;\
|
||||
}\
|
||||
.ace_autocomplete .ace_completion-highlight{\
|
||||
.ace_editor.ace_autocomplete .ace_completion-highlight{\
|
||||
color: #000;\
|
||||
text-shadow: 0 0 0.01em;\
|
||||
}\
|
||||
.ace_autocomplete {\
|
||||
.ace_editor.ace_autocomplete {\
|
||||
width: 280px;\
|
||||
z-index: 200000;\
|
||||
background: #fbfbfb;\
|
||||
|
|
@ -323,4 +341,4 @@ dom.importCssString("\
|
|||
|
||||
exports.AcePopup = AcePopup;
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -29,9 +29,9 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
var Range = require("ace/range").Range;
|
||||
var Range = require("../range").Range;
|
||||
|
||||
var splitRegex = /[^a-zA-Z_0-9\$\-]+/;
|
||||
var splitRegex = /[^a-zA-Z_0-9\$\-\u00C0-\u1FFF\u2C00-\uD7FF\w]+/;
|
||||
|
||||
function getWordIndex(doc, pos) {
|
||||
var textBefore = doc.getTextRange(Range.fromPoints({row: 0, column:0}, pos));
|
||||
|
|
@ -68,11 +68,11 @@ define(function(require, exports, module) {
|
|||
var wordList = Object.keys(wordScore);
|
||||
callback(null, wordList.map(function(word) {
|
||||
return {
|
||||
name: word,
|
||||
caption: word,
|
||||
value: word,
|
||||
score: wordScore[word],
|
||||
meta: "local"
|
||||
};
|
||||
}));
|
||||
};
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -43,9 +43,9 @@ exports.parForEach = function(array, fn, callback) {
|
|||
callback(result, err);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var ID_REGEX = /[a-zA-Z_0-9\$-]/;
|
||||
var ID_REGEX = /[a-zA-Z_0-9\$\-\u00A2-\uFFFF]/;
|
||||
|
||||
exports.retrievePrecedingIdentifier = function(text, pos, regex) {
|
||||
regex = regex || ID_REGEX;
|
||||
|
|
@ -57,7 +57,7 @@ exports.retrievePrecedingIdentifier = function(text, pos, regex) {
|
|||
break;
|
||||
}
|
||||
return buf.reverse().join("");
|
||||
}
|
||||
};
|
||||
|
||||
exports.retrieveFollowingIdentifier = function(text, pos, regex) {
|
||||
regex = regex || ID_REGEX;
|
||||
|
|
@ -69,6 +69,6 @@ exports.retrieveFollowingIdentifier = function(text, pos, regex) {
|
|||
break;
|
||||
}
|
||||
return buf;
|
||||
}
|
||||
};
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -36,8 +36,6 @@ var EventEmitter = require("./lib/event_emitter").EventEmitter;
|
|||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* Tokenizes the current [[Document `Document`]] in the background, and caches the tokenized rows for future use.
|
||||
*
|
||||
* If a certain row is changed, everything below that row is re-tokenized.
|
||||
|
|
@ -50,8 +48,6 @@ var EventEmitter = require("./lib/event_emitter").EventEmitter;
|
|||
* @param {Tokenizer} tokenizer The tokenizer to use
|
||||
* @param {Editor} editor The editor to associate with
|
||||
*
|
||||
*
|
||||
*
|
||||
* @constructor
|
||||
**/
|
||||
|
||||
|
|
@ -72,11 +68,10 @@ var BackgroundTokenizer = function(tokenizer, editor) {
|
|||
var endLine = -1;
|
||||
var doc = self.doc;
|
||||
|
||||
var startLine = currentLine;
|
||||
while (self.lines[currentLine])
|
||||
currentLine++;
|
||||
|
||||
var startLine = currentLine;
|
||||
|
||||
|
||||
var len = doc.getLength();
|
||||
var processedLines = 0;
|
||||
self.running = false;
|
||||
|
|
@ -89,10 +84,9 @@ var BackgroundTokenizer = function(tokenizer, editor) {
|
|||
|
||||
// only check every 5 lines
|
||||
processedLines ++;
|
||||
if ((processedLines % 5 == 0) && (new Date() - workerStart) > 20) {
|
||||
if ((processedLines % 5 === 0) && (new Date() - workerStart) > 20) {
|
||||
self.running = setTimeout(self.$worker, 20);
|
||||
self.currentLine = currentLine;
|
||||
return;
|
||||
break;
|
||||
}
|
||||
}
|
||||
self.currentLine = currentLine;
|
||||
|
|
@ -150,7 +144,7 @@ var BackgroundTokenizer = function(tokenizer, editor) {
|
|||
first: firstRow,
|
||||
last: lastRow
|
||||
};
|
||||
this._emit("update", {data: data});
|
||||
this._signal("update", {data: data});
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -177,13 +171,12 @@ var BackgroundTokenizer = function(tokenizer, editor) {
|
|||
}
|
||||
|
||||
this.$updateOnChange = function(delta) {
|
||||
var range = delta.range;
|
||||
var startRow = range.start.row;
|
||||
var len = range.end.row - startRow;
|
||||
var startRow = delta.start.row;
|
||||
var len = delta.end.row - startRow;
|
||||
|
||||
if (len === 0) {
|
||||
this.lines[startRow] = null;
|
||||
} else if (delta.action == "removeText" || delta.action == "removeLines") {
|
||||
} else if (delta.action == "remove") {
|
||||
this.lines.splice(startRow, len + 1, null);
|
||||
this.states.splice(startRow, len + 1, null);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -75,6 +75,49 @@ module.exports = {
|
|||
|
||||
forceTokenize(doc)
|
||||
testStates(doc, ["comment_regex_allowed", "start", "no_regex"])
|
||||
},
|
||||
"test background tokenizer sends update event" : function() {
|
||||
var doc = new EditSession([
|
||||
"/*",
|
||||
"var",
|
||||
"juhu",
|
||||
"*/"
|
||||
]);
|
||||
doc.setMode("./mode/javascript");
|
||||
|
||||
var updateEvent = null;
|
||||
doc.bgTokenizer.on("update", function(e) {
|
||||
updateEvent = e.data;
|
||||
});
|
||||
function checkEvent(first, last) {
|
||||
assert.ok(!updateEvent, "unneccessary update event");
|
||||
doc.bgTokenizer.running = 1;
|
||||
doc.bgTokenizer.$worker();
|
||||
assert.ok(updateEvent);
|
||||
assert.equal([first, last] + "",
|
||||
[updateEvent.first, updateEvent.last] + "")
|
||||
updateEvent = null;
|
||||
}
|
||||
|
||||
forceTokenize(doc);
|
||||
var comment = "comment_regex_allowed";
|
||||
testStates(doc, [comment, comment, comment, "start"]);
|
||||
|
||||
doc.remove(new Range(0,0,0,2));
|
||||
testStates(doc, [comment, comment, comment, "start"]);
|
||||
|
||||
checkEvent(0, 3);
|
||||
testStates(doc, ["start", "no_regex", "no_regex", "regex"]);
|
||||
|
||||
// insert /* and and press down several times quickly
|
||||
doc.insert({row:0, column:0}, "/*");
|
||||
doc.getTokens(0);
|
||||
doc.getTokens(1);
|
||||
doc.getTokens(2);
|
||||
checkEvent(0, 3);
|
||||
|
||||
forceTokenize(doc);
|
||||
testStates(doc, [comment, comment, comment, "start"]);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -2,38 +2,44 @@ define(function(require, exports, module) {
|
|||
"use strict";
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var HashHandler = require("../keyboard/hash_handler").HashHandler;
|
||||
var MultiHashHandler = require("../keyboard/hash_handler").MultiHashHandler;
|
||||
var EventEmitter = require("../lib/event_emitter").EventEmitter;
|
||||
|
||||
/**
|
||||
* @class CommandManager
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
/**
|
||||
* new CommandManager(platform, commands)
|
||||
* @param {String} platform Identifier for the platform; must be either `'mac'` or `'win'`
|
||||
* @param {String} platform Identifier for the platform; must be either `"mac"` or `"win"`
|
||||
* @param {Array} commands A list of commands
|
||||
*
|
||||
**/
|
||||
|
||||
var CommandManager = function(platform, commands) {
|
||||
HashHandler.call(this, commands, platform);
|
||||
MultiHashHandler.call(this, commands, platform);
|
||||
this.byName = this.commands;
|
||||
this.setDefaultHandler("exec", function(e) {
|
||||
return e.command.exec(e.editor, e.args || {});
|
||||
});
|
||||
};
|
||||
|
||||
oop.inherits(CommandManager, HashHandler);
|
||||
oop.inherits(CommandManager, MultiHashHandler);
|
||||
|
||||
(function() {
|
||||
|
||||
oop.implement(this, EventEmitter);
|
||||
|
||||
this.exec = function(command, editor, args) {
|
||||
if (typeof command === 'string')
|
||||
if (Array.isArray(command)) {
|
||||
for (var i = command.length; i--; ) {
|
||||
if (this.exec(command[i], editor, args)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if (typeof command === "string")
|
||||
command = this.commands[command];
|
||||
|
||||
if (!command)
|
||||
|
|
@ -43,10 +49,10 @@ oop.inherits(CommandManager, HashHandler);
|
|||
return false;
|
||||
|
||||
var e = {editor: editor, command: command, args: args};
|
||||
var retvalue = this._emit("exec", e);
|
||||
e.returnValue = this._emit("exec", e);
|
||||
this._signal("afterExec", e);
|
||||
|
||||
return retvalue === false ? false : true;
|
||||
return e.returnValue === false ? false : true;
|
||||
};
|
||||
|
||||
this.toggleRecording = function(editor) {
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ module.exports = {
|
|||
assert.equal(command, "cm2");
|
||||
|
||||
var command = this.cm.findKeyCommand(0, "return");
|
||||
assert.equal(command, "cm3");
|
||||
assert.equal(command + "", ["cm4", "cm3"] + "");
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ define(function(require, exports, module) {
|
|||
|
||||
var lang = require("../lib/lang");
|
||||
var config = require("../config");
|
||||
var Range = require("../range").Range;
|
||||
|
||||
function bindKey(win, mac) {
|
||||
return {win: win, mac: mac};
|
||||
|
|
@ -52,6 +53,26 @@ exports.commands = [{
|
|||
});
|
||||
},
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "goToNextError",
|
||||
bindKey: bindKey("Alt-E", "Ctrl-E"),
|
||||
exec: function(editor) {
|
||||
config.loadModule("ace/ext/error_marker", function(module) {
|
||||
module.showErrorMarker(editor, 1);
|
||||
});
|
||||
},
|
||||
scrollIntoView: "animate",
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "goToPreviousError",
|
||||
bindKey: bindKey("Alt-Shift-E", "Ctrl-Shift-E"),
|
||||
exec: function(editor) {
|
||||
config.loadModule("ace/ext/error_marker", function(module) {
|
||||
module.showErrorMarker(editor, -1);
|
||||
});
|
||||
},
|
||||
scrollIntoView: "animate",
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "selectall",
|
||||
bindKey: bindKey("Ctrl-A", "Command-A"),
|
||||
|
|
@ -76,29 +97,33 @@ exports.commands = [{
|
|||
name: "fold",
|
||||
bindKey: bindKey("Alt-L|Ctrl-F1", "Command-Alt-L|Command-F1"),
|
||||
exec: function(editor) { editor.session.toggleFold(false); },
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "center",
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "unfold",
|
||||
bindKey: bindKey("Alt-Shift-L|Ctrl-Shift-F1", "Command-Alt-Shift-L|Command-Shift-F1"),
|
||||
exec: function(editor) { editor.session.toggleFold(true); },
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "center",
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "toggleFoldWidget",
|
||||
bindKey: bindKey("F2", "F2"),
|
||||
exec: function(editor) { editor.session.toggleFoldWidget(); },
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "center",
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "toggleParentFoldWidget",
|
||||
bindKey: bindKey("Alt-F2", "Alt-F2"),
|
||||
exec: function(editor) { editor.session.toggleFoldWidget(true); },
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "center",
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "foldall",
|
||||
bindKey: bindKey("Ctrl-Alt-0", "Ctrl-Command-Option-0"),
|
||||
bindKey: bindKey(null, "Ctrl-Command-Option-0"),
|
||||
exec: function(editor) { editor.session.foldAll(); },
|
||||
scrollIntoView: "center",
|
||||
readOnly: true
|
||||
|
|
@ -121,11 +146,35 @@ exports.commands = [{
|
|||
name: "findnext",
|
||||
bindKey: bindKey("Ctrl-K", "Command-G"),
|
||||
exec: function(editor) { editor.findNext(); },
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "center",
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "findprevious",
|
||||
bindKey: bindKey("Ctrl-Shift-K", "Command-Shift-G"),
|
||||
exec: function(editor) { editor.findPrevious(); },
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "center",
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "selectOrFindNext",
|
||||
bindKey: bindKey("Alt-K", "Ctrl-G"),
|
||||
exec: function(editor) {
|
||||
if (editor.selection.isEmpty())
|
||||
editor.selection.selectWord();
|
||||
else
|
||||
editor.findNext();
|
||||
},
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "selectOrFindPrevious",
|
||||
bindKey: bindKey("Alt-Shift-K", "Ctrl-Shift-G"),
|
||||
exec: function(editor) {
|
||||
if (editor.selection.isEmpty())
|
||||
editor.selection.selectWord();
|
||||
else
|
||||
editor.findPrevious();
|
||||
},
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "find",
|
||||
|
|
@ -145,25 +194,29 @@ exports.commands = [{
|
|||
exec: function(editor) { editor.getSelection().selectFileStart(); },
|
||||
multiSelectAction: "forEach",
|
||||
readOnly: true,
|
||||
group: "fileJump"
|
||||
scrollIntoView: "animate",
|
||||
aceCommandGroup: "fileJump"
|
||||
}, {
|
||||
name: "gotostart",
|
||||
bindKey: bindKey("Ctrl-Home", "Command-Home|Command-Up"),
|
||||
exec: function(editor) { editor.navigateFileStart(); },
|
||||
multiSelectAction: "forEach",
|
||||
readOnly: true,
|
||||
group: "fileJump"
|
||||
scrollIntoView: "animate",
|
||||
aceCommandGroup: "fileJump"
|
||||
}, {
|
||||
name: "selectup",
|
||||
bindKey: bindKey("Shift-Up", "Shift-Up"),
|
||||
exec: function(editor) { editor.getSelection().selectUp(); },
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor",
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "golineup",
|
||||
bindKey: bindKey("Up", "Up|Ctrl-P"),
|
||||
exec: function(editor, args) { editor.navigateUp(args.times); },
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor",
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "selecttoend",
|
||||
|
|
@ -171,97 +224,113 @@ exports.commands = [{
|
|||
exec: function(editor) { editor.getSelection().selectFileEnd(); },
|
||||
multiSelectAction: "forEach",
|
||||
readOnly: true,
|
||||
group: "fileJump"
|
||||
scrollIntoView: "animate",
|
||||
aceCommandGroup: "fileJump"
|
||||
}, {
|
||||
name: "gotoend",
|
||||
bindKey: bindKey("Ctrl-End", "Command-End|Command-Down"),
|
||||
exec: function(editor) { editor.navigateFileEnd(); },
|
||||
multiSelectAction: "forEach",
|
||||
readOnly: true,
|
||||
group: "fileJump"
|
||||
scrollIntoView: "animate",
|
||||
aceCommandGroup: "fileJump"
|
||||
}, {
|
||||
name: "selectdown",
|
||||
bindKey: bindKey("Shift-Down", "Shift-Down"),
|
||||
exec: function(editor) { editor.getSelection().selectDown(); },
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor",
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "golinedown",
|
||||
bindKey: bindKey("Down", "Down|Ctrl-N"),
|
||||
exec: function(editor, args) { editor.navigateDown(args.times); },
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor",
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "selectwordleft",
|
||||
bindKey: bindKey("Ctrl-Shift-Left", "Option-Shift-Left"),
|
||||
exec: function(editor) { editor.getSelection().selectWordLeft(); },
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor",
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "gotowordleft",
|
||||
bindKey: bindKey("Ctrl-Left", "Option-Left"),
|
||||
exec: function(editor) { editor.navigateWordLeft(); },
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor",
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "selecttolinestart",
|
||||
bindKey: bindKey("Alt-Shift-Left", "Command-Shift-Left"),
|
||||
exec: function(editor) { editor.getSelection().selectLineStart(); },
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor",
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "gotolinestart",
|
||||
bindKey: bindKey("Alt-Left|Home", "Command-Left|Home|Ctrl-A"),
|
||||
exec: function(editor) { editor.navigateLineStart(); },
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor",
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "selectleft",
|
||||
bindKey: bindKey("Shift-Left", "Shift-Left"),
|
||||
exec: function(editor) { editor.getSelection().selectLeft(); },
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor",
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "gotoleft",
|
||||
bindKey: bindKey("Left", "Left|Ctrl-B"),
|
||||
exec: function(editor, args) { editor.navigateLeft(args.times); },
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor",
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "selectwordright",
|
||||
bindKey: bindKey("Ctrl-Shift-Right", "Option-Shift-Right"),
|
||||
exec: function(editor) { editor.getSelection().selectWordRight(); },
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor",
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "gotowordright",
|
||||
bindKey: bindKey("Ctrl-Right", "Option-Right"),
|
||||
exec: function(editor) { editor.navigateWordRight(); },
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor",
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "selecttolineend",
|
||||
bindKey: bindKey("Alt-Shift-Right", "Command-Shift-Right"),
|
||||
exec: function(editor) { editor.getSelection().selectLineEnd(); },
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor",
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "gotolineend",
|
||||
bindKey: bindKey("Alt-Right|End", "Command-Right|End|Ctrl-E"),
|
||||
exec: function(editor) { editor.navigateLineEnd(); },
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor",
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "selectright",
|
||||
bindKey: bindKey("Shift-Right", "Shift-Right"),
|
||||
exec: function(editor) { editor.getSelection().selectRight(); },
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor",
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "gotoright",
|
||||
bindKey: bindKey("Right", "Right|Ctrl-F"),
|
||||
exec: function(editor, args) { editor.navigateRight(args.times); },
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor",
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "selectpagedown",
|
||||
|
|
@ -308,12 +377,14 @@ exports.commands = [{
|
|||
bindKey: "Shift-Home",
|
||||
exec: function(editor) { editor.getSelection().selectLineStart(); },
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor",
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "selectlineend",
|
||||
bindKey: "Shift-End",
|
||||
exec: function(editor) { editor.getSelection().selectLineEnd(); },
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor",
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "togglerecording",
|
||||
|
|
@ -327,17 +398,38 @@ exports.commands = [{
|
|||
readOnly: true
|
||||
}, {
|
||||
name: "jumptomatching",
|
||||
bindKey: bindKey("Ctrl-P", "Ctrl-Shift-P"),
|
||||
bindKey: bindKey("Ctrl-P", "Ctrl-P"),
|
||||
exec: function(editor) { editor.jumpToMatching(); },
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "animate",
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "selecttomatching",
|
||||
bindKey: bindKey("Ctrl-Shift-P", null),
|
||||
bindKey: bindKey("Ctrl-Shift-P", "Ctrl-Shift-P"),
|
||||
exec: function(editor) { editor.jumpToMatching(true); },
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "animate",
|
||||
readOnly: true
|
||||
},
|
||||
}, {
|
||||
name: "expandToMatching",
|
||||
bindKey: bindKey("Ctrl-Shift-M", "Ctrl-Shift-M"),
|
||||
exec: function(editor) { editor.jumpToMatching(true, true); },
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "animate",
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "passKeysToBrowser",
|
||||
bindKey: bindKey(null, null),
|
||||
exec: function() {},
|
||||
passEvent: true,
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "copy",
|
||||
exec: function(editor) {
|
||||
// placeholder for replay macro
|
||||
},
|
||||
readOnly: true
|
||||
},
|
||||
|
||||
// commands disabled in readOnly mode
|
||||
{
|
||||
|
|
@ -351,21 +443,31 @@ exports.commands = [{
|
|||
editor.clearSelection();
|
||||
}
|
||||
},
|
||||
scrollIntoView: "cursor",
|
||||
multiSelectAction: "forEach"
|
||||
}, {
|
||||
name: "paste",
|
||||
exec: function(editor, args) {
|
||||
editor.$handlePaste(args);
|
||||
},
|
||||
scrollIntoView: "cursor"
|
||||
}, {
|
||||
name: "removeline",
|
||||
bindKey: bindKey("Ctrl-D", "Command-D"),
|
||||
exec: function(editor) { editor.removeLines(); },
|
||||
scrollIntoView: "cursor",
|
||||
multiSelectAction: "forEachLine"
|
||||
}, {
|
||||
name: "duplicateSelection",
|
||||
bindKey: bindKey("Ctrl-Shift-D", "Command-Shift-D"),
|
||||
exec: function(editor) { editor.duplicateSelection(); },
|
||||
scrollIntoView: "cursor",
|
||||
multiSelectAction: "forEach"
|
||||
}, {
|
||||
name: "sortlines",
|
||||
bindKey: bindKey("Ctrl-Alt-S", "Command-Alt-S"),
|
||||
exec: function(editor) { editor.sortLines(); },
|
||||
scrollIntoView: "selection",
|
||||
multiSelectAction: "forEachLine"
|
||||
}, {
|
||||
name: "togglecomment",
|
||||
|
|
@ -377,16 +479,19 @@ exports.commands = [{
|
|||
name: "toggleBlockComment",
|
||||
bindKey: bindKey("Ctrl-Shift-/", "Command-Shift-/"),
|
||||
exec: function(editor) { editor.toggleBlockComment(); },
|
||||
multiSelectAction: "forEach"
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "selectionPart"
|
||||
}, {
|
||||
name: "modifyNumberUp",
|
||||
bindKey: bindKey("Ctrl-Shift-Up", "Alt-Shift-Up"),
|
||||
exec: function(editor) { editor.modifyNumber(1); },
|
||||
scrollIntoView: "cursor",
|
||||
multiSelectAction: "forEach"
|
||||
}, {
|
||||
name: "modifyNumberDown",
|
||||
bindKey: bindKey("Ctrl-Shift-Down", "Alt-Shift-Down"),
|
||||
exec: function(editor) { editor.modifyNumber(-1); },
|
||||
scrollIntoView: "cursor",
|
||||
multiSelectAction: "forEach"
|
||||
}, {
|
||||
name: "replace",
|
||||
|
|
@ -405,24 +510,29 @@ exports.commands = [{
|
|||
}, {
|
||||
name: "copylinesup",
|
||||
bindKey: bindKey("Alt-Shift-Up", "Command-Option-Up"),
|
||||
exec: function(editor) { editor.copyLinesUp(); }
|
||||
exec: function(editor) { editor.copyLinesUp(); },
|
||||
scrollIntoView: "cursor"
|
||||
}, {
|
||||
name: "movelinesup",
|
||||
bindKey: bindKey("Alt-Up", "Option-Up"),
|
||||
exec: function(editor) { editor.moveLinesUp(); }
|
||||
exec: function(editor) { editor.moveLinesUp(); },
|
||||
scrollIntoView: "cursor"
|
||||
}, {
|
||||
name: "copylinesdown",
|
||||
bindKey: bindKey("Alt-Shift-Down", "Command-Option-Down"),
|
||||
exec: function(editor) { editor.copyLinesDown(); }
|
||||
exec: function(editor) { editor.copyLinesDown(); },
|
||||
scrollIntoView: "cursor"
|
||||
}, {
|
||||
name: "movelinesdown",
|
||||
bindKey: bindKey("Alt-Down", "Option-Down"),
|
||||
exec: function(editor) { editor.moveLinesDown(); }
|
||||
exec: function(editor) { editor.moveLinesDown(); },
|
||||
scrollIntoView: "cursor"
|
||||
}, {
|
||||
name: "del",
|
||||
bindKey: bindKey("Delete", "Delete|Ctrl-D|Shift-Delete"),
|
||||
exec: function(editor) { editor.remove("right"); },
|
||||
multiSelectAction: "forEach"
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor"
|
||||
}, {
|
||||
name: "backspace",
|
||||
bindKey: bindKey(
|
||||
|
|
@ -430,7 +540,8 @@ exports.commands = [{
|
|||
"Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"
|
||||
),
|
||||
exec: function(editor) { editor.remove("left"); },
|
||||
multiSelectAction: "forEach"
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor"
|
||||
}, {
|
||||
name: "cut_or_delete",
|
||||
bindKey: bindKey("Shift-Delete", null),
|
||||
|
|
@ -441,27 +552,32 @@ exports.commands = [{
|
|||
return false;
|
||||
}
|
||||
},
|
||||
multiSelectAction: "forEach"
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor"
|
||||
}, {
|
||||
name: "removetolinestart",
|
||||
bindKey: bindKey("Alt-Backspace", "Command-Backspace"),
|
||||
exec: function(editor) { editor.removeToLineStart(); },
|
||||
multiSelectAction: "forEach"
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor"
|
||||
}, {
|
||||
name: "removetolineend",
|
||||
bindKey: bindKey("Alt-Delete", "Ctrl-K"),
|
||||
exec: function(editor) { editor.removeToLineEnd(); },
|
||||
multiSelectAction: "forEach"
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor"
|
||||
}, {
|
||||
name: "removewordleft",
|
||||
bindKey: bindKey("Ctrl-Backspace", "Alt-Backspace|Ctrl-Alt-Backspace"),
|
||||
exec: function(editor) { editor.removeWordLeft(); },
|
||||
multiSelectAction: "forEach"
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor"
|
||||
}, {
|
||||
name: "removewordright",
|
||||
bindKey: bindKey("Ctrl-Delete", "Alt-Delete"),
|
||||
exec: function(editor) { editor.removeWordRight(); },
|
||||
multiSelectAction: "forEach"
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor"
|
||||
}, {
|
||||
name: "outdent",
|
||||
bindKey: bindKey("Shift-Tab", "Shift-Tab"),
|
||||
|
|
@ -496,27 +612,126 @@ exports.commands = [{
|
|||
exec: function(editor, args) {
|
||||
editor.insert(lang.stringRepeat(args.text || "", args.times || 1));
|
||||
},
|
||||
multiSelectAction: "forEach"
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor"
|
||||
}, {
|
||||
name: "splitline",
|
||||
bindKey: bindKey(null, "Ctrl-O"),
|
||||
exec: function(editor) { editor.splitLine(); },
|
||||
multiSelectAction: "forEach"
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor"
|
||||
}, {
|
||||
name: "transposeletters",
|
||||
bindKey: bindKey("Ctrl-T", "Ctrl-T"),
|
||||
exec: function(editor) { editor.transposeLetters(); },
|
||||
multiSelectAction: function(editor) {editor.transposeSelections(1); }
|
||||
multiSelectAction: function(editor) {editor.transposeSelections(1); },
|
||||
scrollIntoView: "cursor"
|
||||
}, {
|
||||
name: "touppercase",
|
||||
bindKey: bindKey("Ctrl-U", "Ctrl-U"),
|
||||
exec: function(editor) { editor.toUpperCase(); },
|
||||
multiSelectAction: "forEach"
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor"
|
||||
}, {
|
||||
name: "tolowercase",
|
||||
bindKey: bindKey("Ctrl-Shift-U", "Ctrl-Shift-U"),
|
||||
exec: function(editor) { editor.toLowerCase(); },
|
||||
multiSelectAction: "forEach"
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor"
|
||||
}, {
|
||||
name: "expandtoline",
|
||||
bindKey: bindKey("Ctrl-Shift-L", "Command-Shift-L"),
|
||||
exec: function(editor) {
|
||||
var range = editor.selection.getRange();
|
||||
|
||||
range.start.column = range.end.column = 0;
|
||||
range.end.row++;
|
||||
editor.selection.setRange(range, false);
|
||||
},
|
||||
multiSelectAction: "forEach",
|
||||
scrollIntoView: "cursor",
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "joinlines",
|
||||
bindKey: bindKey(null, null),
|
||||
exec: function(editor) {
|
||||
var isBackwards = editor.selection.isBackwards();
|
||||
var selectionStart = isBackwards ? editor.selection.getSelectionLead() : editor.selection.getSelectionAnchor();
|
||||
var selectionEnd = isBackwards ? editor.selection.getSelectionAnchor() : editor.selection.getSelectionLead();
|
||||
var firstLineEndCol = editor.session.doc.getLine(selectionStart.row).length;
|
||||
var selectedText = editor.session.doc.getTextRange(editor.selection.getRange());
|
||||
var selectedCount = selectedText.replace(/\n\s*/, " ").length;
|
||||
var insertLine = editor.session.doc.getLine(selectionStart.row);
|
||||
|
||||
for (var i = selectionStart.row + 1; i <= selectionEnd.row + 1; i++) {
|
||||
var curLine = lang.stringTrimLeft(lang.stringTrimRight(editor.session.doc.getLine(i)));
|
||||
if (curLine.length !== 0) {
|
||||
curLine = " " + curLine;
|
||||
}
|
||||
insertLine += curLine;
|
||||
}
|
||||
|
||||
if (selectionEnd.row + 1 < (editor.session.doc.getLength() - 1)) {
|
||||
// Don't insert a newline at the end of the document
|
||||
insertLine += editor.session.doc.getNewLineCharacter();
|
||||
}
|
||||
|
||||
editor.clearSelection();
|
||||
editor.session.doc.replace(new Range(selectionStart.row, 0, selectionEnd.row + 2, 0), insertLine);
|
||||
|
||||
if (selectedCount > 0) {
|
||||
// Select the text that was previously selected
|
||||
editor.selection.moveCursorTo(selectionStart.row, selectionStart.column);
|
||||
editor.selection.selectTo(selectionStart.row, selectionStart.column + selectedCount);
|
||||
} else {
|
||||
// If the joined line had something in it, start the cursor at that something
|
||||
firstLineEndCol = editor.session.doc.getLine(selectionStart.row).length > firstLineEndCol ? (firstLineEndCol + 1) : firstLineEndCol;
|
||||
editor.selection.moveCursorTo(selectionStart.row, firstLineEndCol);
|
||||
}
|
||||
},
|
||||
multiSelectAction: "forEach",
|
||||
readOnly: true
|
||||
}, {
|
||||
name: "invertSelection",
|
||||
bindKey: bindKey(null, null),
|
||||
exec: function(editor) {
|
||||
var endRow = editor.session.doc.getLength() - 1;
|
||||
var endCol = editor.session.doc.getLine(endRow).length;
|
||||
var ranges = editor.selection.rangeList.ranges;
|
||||
var newRanges = [];
|
||||
|
||||
// If multiple selections don't exist, rangeList will return 0 so replace with single range
|
||||
if (ranges.length < 1) {
|
||||
ranges = [editor.selection.getRange()];
|
||||
}
|
||||
|
||||
for (var i = 0; i < ranges.length; i++) {
|
||||
if (i == (ranges.length - 1)) {
|
||||
// The last selection must connect to the end of the document, unless it already does
|
||||
if (!(ranges[i].end.row === endRow && ranges[i].end.column === endCol)) {
|
||||
newRanges.push(new Range(ranges[i].end.row, ranges[i].end.column, endRow, endCol));
|
||||
}
|
||||
}
|
||||
|
||||
if (i === 0) {
|
||||
// The first selection must connect to the start of the document, unless it already does
|
||||
if (!(ranges[i].start.row === 0 && ranges[i].start.column === 0)) {
|
||||
newRanges.push(new Range(0, 0, ranges[i].start.row, ranges[i].start.column));
|
||||
}
|
||||
} else {
|
||||
newRanges.push(new Range(ranges[i-1].end.row, ranges[i-1].end.column, ranges[i].start.row, ranges[i].start.column));
|
||||
}
|
||||
}
|
||||
|
||||
editor.exitMultiSelectMode();
|
||||
editor.clearSelection();
|
||||
|
||||
for(var i = 0; i < newRanges.length; i++) {
|
||||
editor.selection.addRange(newRanges[i], false);
|
||||
}
|
||||
},
|
||||
readOnly: true,
|
||||
scrollIntoView: "none"
|
||||
}];
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -69,18 +69,14 @@ exports.iSearchCommands = [{
|
|||
bindKey: {win: "Ctrl-F", mac: "Command-F"},
|
||||
exec: function(iSearch) {
|
||||
iSearch.cancelSearch(true);
|
||||
},
|
||||
readOnly: true,
|
||||
isIncrementalSearchCommand: true
|
||||
}
|
||||
}, {
|
||||
name: "searchForward",
|
||||
bindKey: {win: "Ctrl-S|Ctrl-K", mac: "Ctrl-S|Command-G"},
|
||||
exec: function(iSearch, options) {
|
||||
options.useCurrentOrPrevSearch = true;
|
||||
iSearch.next(options);
|
||||
},
|
||||
readOnly: true,
|
||||
isIncrementalSearchCommand: true
|
||||
}
|
||||
}, {
|
||||
name: "searchBackward",
|
||||
bindKey: {win: "Ctrl-R|Ctrl-Shift-K", mac: "Ctrl-R|Command-Shift-G"},
|
||||
|
|
@ -88,42 +84,30 @@ exports.iSearchCommands = [{
|
|||
options.useCurrentOrPrevSearch = true;
|
||||
options.backwards = true;
|
||||
iSearch.next(options);
|
||||
},
|
||||
readOnly: true,
|
||||
isIncrementalSearchCommand: true
|
||||
}
|
||||
}, {
|
||||
name: "extendSearchTerm",
|
||||
exec: function(iSearch, string) {
|
||||
iSearch.addChar(string);
|
||||
},
|
||||
readOnly: true,
|
||||
isIncrementalSearchCommand: true
|
||||
iSearch.addString(string);
|
||||
}
|
||||
}, {
|
||||
name: "extendSearchTermSpace",
|
||||
bindKey: "space",
|
||||
exec: function(iSearch) { iSearch.addChar(' '); },
|
||||
readOnly: true,
|
||||
isIncrementalSearchCommand: true
|
||||
exec: function(iSearch) { iSearch.addString(' '); }
|
||||
}, {
|
||||
name: "shrinkSearchTerm",
|
||||
bindKey: "backspace",
|
||||
exec: function(iSearch) {
|
||||
iSearch.removeChar();
|
||||
},
|
||||
readOnly: true,
|
||||
isIncrementalSearchCommand: true
|
||||
}
|
||||
}, {
|
||||
name: 'confirmSearch',
|
||||
bindKey: 'return',
|
||||
exec: function(iSearch) { iSearch.deactivate(); },
|
||||
readOnly: true,
|
||||
isIncrementalSearchCommand: true
|
||||
exec: function(iSearch) { iSearch.deactivate(); }
|
||||
}, {
|
||||
name: 'cancelSearch',
|
||||
bindKey: 'esc|Ctrl-G',
|
||||
exec: function(iSearch) { iSearch.deactivate(true); },
|
||||
readOnly: true,
|
||||
isIncrementalSearchCommand: true
|
||||
exec: function(iSearch) { iSearch.deactivate(true); }
|
||||
}, {
|
||||
name: 'occurisearch',
|
||||
bindKey: 'Ctrl-O',
|
||||
|
|
@ -131,10 +115,53 @@ exports.iSearchCommands = [{
|
|||
var options = oop.mixin({}, iSearch.$options);
|
||||
iSearch.deactivate();
|
||||
occurStartCommand.exec(iSearch.$editor, options);
|
||||
},
|
||||
readOnly: true,
|
||||
isIncrementalSearchCommand: true
|
||||
}];
|
||||
}
|
||||
}, {
|
||||
name: "yankNextWord",
|
||||
bindKey: "Ctrl-w",
|
||||
exec: function(iSearch) {
|
||||
var ed = iSearch.$editor,
|
||||
range = ed.selection.getRangeOfMovements(function(sel) { sel.moveCursorWordRight(); }),
|
||||
string = ed.session.getTextRange(range);
|
||||
iSearch.addString(string);
|
||||
}
|
||||
}, {
|
||||
name: "yankNextChar",
|
||||
bindKey: "Ctrl-Alt-y",
|
||||
exec: function(iSearch) {
|
||||
var ed = iSearch.$editor,
|
||||
range = ed.selection.getRangeOfMovements(function(sel) { sel.moveCursorRight(); }),
|
||||
string = ed.session.getTextRange(range);
|
||||
iSearch.addString(string);
|
||||
}
|
||||
}, {
|
||||
name: 'recenterTopBottom',
|
||||
bindKey: 'Ctrl-l',
|
||||
exec: function(iSearch) { iSearch.$editor.execCommand('recenterTopBottom'); }
|
||||
}, {
|
||||
name: 'selectAllMatches',
|
||||
bindKey: 'Ctrl-space',
|
||||
exec: function(iSearch) {
|
||||
var ed = iSearch.$editor,
|
||||
hl = ed.session.$isearchHighlight,
|
||||
ranges = hl && hl.cache ? hl.cache
|
||||
.reduce(function(ranges, ea) {
|
||||
return ranges.concat(ea ? ea : []); }, []) : [];
|
||||
iSearch.deactivate(false);
|
||||
ranges.forEach(ed.selection.addRange.bind(ed.selection));
|
||||
}
|
||||
}, {
|
||||
name: 'searchAsRegExp',
|
||||
bindKey: 'Alt-r',
|
||||
exec: function(iSearch) {
|
||||
iSearch.convertNeedleToRegExp();
|
||||
}
|
||||
}].map(function(cmd) {
|
||||
cmd.readOnly = true;
|
||||
cmd.isIncrementalSearchCommand = true;
|
||||
cmd.scrollIntoView = "animate-cursor";
|
||||
return cmd;
|
||||
});
|
||||
|
||||
function IncrementalSearchKeyboardHandler(iSearch) {
|
||||
this.$iSearch = iSearch;
|
||||
|
|
@ -142,7 +169,7 @@ function IncrementalSearchKeyboardHandler(iSearch) {
|
|||
|
||||
oop.inherits(IncrementalSearchKeyboardHandler, HashHandler);
|
||||
|
||||
;(function() {
|
||||
(function() {
|
||||
|
||||
this.attach = function(editor) {
|
||||
var iSearch = this.$iSearch;
|
||||
|
|
@ -151,18 +178,24 @@ oop.inherits(IncrementalSearchKeyboardHandler, HashHandler);
|
|||
if (!e.command.isIncrementalSearchCommand) return undefined;
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
return e.command.exec(iSearch, e.args || {});
|
||||
var scrollTop = editor.session.getScrollTop();
|
||||
var result = e.command.exec(iSearch, e.args || {});
|
||||
editor.renderer.scrollCursorIntoView(null, 0.5);
|
||||
editor.renderer.animateScrolling(scrollTop);
|
||||
return result;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
this.detach = function(editor) {
|
||||
if (!this.$commandExecHandler) return;
|
||||
editor.commands.removeEventListener('exec', this.$commandExecHandler);
|
||||
delete this.$commandExecHandler;
|
||||
}
|
||||
};
|
||||
|
||||
var handleKeyboard$super = this.handleKeyboard;
|
||||
this.handleKeyboard = function(data, hashId, key, keyCode) {
|
||||
if (((hashId === 1/*ctrl*/ || hashId === 8/*command*/) && key === 'v')
|
||||
|| (hashId === 1/*ctrl*/ && key === 'y')) return null;
|
||||
var cmd = handleKeyboard$super.call(this, data, hashId, key, keyCode);
|
||||
if (cmd.command) { return cmd; }
|
||||
if (hashId == -1) {
|
||||
|
|
@ -170,7 +203,7 @@ oop.inherits(IncrementalSearchKeyboardHandler, HashHandler);
|
|||
if (extendCmd) { return {command: extendCmd, args: key}; }
|
||||
}
|
||||
return {command: "null", passEvent: hashId == 0 || hashId == 4};
|
||||
}
|
||||
};
|
||||
|
||||
}).call(IncrementalSearchKeyboardHandler.prototype);
|
||||
|
||||
|
|
|
|||
|
|
@ -35,41 +35,49 @@ exports.defaultCommands = [{
|
|||
name: "addCursorAbove",
|
||||
exec: function(editor) { editor.selectMoreLines(-1); },
|
||||
bindKey: {win: "Ctrl-Alt-Up", mac: "Ctrl-Alt-Up"},
|
||||
scrollIntoView: "cursor",
|
||||
readonly: true
|
||||
}, {
|
||||
name: "addCursorBelow",
|
||||
exec: function(editor) { editor.selectMoreLines(1); },
|
||||
bindKey: {win: "Ctrl-Alt-Down", mac: "Ctrl-Alt-Down"},
|
||||
scrollIntoView: "cursor",
|
||||
readonly: true
|
||||
}, {
|
||||
name: "addCursorAboveSkipCurrent",
|
||||
exec: function(editor) { editor.selectMoreLines(-1, true); },
|
||||
bindKey: {win: "Ctrl-Alt-Shift-Up", mac: "Ctrl-Alt-Shift-Up"},
|
||||
scrollIntoView: "cursor",
|
||||
readonly: true
|
||||
}, {
|
||||
name: "addCursorBelowSkipCurrent",
|
||||
exec: function(editor) { editor.selectMoreLines(1, true); },
|
||||
bindKey: {win: "Ctrl-Alt-Shift-Down", mac: "Ctrl-Alt-Shift-Down"},
|
||||
scrollIntoView: "cursor",
|
||||
readonly: true
|
||||
}, {
|
||||
name: "selectMoreBefore",
|
||||
exec: function(editor) { editor.selectMore(-1); },
|
||||
bindKey: {win: "Ctrl-Alt-Left", mac: "Ctrl-Alt-Left"},
|
||||
scrollIntoView: "cursor",
|
||||
readonly: true
|
||||
}, {
|
||||
name: "selectMoreAfter",
|
||||
exec: function(editor) { editor.selectMore(1); },
|
||||
bindKey: {win: "Ctrl-Alt-Right", mac: "Ctrl-Alt-Right"},
|
||||
scrollIntoView: "cursor",
|
||||
readonly: true
|
||||
}, {
|
||||
name: "selectNextBefore",
|
||||
exec: function(editor) { editor.selectMore(-1, true); },
|
||||
bindKey: {win: "Ctrl-Alt-Shift-Left", mac: "Ctrl-Alt-Shift-Left"},
|
||||
scrollIntoView: "cursor",
|
||||
readonly: true
|
||||
}, {
|
||||
name: "selectNextAfter",
|
||||
exec: function(editor) { editor.selectMore(1, true); },
|
||||
bindKey: {win: "Ctrl-Alt-Shift-Right", mac: "Ctrl-Alt-Shift-Right"},
|
||||
scrollIntoView: "cursor",
|
||||
readonly: true
|
||||
}, {
|
||||
name: "splitIntoLines",
|
||||
|
|
@ -79,7 +87,14 @@ exports.defaultCommands = [{
|
|||
}, {
|
||||
name: "alignCursors",
|
||||
exec: function(editor) { editor.alignCursors(); },
|
||||
bindKey: {win: "Ctrl-Alt-A", mac: "Ctrl-Alt-A"}
|
||||
bindKey: {win: "Ctrl-Alt-A", mac: "Ctrl-Alt-A"},
|
||||
scrollIntoView: "cursor"
|
||||
}, {
|
||||
name: "findAll",
|
||||
exec: function(editor) { editor.findAll(); },
|
||||
bindKey: {win: "Ctrl-Alt-K", mac: "Ctrl-Alt-G"},
|
||||
scrollIntoView: "cursor",
|
||||
readonly: true
|
||||
}];
|
||||
|
||||
// commands active only in multiselect mode
|
||||
|
|
@ -87,6 +102,7 @@ exports.multiSelectCommands = [{
|
|||
name: "singleSelection",
|
||||
bindKey: "esc",
|
||||
exec: function(editor) { editor.exitMultiSelectMode(); },
|
||||
scrollIntoView: "cursor",
|
||||
readonly: true,
|
||||
isAvailable: function(editor) {return editor && editor.inMultiSelectMode}
|
||||
}];
|
||||
|
|
|
|||
|
|
@ -34,10 +34,12 @@ define(function(require, exports, module) {
|
|||
var lang = require("./lib/lang");
|
||||
var oop = require("./lib/oop");
|
||||
var net = require("./lib/net");
|
||||
var EventEmitter = require("./lib/event_emitter").EventEmitter;
|
||||
var AppConfig = require("./lib/app_config").AppConfig;
|
||||
|
||||
module.exports = exports = new AppConfig();
|
||||
|
||||
var global = (function() {
|
||||
return this;
|
||||
return this || typeof window != "undefined" && window;
|
||||
})();
|
||||
|
||||
var options = {
|
||||
|
|
@ -69,8 +71,6 @@ exports.all = function() {
|
|||
};
|
||||
|
||||
// module loading
|
||||
oop.implement(exports, EventEmitter);
|
||||
|
||||
exports.moduleUrl = function(name, component) {
|
||||
if (options.$moduleUrls[name])
|
||||
return options.$moduleUrls[name];
|
||||
|
|
@ -80,8 +80,8 @@ exports.moduleUrl = function(name, component) {
|
|||
|
||||
// todo make this configurable or get rid of '-'
|
||||
var sep = component == "snippets" ? "/" : "-";
|
||||
var base = parts[parts.length - 1];
|
||||
if (sep == "-") {
|
||||
var base = parts[parts.length - 1];
|
||||
if (component == "worker" && sep == "-") {
|
||||
var re = new RegExp("^" + component + "[\\-_]|[\\-_]" + component + "$", "g");
|
||||
base = base.replace(re, "");
|
||||
}
|
||||
|
|
@ -142,10 +142,9 @@ exports.loadModule = function(moduleName, onLoad) {
|
|||
net.loadScript(exports.moduleUrl(moduleName, moduleType), afterLoad);
|
||||
};
|
||||
|
||||
|
||||
// initialization
|
||||
exports.init = function() {
|
||||
options.packaged = require.packaged || module.packaged || (global.define && define.packaged);
|
||||
function init(packaged) {
|
||||
options.packaged = packaged || require.packaged || module.packaged || (global.define && define.packaged);
|
||||
|
||||
if (!global.document)
|
||||
return "";
|
||||
|
|
@ -153,7 +152,11 @@ exports.init = function() {
|
|||
var scriptOptions = {};
|
||||
var scriptUrl = "";
|
||||
|
||||
var scripts = document.getElementsByTagName("script");
|
||||
// Use currentScript.ownerDocument in case this file was loaded from imported document. (HTML Imports)
|
||||
var currentScript = (document.currentScript || document._currentScript ); // native or polyfill
|
||||
var currentDocument = currentScript && currentScript.ownerDocument || document;
|
||||
|
||||
var scripts = currentDocument.getElementsByTagName("script");
|
||||
for (var i=0; i<scripts.length; i++) {
|
||||
var script = scripts[i];
|
||||
|
||||
|
|
@ -190,106 +193,10 @@ exports.init = function() {
|
|||
exports.set(key, scriptOptions[key]);
|
||||
};
|
||||
|
||||
exports.init = init;
|
||||
|
||||
function deHyphenate(str) {
|
||||
return str.replace(/-(.)/g, function(m, m1) { return m1.toUpperCase(); });
|
||||
}
|
||||
|
||||
var optionsProvider = {
|
||||
setOptions: function(optList) {
|
||||
Object.keys(optList).forEach(function(key) {
|
||||
this.setOption(key, optList[key]);
|
||||
}, this);
|
||||
},
|
||||
getOptions: function(optionNames) {
|
||||
var result = {};
|
||||
if (!optionNames) {
|
||||
optionNames = Object.keys(this.$options);
|
||||
} else if (!Array.isArray(optionNames)) {
|
||||
result = optionNames;
|
||||
optionNames = Object.keys(result);
|
||||
}
|
||||
optionNames.forEach(function(key) {
|
||||
result[key] = this.getOption(key);
|
||||
}, this);
|
||||
return result;
|
||||
},
|
||||
setOption: function(name, value) {
|
||||
if (this["$" + name] === value)
|
||||
return;
|
||||
var opt = this.$options[name];
|
||||
if (!opt) {
|
||||
if (typeof console != "undefined" && console.warn)
|
||||
console.warn('misspelled option "' + name + '"');
|
||||
return undefined;
|
||||
}
|
||||
if (opt.forwardTo)
|
||||
return this[opt.forwardTo] && this[opt.forwardTo].setOption(name, value);
|
||||
|
||||
if (!opt.handlesSet)
|
||||
this["$" + name] = value;
|
||||
if (opt && opt.set)
|
||||
opt.set.call(this, value);
|
||||
},
|
||||
getOption: function(name) {
|
||||
var opt = this.$options[name];
|
||||
if (!opt) {
|
||||
if (typeof console != "undefined" && console.warn)
|
||||
console.warn('misspelled option "' + name + '"');
|
||||
return undefined;
|
||||
}
|
||||
if (opt.forwardTo)
|
||||
return this[opt.forwardTo] && this[opt.forwardTo].getOption(name);
|
||||
return opt && opt.get ? opt.get.call(this) : this["$" + name];
|
||||
}
|
||||
};
|
||||
|
||||
var defaultOptions = {};
|
||||
/*
|
||||
* option {name, value, initialValue, setterName, set, get }
|
||||
*/
|
||||
exports.defineOptions = function(obj, path, options) {
|
||||
if (!obj.$options)
|
||||
defaultOptions[path] = obj.$options = {};
|
||||
|
||||
Object.keys(options).forEach(function(key) {
|
||||
var opt = options[key];
|
||||
if (typeof opt == "string")
|
||||
opt = {forwardTo: opt};
|
||||
|
||||
opt.name || (opt.name = key);
|
||||
obj.$options[opt.name] = opt;
|
||||
if ("initialValue" in opt)
|
||||
obj["$" + opt.name] = opt.initialValue;
|
||||
});
|
||||
|
||||
// implement option provider interface
|
||||
oop.implement(obj, optionsProvider);
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
exports.resetOptions = function(obj) {
|
||||
Object.keys(obj.$options).forEach(function(key) {
|
||||
var opt = obj.$options[key];
|
||||
if ("value" in opt)
|
||||
obj.setOption(key, opt.value);
|
||||
});
|
||||
};
|
||||
|
||||
exports.setDefaultValue = function(path, name, value) {
|
||||
var opts = defaultOptions[path] || (defaultOptions[path] = {});
|
||||
if (opts[name]) {
|
||||
if (opts.forwardTo)
|
||||
exports.setDefaultValue(opts.forwardTo, name, value);
|
||||
else
|
||||
opts[name].value = value;
|
||||
}
|
||||
};
|
||||
|
||||
exports.setDefaultValues = function(path, optionHash) {
|
||||
Object.keys(optionHash).forEach(function(key) {
|
||||
exports.setDefaultValue(path, key, optionHash[key]);
|
||||
});
|
||||
};
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ module.exports = {
|
|||
"test: path resolution" : function() {
|
||||
config.set("packaged", "true");
|
||||
var url = config.moduleUrl("kr_theme", "theme");
|
||||
assert.equal(url, "theme-kr.js");
|
||||
assert.equal(url, "theme-kr_theme.js");
|
||||
|
||||
config.set("basePath", "a/b");
|
||||
url = config.moduleUrl("m/theme", "theme");
|
||||
|
|
@ -117,12 +117,19 @@ module.exports = {
|
|||
assert.equal(o.getOption("initialValue"), 8);
|
||||
o.setOption("initialValue", 7);
|
||||
assert.equal(o.getOption("opt2"), 7);
|
||||
|
||||
|
||||
config.setDefaultValues("test_object", {
|
||||
opt1: 1,
|
||||
forwarded: 2
|
||||
});
|
||||
config.resetOptions(o);
|
||||
assert.equal(o.getOption("opt1"), 1);
|
||||
assert.equal(o.getOption("forwarded"), 2);
|
||||
}
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec()
|
||||
require("asyncjs").test.testcase(module.exports).exec();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,8 @@
|
|||
.ace_editor {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
|
||||
font-size: 12px;
|
||||
line-height: normal;
|
||||
color: black;
|
||||
-ms-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
font: 12px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
.ace_scroller {
|
||||
|
|
@ -17,6 +11,11 @@
|
|||
top: 0;
|
||||
bottom: 0;
|
||||
background-color: inherit;
|
||||
-ms-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
cursor: text;
|
||||
}
|
||||
|
||||
.ace_content {
|
||||
|
|
@ -24,11 +23,7 @@
|
|||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
cursor: text;
|
||||
}
|
||||
|
||||
.ace_dragging, .ace_dragging * {
|
||||
cursor: move !important;
|
||||
min-width: 100%;
|
||||
}
|
||||
|
||||
.ace_dragging .ace_scroller:before{
|
||||
|
|
@ -58,6 +53,10 @@
|
|||
left: 0;
|
||||
cursor: default;
|
||||
z-index: 4;
|
||||
-ms-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.ace_gutter-active-line {
|
||||
|
|
@ -77,30 +76,27 @@
|
|||
}
|
||||
|
||||
.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-position: 2px center;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
.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 {
|
||||
position: absolute;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
z-index: 6;
|
||||
}
|
||||
|
|
@ -112,14 +108,16 @@
|
|||
top: 0;
|
||||
}
|
||||
|
||||
.ace_scrollbar-v{
|
||||
overflow-x: hidden;
|
||||
overflow-y: scroll;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.ace_scrollbar-h {
|
||||
position: absolute;
|
||||
overflow-x: auto;
|
||||
overflow-x: scroll;
|
||||
overflow-y: hidden;
|
||||
right: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
z-index: 6;
|
||||
}
|
||||
|
||||
.ace_print-margin {
|
||||
|
|
@ -151,8 +149,8 @@
|
|||
}
|
||||
|
||||
.ace_text-input.ace_composition {
|
||||
background: #f8f8f8;
|
||||
color: #111;
|
||||
background: inherit;
|
||||
color: inherit;
|
||||
z-index: 1000;
|
||||
opacity: 1;
|
||||
text-indent: 0;
|
||||
|
|
@ -162,6 +160,8 @@
|
|||
z-index: 1;
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
/* workaround for chrome bug https://github.com/ajaxorg/ace/issues/2312*/
|
||||
word-wrap: normal;
|
||||
white-space: pre;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
|
|
@ -207,7 +207,7 @@
|
|||
}
|
||||
|
||||
.ace_overwrite-cursors .ace_cursor {
|
||||
border-left-width: 0px;
|
||||
border-left-width: 0;
|
||||
border-bottom: 1px solid;
|
||||
}
|
||||
|
||||
|
|
@ -216,17 +216,10 @@
|
|||
}
|
||||
|
||||
.ace_smooth-blinking .ace_cursor {
|
||||
-moz-transition: opacity 0.18s;
|
||||
-webkit-transition: opacity 0.18s;
|
||||
-o-transition: opacity 0.18s;
|
||||
-ms-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 {
|
||||
border-left-width: 1px;
|
||||
}
|
||||
|
|
@ -270,15 +263,13 @@
|
|||
vertical-align: middle;
|
||||
|
||||
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,%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,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),
|
||||
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");
|
||||
background-repeat: no-repeat, repeat-x;
|
||||
background-position: center center, top left;
|
||||
color: transparent;
|
||||
|
||||
border: 1px solid black;
|
||||
-moz-border-radius: 2px;
|
||||
-webkit-border-radius: 2px;
|
||||
border-radius: 2px;
|
||||
|
||||
cursor: pointer;
|
||||
|
|
@ -290,13 +281,11 @@
|
|||
|
||||
.ace_fold:hover{
|
||||
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,%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");
|
||||
background-repeat: no-repeat, repeat-x;
|
||||
background-position: center center, top left;
|
||||
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),
|
||||
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");
|
||||
}
|
||||
|
||||
.ace_gutter-tooltip {
|
||||
.ace_tooltip {
|
||||
background-color: #FFF;
|
||||
background-image: -webkit-linear-gradient(top, transparent, rgba(0, 0, 0, 0.1));
|
||||
background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));
|
||||
|
|
@ -304,21 +293,21 @@
|
|||
border-radius: 1px;
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
|
||||
color: black;
|
||||
display: inline-block;
|
||||
max-width: 500px;
|
||||
padding: 4px;
|
||||
max-width: 100%;
|
||||
padding: 3px 4px;
|
||||
position: fixed;
|
||||
z-index: 999999;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
cursor: default;
|
||||
white-space: pre-line;
|
||||
white-space: pre;
|
||||
word-wrap: break-word;
|
||||
line-height: normal;
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
letter-spacing: normal;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.ace_folding-enabled > .ace_gutter-cell {
|
||||
|
|
@ -335,7 +324,7 @@
|
|||
width: 11px;
|
||||
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-position: center;
|
||||
|
||||
|
|
@ -350,26 +339,22 @@
|
|||
}
|
||||
|
||||
.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 {
|
||||
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 {
|
||||
border: 1px solid rgba(0, 0, 0, 0.3);
|
||||
background-color: rgba(255, 255, 255, 0.2);
|
||||
-moz-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
|
||||
-webkit-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
|
||||
box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
|
||||
}
|
||||
|
||||
.ace_fold-widget:active {
|
||||
border: 1px solid rgba(0, 0, 0, 0.4);
|
||||
background-color: rgba(0, 0, 0, 0.05);
|
||||
-moz-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
|
||||
-webkit-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
|
||||
box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
/**
|
||||
|
|
@ -389,8 +374,6 @@
|
|||
background-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
.ace_dark .ace_fold-widget:active {
|
||||
-moz-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
|
||||
-webkit-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
|
||||
box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
|
|
@ -400,19 +383,13 @@
|
|||
}
|
||||
|
||||
.ace_fade-fold-widgets .ace_fold-widget {
|
||||
-moz-transition: opacity 0.4s ease 0.05s;
|
||||
-webkit-transition: opacity 0.4s ease 0.05s;
|
||||
-o-transition: opacity 0.4s ease 0.05s;
|
||||
-ms-transition: opacity 0.4s ease 0.05s;
|
||||
transition: opacity 0.4s ease 0.05s;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.ace_fade-fold-widgets:hover .ace_fold-widget {
|
||||
-moz-transition: opacity 0.05s ease 0.05s;
|
||||
-webkit-transition: opacity 0.05s ease 0.05s;
|
||||
-o-transition: opacity 0.05s ease 0.05s;
|
||||
-ms-transition: opacity 0.05s ease 0.05s;
|
||||
transition: opacity 0.05s ease 0.05s;
|
||||
opacity:1;
|
||||
}
|
||||
|
|
@ -445,3 +422,30 @@
|
|||
position: absolute;
|
||||
z-index: 8;
|
||||
}
|
||||
|
||||
/*
|
||||
styles = []
|
||||
for (var i = 1; i < 16; i++) {
|
||||
styles.push(".ace_br" + i + "{" + (
|
||||
["top-left", "top-right", "bottom-right", "bottom-left"]
|
||||
).map(function(x, j) {
|
||||
return i & (1<<j) ? "border-" + x + "-radius: 3px;" : ""
|
||||
}).filter(Boolean).join(" ") + "}")
|
||||
}
|
||||
styles.join("\n")
|
||||
*/
|
||||
.ace_br1 {border-top-left-radius : 3px;}
|
||||
.ace_br2 {border-top-right-radius : 3px;}
|
||||
.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}
|
||||
.ace_br4 {border-bottom-right-radius: 3px;}
|
||||
.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}
|
||||
.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}
|
||||
.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}
|
||||
.ace_br8 {border-bottom-left-radius : 3px;}
|
||||
.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}
|
||||
.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}
|
||||
.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}
|
||||
.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
|
||||
.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
|
||||
.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
|
||||
.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
|
||||
|
|
|
|||
|
|
@ -32,36 +32,36 @@ define(function(require, exports, module) {
|
|||
"use strict";
|
||||
|
||||
var oop = require("./lib/oop");
|
||||
var applyDelta = require("./apply_delta").applyDelta;
|
||||
var EventEmitter = require("./lib/event_emitter").EventEmitter;
|
||||
var Range = require("./range").Range;
|
||||
var Anchor = require("./anchor").Anchor;
|
||||
|
||||
/**
|
||||
* Contains the text of the document. Document can be attached to several [[EditSession `EditSession`]]s.
|
||||
*
|
||||
* At its core, `Document`s are just an array of strings, with each row in the document matching up to the array index.
|
||||
*
|
||||
* @class Document
|
||||
**/
|
||||
|
||||
/**
|
||||
/**
|
||||
*
|
||||
* Creates a new `Document`. If `text` is included, the `Document` contains those strings; otherwise, it's empty.
|
||||
* @param {String | Array} text The starting text
|
||||
* @constructor
|
||||
**/
|
||||
|
||||
var Document = function(text) {
|
||||
this.$lines = [];
|
||||
var Document = function(textOrLines) {
|
||||
this.$lines = [""];
|
||||
|
||||
// There has to be one line at least in the document. If you pass an empty
|
||||
// string to the insert function, nothing will happen. Workaround.
|
||||
if (text.length == 0) {
|
||||
if (textOrLines.length === 0) {
|
||||
this.$lines = [""];
|
||||
} else if (Array.isArray(text)) {
|
||||
this._insertLines(0, text);
|
||||
} else if (Array.isArray(textOrLines)) {
|
||||
this.insertMergedLines({row: 0, column: 0}, textOrLines);
|
||||
} else {
|
||||
this.insert({row: 0, column:0}, text);
|
||||
this.insert({row: 0, column:0}, textOrLines);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -75,9 +75,9 @@ var Document = function(text) {
|
|||
* @param {String} text The text to use
|
||||
**/
|
||||
this.setValue = function(text) {
|
||||
var len = this.getLength();
|
||||
this.remove(new Range(0, 0, len, this.getLine(len-1).length));
|
||||
this.insert({row: 0, column:0}, text);
|
||||
var len = this.getLength() - 1;
|
||||
this.remove(new Range(0, 0, len, this.getLine(len).length));
|
||||
this.insert({row: 0, column: 0}, text);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -98,7 +98,7 @@ var Document = function(text) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Splits a string of text on any newline (`\n`) or carriage-return ('\r') characters.
|
||||
* Splits a string of text on any newline (`\n`) or carriage-return (`\r`) characters.
|
||||
*
|
||||
* @method $split
|
||||
* @param {String} text The text to work with
|
||||
|
|
@ -107,19 +107,21 @@ var Document = function(text) {
|
|||
**/
|
||||
|
||||
// check for IE split bug
|
||||
if ("aaa".split(/a/).length == 0)
|
||||
if ("aaa".split(/a/).length === 0) {
|
||||
this.$split = function(text) {
|
||||
return text.replace(/\r\n|\r/g, "\n").split("\n");
|
||||
}
|
||||
else
|
||||
};
|
||||
} else {
|
||||
this.$split = function(text) {
|
||||
return text.split(/\r\n|\r|\n/);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
this.$detectNewLine = function(text) {
|
||||
var match = text.match(/^.*?(\r\n|\r|\n)/m);
|
||||
this.$autoNewLine = match ? match[1] : "\n";
|
||||
this._signal("changeNewLineMode");
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -136,11 +138,11 @@ var Document = function(text) {
|
|||
case "unix":
|
||||
return "\n";
|
||||
default:
|
||||
return this.$autoNewLine;
|
||||
return this.$autoNewLine || "\n";
|
||||
}
|
||||
};
|
||||
|
||||
this.$autoNewLine = "\n";
|
||||
this.$autoNewLine = "";
|
||||
this.$newLineMode = "auto";
|
||||
/**
|
||||
* [Sets the new line mode.]{: #Document.setNewLineMode.desc}
|
||||
|
|
@ -152,6 +154,7 @@ var Document = function(text) {
|
|||
return;
|
||||
|
||||
this.$newLineMode = newLineMode;
|
||||
this._signal("changeNewLineMode");
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -205,32 +208,49 @@ var Document = function(text) {
|
|||
};
|
||||
|
||||
/**
|
||||
* [Given a range within the document, this function returns all the text within that range as a single string.]{: #Document.getTextRange.desc}
|
||||
* @param {Range} range The range to work with
|
||||
* Returns all the text within `range` as a single string.
|
||||
* @param {Range} range The range to work with.
|
||||
*
|
||||
* @returns {String}
|
||||
**/
|
||||
this.getTextRange = function(range) {
|
||||
if (range.start.row == range.end.row) {
|
||||
return this.getLine(range.start.row)
|
||||
.substring(range.start.column, range.end.column);
|
||||
return this.getLinesForRange(range).join(this.getNewLineCharacter());
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns all the text within `range` as an array of lines.
|
||||
* @param {Range} range The range to work with.
|
||||
*
|
||||
* @returns {Array}
|
||||
**/
|
||||
this.getLinesForRange = function(range) {
|
||||
var lines;
|
||||
if (range.start.row === range.end.row) {
|
||||
// Handle a single-line range.
|
||||
lines = [this.getLine(range.start.row).substring(range.start.column, range.end.column)];
|
||||
} else {
|
||||
// Handle a multi-line range.
|
||||
lines = this.getLines(range.start.row, range.end.row);
|
||||
lines[0] = (lines[0] || "").substring(range.start.column);
|
||||
var l = lines.length - 1;
|
||||
if (range.end.row - range.start.row == l)
|
||||
lines[l] = lines[l].substring(0, range.end.column);
|
||||
}
|
||||
var lines = this.getLines(range.start.row, range.end.row);
|
||||
lines[0] = (lines[0] || "").substring(range.start.column);
|
||||
var l = lines.length - 1;
|
||||
if (range.end.row - range.start.row == l)
|
||||
lines[l] = lines[l].substring(0, range.end.column);
|
||||
return lines.join(this.getNewLineCharacter());
|
||||
return lines;
|
||||
};
|
||||
|
||||
this.$clipPosition = function(position) {
|
||||
var length = this.getLength();
|
||||
if (position.row >= length) {
|
||||
position.row = Math.max(0, length - 1);
|
||||
position.column = this.getLine(length-1).length;
|
||||
} else if (position.row < 0)
|
||||
position.row = 0;
|
||||
return position;
|
||||
// Deprecated methods retained for backwards compatibility.
|
||||
this.insertLines = function(row, lines) {
|
||||
console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead.");
|
||||
return this.insertFullLines(row, lines);
|
||||
};
|
||||
this.removeLines = function(firstRow, lastRow) {
|
||||
console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead.");
|
||||
return this.removeFullLines(firstRow, lastRow);
|
||||
};
|
||||
this.insertNewLine = function(position) {
|
||||
console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, [\'\', \'\']) instead.");
|
||||
return this.insertMergedLines(position, ["", ""]);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -241,53 +261,97 @@ var Document = function(text) {
|
|||
*
|
||||
**/
|
||||
this.insert = function(position, text) {
|
||||
if (!text || text.length === 0)
|
||||
return position;
|
||||
|
||||
position = this.$clipPosition(position);
|
||||
|
||||
// only detect new lines if the document has no line break yet
|
||||
// Only detect new lines if the document has no line break yet.
|
||||
if (this.getLength() <= 1)
|
||||
this.$detectNewLine(text);
|
||||
|
||||
var lines = this.$split(text);
|
||||
var firstLine = lines.splice(0, 1)[0];
|
||||
var lastLine = lines.length == 0 ? null : lines.splice(lines.length - 1, 1)[0];
|
||||
|
||||
position = this.insertInLine(position, firstLine);
|
||||
if (lastLine !== null) {
|
||||
position = this.insertNewLine(position); // terminate first line
|
||||
position = this._insertLines(position.row, lines);
|
||||
position = this.insertInLine(position, lastLine || "");
|
||||
|
||||
return this.insertMergedLines(position, this.$split(text));
|
||||
};
|
||||
|
||||
/**
|
||||
* Inserts `text` into the `position` at the current row. This method also triggers the `"change"` event.
|
||||
*
|
||||
* This differs from the `insert` method in two ways:
|
||||
* 1. This does NOT handle newline characters (single-line text only).
|
||||
* 2. This is faster than the `insert` method for single-line text insertions.
|
||||
*
|
||||
* @param {Object} position The position to insert at; it's an object that looks like `{ row: row, column: column}`
|
||||
* @param {String} text A chunk of text
|
||||
* @returns {Object} Returns an object containing the final row and column, like this:
|
||||
* ```
|
||||
* {row: endRow, column: 0}
|
||||
* ```
|
||||
**/
|
||||
this.insertInLine = function(position, text) {
|
||||
var start = this.clippedPos(position.row, position.column);
|
||||
var end = this.pos(position.row, position.column + text.length);
|
||||
|
||||
this.applyDelta({
|
||||
start: start,
|
||||
end: end,
|
||||
action: "insert",
|
||||
lines: [text]
|
||||
}, true);
|
||||
|
||||
return this.clonePos(end);
|
||||
};
|
||||
|
||||
this.clippedPos = function(row, column) {
|
||||
var length = this.getLength();
|
||||
if (row === undefined) {
|
||||
row = length;
|
||||
} else if (row < 0) {
|
||||
row = 0;
|
||||
} else if (row >= length) {
|
||||
row = length - 1;
|
||||
column = undefined;
|
||||
}
|
||||
var line = this.getLine(row);
|
||||
if (column == undefined)
|
||||
column = line.length;
|
||||
column = Math.min(Math.max(column, 0), line.length);
|
||||
return {row: row, column: column};
|
||||
};
|
||||
|
||||
this.clonePos = function(pos) {
|
||||
return {row: pos.row, column: pos.column};
|
||||
};
|
||||
|
||||
this.pos = function(row, column) {
|
||||
return {row: row, column: column};
|
||||
};
|
||||
|
||||
this.$clipPosition = function(position) {
|
||||
var length = this.getLength();
|
||||
if (position.row >= length) {
|
||||
position.row = Math.max(0, length - 1);
|
||||
position.column = this.getLine(length - 1).length;
|
||||
} else {
|
||||
position.row = Math.max(0, position.row);
|
||||
position.column = Math.min(Math.max(position.column, 0), this.getLine(position.row).length);
|
||||
}
|
||||
return position;
|
||||
};
|
||||
|
||||
/**
|
||||
* Fires whenever the document changes.
|
||||
*
|
||||
* Several methods trigger different `"change"` events. Below is a list of each action type, followed by each property that's also available:
|
||||
*
|
||||
* * `"insertLines"` (emitted by [[Document.insertLines]])
|
||||
* * `range`: the [[Range]] of the change within the document
|
||||
* * `lines`: the lines in the document that are changing
|
||||
* * `"insertText"` (emitted by [[Document.insertNewLine]])
|
||||
* * `range`: the [[Range]] of the change within the document
|
||||
* * `text`: the text that's being added
|
||||
* * `"removeLines"` (emitted by [[Document.insertLines]])
|
||||
* * `range`: the [[Range]] of the change within the document
|
||||
* * `lines`: the lines in the document that were removed
|
||||
* * `nl`: the new line character (as defined by [[Document.getNewLineCharacter]])
|
||||
* * `"removeText"` (emitted by [[Document.removeInLine]] and [[Document.removeNewLine]])
|
||||
* * `range`: the [[Range]] of the change within the document
|
||||
* * `text`: the text that's being removed
|
||||
*
|
||||
* @event change
|
||||
* @param {Object} e Contains at least one property called `"action"`. `"action"` indicates the action that triggered the change. Each action also has a set of additional properties.
|
||||
*
|
||||
**/
|
||||
* Fires whenever the document changes.
|
||||
*
|
||||
* Several methods trigger different `"change"` events. Below is a list of each action type, followed by each property that's also available:
|
||||
*
|
||||
* * `"insert"`
|
||||
* * `range`: the [[Range]] of the change within the document
|
||||
* * `lines`: the lines being added
|
||||
* * `"remove"`
|
||||
* * `range`: the [[Range]] of the change within the document
|
||||
* * `lines`: the lines being removed
|
||||
*
|
||||
* @event change
|
||||
* @param {Object} e Contains at least one property called `"action"`. `"action"` indicates the action that triggered the change. Each action also has a set of additional properties.
|
||||
*
|
||||
**/
|
||||
|
||||
/**
|
||||
* Inserts the elements in `lines` into the document, starting at the row index given by `row`. This method also triggers the `'change'` event.
|
||||
* Inserts the elements in `lines` into the document as full lines (does not merge with existing line), starting at the row index given by `row`. This method also triggers the `"change"` event.
|
||||
* @param {Number} row The index of the row to insert at
|
||||
* @param {Array} lines An array of strings
|
||||
* @returns {Object} Contains the final row and column, like this:
|
||||
|
|
@ -300,99 +364,57 @@ var Document = function(text) {
|
|||
* ```
|
||||
*
|
||||
**/
|
||||
this.insertLines = function(row, lines) {
|
||||
if (row >= this.getLength())
|
||||
return this.insert({row: row, column: 0}, "\n" + lines.join("\n"));
|
||||
return this._insertLines(Math.max(row, 0), lines);
|
||||
};
|
||||
this._insertLines = function(row, lines) {
|
||||
if (lines.length == 0)
|
||||
return {row: row, column: 0};
|
||||
|
||||
// apply doesn't work for big arrays (smallest threshold is on safari 0xFFFF)
|
||||
// to circumvent that we have to break huge inserts into smaller chunks here
|
||||
if (lines.length > 0xFFFF) {
|
||||
var end = this._insertLines(row, lines.slice(0xFFFF));
|
||||
lines = lines.slice(0, 0xFFFF);
|
||||
this.insertFullLines = function(row, lines) {
|
||||
// Clip to document.
|
||||
// Allow one past the document end.
|
||||
row = Math.min(Math.max(row, 0), this.getLength());
|
||||
|
||||
// Calculate insertion point.
|
||||
var column = 0;
|
||||
if (row < this.getLength()) {
|
||||
// Insert before the specified row.
|
||||
lines = lines.concat([""]);
|
||||
column = 0;
|
||||
} else {
|
||||
// Insert after the last row in the document.
|
||||
lines = [""].concat(lines);
|
||||
row--;
|
||||
column = this.$lines[row].length;
|
||||
}
|
||||
|
||||
// Insert.
|
||||
this.insertMergedLines({row: row, column: column}, lines);
|
||||
};
|
||||
|
||||
var args = [row, 0];
|
||||
args.push.apply(args, lines);
|
||||
this.$lines.splice.apply(this.$lines, args);
|
||||
|
||||
var range = new Range(row, 0, row + lines.length, 0);
|
||||
var delta = {
|
||||
action: "insertLines",
|
||||
range: range,
|
||||
/**
|
||||
* Inserts the elements in `lines` into the document, starting at the position index given by `row`. This method also triggers the `"change"` event.
|
||||
* @param {Number} row The index of the row to insert at
|
||||
* @param {Array} lines An array of strings
|
||||
* @returns {Object} Contains the final row and column, like this:
|
||||
* ```
|
||||
* {row: endRow, column: 0}
|
||||
* ```
|
||||
* If `lines` is empty, this function returns an object containing the current row, and column, like this:
|
||||
* ```
|
||||
* {row: row, column: 0}
|
||||
* ```
|
||||
*
|
||||
**/
|
||||
this.insertMergedLines = function(position, lines) {
|
||||
var start = this.clippedPos(position.row, position.column);
|
||||
var end = {
|
||||
row: start.row + lines.length - 1,
|
||||
column: (lines.length == 1 ? start.column : 0) + lines[lines.length - 1].length
|
||||
};
|
||||
|
||||
this.applyDelta({
|
||||
start: start,
|
||||
end: end,
|
||||
action: "insert",
|
||||
lines: lines
|
||||
};
|
||||
this._emit("change", { data: delta });
|
||||
return end || range.end;
|
||||
};
|
||||
|
||||
/**
|
||||
* Inserts a new line into the document at the current row's `position`. This method also triggers the `'change'` event.
|
||||
* @param {Object} position The position to insert at
|
||||
* @returns {Object} Returns an object containing the final row and column, like this:<br/>
|
||||
* ```
|
||||
* {row: endRow, column: 0}
|
||||
* ```
|
||||
*
|
||||
**/
|
||||
this.insertNewLine = function(position) {
|
||||
position = this.$clipPosition(position);
|
||||
var line = this.$lines[position.row] || "";
|
||||
|
||||
this.$lines[position.row] = line.substring(0, position.column);
|
||||
this.$lines.splice(position.row + 1, 0, line.substring(position.column, line.length));
|
||||
|
||||
var end = {
|
||||
row : position.row + 1,
|
||||
column : 0
|
||||
};
|
||||
|
||||
var delta = {
|
||||
action: "insertText",
|
||||
range: Range.fromPoints(position, end),
|
||||
text: this.getNewLineCharacter()
|
||||
};
|
||||
this._emit("change", { data: delta });
|
||||
|
||||
return end;
|
||||
};
|
||||
|
||||
/**
|
||||
* Inserts `text` into the `position` at the current row. This method also triggers the `'change'` event.
|
||||
* @param {Object} position The position to insert at; it's an object that looks like `{ row: row, column: column}`
|
||||
* @param {String} text A chunk of text
|
||||
* @returns {Object} Returns an object containing the final row and column, like this:
|
||||
* ```
|
||||
* {row: endRow, column: 0}
|
||||
* ```
|
||||
*
|
||||
**/
|
||||
this.insertInLine = function(position, text) {
|
||||
if (text.length == 0)
|
||||
return position;
|
||||
|
||||
var line = this.$lines[position.row] || "";
|
||||
|
||||
this.$lines[position.row] = line.substring(0, position.column) + text
|
||||
+ line.substring(position.column);
|
||||
|
||||
var end = {
|
||||
row : position.row,
|
||||
column : position.column + text.length
|
||||
};
|
||||
|
||||
var delta = {
|
||||
action: "insertText",
|
||||
range: Range.fromPoints(position, end),
|
||||
text: text
|
||||
};
|
||||
this._emit("change", { data: delta });
|
||||
|
||||
return end;
|
||||
});
|
||||
|
||||
return this.clonePos(end);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -402,113 +424,90 @@ var Document = function(text) {
|
|||
*
|
||||
**/
|
||||
this.remove = function(range) {
|
||||
if (!range instanceof Range)
|
||||
range = Range.fromPoints(range.start, range.end);
|
||||
// clip to document
|
||||
range.start = this.$clipPosition(range.start);
|
||||
range.end = this.$clipPosition(range.end);
|
||||
|
||||
if (range.isEmpty())
|
||||
return range.start;
|
||||
|
||||
var firstRow = range.start.row;
|
||||
var lastRow = range.end.row;
|
||||
|
||||
if (range.isMultiLine()) {
|
||||
var firstFullRow = range.start.column == 0 ? firstRow : firstRow + 1;
|
||||
var lastFullRow = lastRow - 1;
|
||||
|
||||
if (range.end.column > 0)
|
||||
this.removeInLine(lastRow, 0, range.end.column);
|
||||
|
||||
if (lastFullRow >= firstFullRow)
|
||||
this._removeLines(firstFullRow, lastFullRow);
|
||||
|
||||
if (firstFullRow != firstRow) {
|
||||
this.removeInLine(firstRow, range.start.column, this.getLine(firstRow).length);
|
||||
this.removeNewLine(range.start.row);
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.removeInLine(firstRow, range.start.column, range.end.column);
|
||||
}
|
||||
return range.start;
|
||||
var start = this.clippedPos(range.start.row, range.start.column);
|
||||
var end = this.clippedPos(range.end.row, range.end.column);
|
||||
this.applyDelta({
|
||||
start: start,
|
||||
end: end,
|
||||
action: "remove",
|
||||
lines: this.getLinesForRange({start: start, end: end})
|
||||
});
|
||||
return this.clonePos(start);
|
||||
};
|
||||
|
||||
/**
|
||||
* Removes the specified columns from the `row`. This method also triggers the `'change'` event.
|
||||
* @param {Number} row The row to remove from
|
||||
* @param {Number} startColumn The column to start removing at
|
||||
* @param {Number} endColumn The column to stop removing at
|
||||
* @returns {Object} Returns an object containing `startRow` and `startColumn`, indicating the new row and column values.<br/>If `startColumn` is equal to `endColumn`, this function returns nothing.
|
||||
*
|
||||
**/
|
||||
* Removes the specified columns from the `row`. This method also triggers a `"change"` event.
|
||||
* @param {Number} row The row to remove from
|
||||
* @param {Number} startColumn The column to start removing at
|
||||
* @param {Number} endColumn The column to stop removing at
|
||||
* @returns {Object} Returns an object containing `startRow` and `startColumn`, indicating the new row and column values.<br/>If `startColumn` is equal to `endColumn`, this function returns nothing.
|
||||
*
|
||||
**/
|
||||
this.removeInLine = function(row, startColumn, endColumn) {
|
||||
if (startColumn == endColumn)
|
||||
return;
|
||||
|
||||
var range = new Range(row, startColumn, row, endColumn);
|
||||
var line = this.getLine(row);
|
||||
var removed = line.substring(startColumn, endColumn);
|
||||
var newLine = line.substring(0, startColumn) + line.substring(endColumn, line.length);
|
||||
this.$lines.splice(row, 1, newLine);
|
||||
|
||||
var delta = {
|
||||
action: "removeText",
|
||||
range: range,
|
||||
text: removed
|
||||
};
|
||||
this._emit("change", { data: delta });
|
||||
return range.start;
|
||||
var start = this.clippedPos(row, startColumn);
|
||||
var end = this.clippedPos(row, endColumn);
|
||||
|
||||
this.applyDelta({
|
||||
start: start,
|
||||
end: end,
|
||||
action: "remove",
|
||||
lines: this.getLinesForRange({start: start, end: end})
|
||||
}, true);
|
||||
|
||||
return this.clonePos(start);
|
||||
};
|
||||
|
||||
/**
|
||||
* Removes a range of full lines. This method also triggers the `'change'` event.
|
||||
* Removes a range of full lines. This method also triggers the `"change"` event.
|
||||
* @param {Number} firstRow The first row to be removed
|
||||
* @param {Number} lastRow The last row to be removed
|
||||
* @returns {[String]} Returns all the removed lines.
|
||||
*
|
||||
**/
|
||||
this.removeLines = function(firstRow, lastRow) {
|
||||
if (firstRow < 0 || lastRow >= this.getLength())
|
||||
return this.remove(new Range(firstRow, 0, lastRow + 1, 0));
|
||||
return this._removeLines(firstRow, lastRow);
|
||||
};
|
||||
|
||||
this._removeLines = function(firstRow, lastRow) {
|
||||
var range = new Range(firstRow, 0, lastRow + 1, 0);
|
||||
var removed = this.$lines.splice(firstRow, lastRow - firstRow + 1);
|
||||
|
||||
var delta = {
|
||||
action: "removeLines",
|
||||
range: range,
|
||||
nl: this.getNewLineCharacter(),
|
||||
lines: removed
|
||||
};
|
||||
this._emit("change", { data: delta });
|
||||
return removed;
|
||||
this.removeFullLines = function(firstRow, lastRow) {
|
||||
// Clip to document.
|
||||
firstRow = Math.min(Math.max(0, firstRow), this.getLength() - 1);
|
||||
lastRow = Math.min(Math.max(0, lastRow ), this.getLength() - 1);
|
||||
|
||||
// Calculate deletion range.
|
||||
// Delete the ending new line unless we're at the end of the document.
|
||||
// If we're at the end of the document, delete the starting new line.
|
||||
var deleteFirstNewLine = lastRow == this.getLength() - 1 && firstRow > 0;
|
||||
var deleteLastNewLine = lastRow < this.getLength() - 1;
|
||||
var startRow = ( deleteFirstNewLine ? firstRow - 1 : firstRow );
|
||||
var startCol = ( deleteFirstNewLine ? this.getLine(startRow).length : 0 );
|
||||
var endRow = ( deleteLastNewLine ? lastRow + 1 : lastRow );
|
||||
var endCol = ( deleteLastNewLine ? 0 : this.getLine(endRow).length );
|
||||
var range = new Range(startRow, startCol, endRow, endCol);
|
||||
|
||||
// Store delelted lines with bounding newlines ommitted (maintains previous behavior).
|
||||
var deletedLines = this.$lines.slice(firstRow, lastRow + 1);
|
||||
|
||||
this.applyDelta({
|
||||
start: range.start,
|
||||
end: range.end,
|
||||
action: "remove",
|
||||
lines: this.getLinesForRange(range)
|
||||
});
|
||||
|
||||
// Return the deleted lines.
|
||||
return deletedLines;
|
||||
};
|
||||
|
||||
/**
|
||||
* Removes the new line between `row` and the row immediately following it. This method also triggers the `'change'` event.
|
||||
* Removes the new line between `row` and the row immediately following it. This method also triggers the `"change"` event.
|
||||
* @param {Number} row The row to check
|
||||
*
|
||||
**/
|
||||
this.removeNewLine = function(row) {
|
||||
var firstLine = this.getLine(row);
|
||||
var secondLine = this.getLine(row+1);
|
||||
|
||||
var range = new Range(row, firstLine.length, row+1, 0);
|
||||
var line = firstLine + secondLine;
|
||||
|
||||
this.$lines.splice(row, 2, line);
|
||||
|
||||
var delta = {
|
||||
action: "removeText",
|
||||
range: range,
|
||||
text: this.getNewLineCharacter()
|
||||
};
|
||||
this._emit("change", { data: delta });
|
||||
if (row < this.getLength() - 1 && row >= 0) {
|
||||
this.applyDelta({
|
||||
start: this.pos(row, this.getLine(row).length),
|
||||
end: this.pos(row + 1, 0),
|
||||
action: "remove",
|
||||
lines: ["", ""]
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -524,7 +523,7 @@ var Document = function(text) {
|
|||
this.replace = function(range, text) {
|
||||
if (!range instanceof Range)
|
||||
range = Range.fromPoints(range.start, range.end);
|
||||
if (text.length == 0 && range.isEmpty())
|
||||
if (text.length === 0 && range.isEmpty())
|
||||
return range.start;
|
||||
|
||||
// Shortcut: If the text we want to insert is the same as it is already
|
||||
|
|
@ -533,55 +532,106 @@ var Document = function(text) {
|
|||
return range.end;
|
||||
|
||||
this.remove(range);
|
||||
var end;
|
||||
if (text) {
|
||||
var end = this.insert(range.start, text);
|
||||
end = this.insert(range.start, text);
|
||||
}
|
||||
else {
|
||||
end = range.start;
|
||||
}
|
||||
|
||||
|
||||
return end;
|
||||
};
|
||||
|
||||
/**
|
||||
* Applies all the changes previously accumulated. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`.
|
||||
* Applies all changes in `deltas` to the document.
|
||||
* @param {Array} deltas An array of delta objects (can include "insert" and "remove" actions)
|
||||
**/
|
||||
this.applyDeltas = function(deltas) {
|
||||
for (var i=0; i<deltas.length; i++) {
|
||||
var delta = deltas[i];
|
||||
var range = Range.fromPoints(delta.range.start, delta.range.end);
|
||||
|
||||
if (delta.action == "insertLines")
|
||||
this.insertLines(range.start.row, delta.lines);
|
||||
else if (delta.action == "insertText")
|
||||
this.insert(range.start, delta.text);
|
||||
else if (delta.action == "removeLines")
|
||||
this._removeLines(range.start.row, range.end.row - 1);
|
||||
else if (delta.action == "removeText")
|
||||
this.remove(range);
|
||||
this.applyDelta(deltas[i]);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Reverts any changes previously applied. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`.
|
||||
* Reverts all changes in `deltas` from the document.
|
||||
* @param {Array} deltas An array of delta objects (can include "insert" and "remove" actions)
|
||||
**/
|
||||
this.revertDeltas = function(deltas) {
|
||||
for (var i=deltas.length-1; i>=0; i--) {
|
||||
var delta = deltas[i];
|
||||
|
||||
var range = Range.fromPoints(delta.range.start, delta.range.end);
|
||||
|
||||
if (delta.action == "insertLines")
|
||||
this._removeLines(range.start.row, range.end.row - 1);
|
||||
else if (delta.action == "insertText")
|
||||
this.remove(range);
|
||||
else if (delta.action == "removeLines")
|
||||
this._insertLines(range.start.row, delta.lines);
|
||||
else if (delta.action == "removeText")
|
||||
this.insert(range.start, delta.text);
|
||||
this.revertDelta(deltas[i]);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Applies `delta` to the document.
|
||||
* @param {Object} delta A delta object (can include "insert" and "remove" actions)
|
||||
**/
|
||||
this.applyDelta = function(delta, doNotValidate) {
|
||||
var isInsert = delta.action == "insert";
|
||||
// An empty range is a NOOP.
|
||||
if (isInsert ? delta.lines.length <= 1 && !delta.lines[0]
|
||||
: !Range.comparePoints(delta.start, delta.end)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isInsert && delta.lines.length > 20000)
|
||||
this.$splitAndapplyLargeDelta(delta, 20000);
|
||||
|
||||
// Apply.
|
||||
applyDelta(this.$lines, delta, doNotValidate);
|
||||
this._signal("change", delta);
|
||||
};
|
||||
|
||||
this.$splitAndapplyLargeDelta = function(delta, MAX) {
|
||||
// Split large insert deltas. This is necessary because:
|
||||
// 1. We need to support splicing delta lines into the document via $lines.splice.apply(...)
|
||||
// 2. fn.apply() doesn't work for a large number of params. The smallest threshold is on chrome 40 ~42000.
|
||||
// we use 20000 to leave some space for actual stack
|
||||
//
|
||||
// To Do: Ideally we'd be consistent and also split 'delete' deltas. We don't do this now, because delete
|
||||
// delta handling is too slow. If we make delete delta handling faster we can split all large deltas
|
||||
// as shown in https://gist.github.com/aldendaniels/8367109#file-document-snippet-js
|
||||
// If we do this, update validateDelta() to limit the number of lines in a delete delta.
|
||||
var lines = delta.lines;
|
||||
var l = lines.length;
|
||||
var row = delta.start.row;
|
||||
var column = delta.start.column;
|
||||
var from = 0, to = 0;
|
||||
do {
|
||||
from = to;
|
||||
to += MAX - 1;
|
||||
var chunk = lines.slice(from, to);
|
||||
if (to > l) {
|
||||
// Update remaining delta.
|
||||
delta.lines = chunk;
|
||||
delta.start.row = row + from;
|
||||
delta.start.column = column;
|
||||
break;
|
||||
}
|
||||
chunk.push("");
|
||||
this.applyDelta({
|
||||
start: this.pos(row + from, column),
|
||||
end: this.pos(row + to, column = 0),
|
||||
action: delta.action,
|
||||
lines: chunk
|
||||
}, true);
|
||||
} while(true);
|
||||
};
|
||||
|
||||
/**
|
||||
* Reverts `delta` from the document.
|
||||
* @param {Object} delta A delta object (can include "insert" and "remove" actions)
|
||||
**/
|
||||
this.revertDelta = function(delta) {
|
||||
this.applyDelta({
|
||||
start: this.clonePos(delta.start),
|
||||
end: this.clonePos(delta.end),
|
||||
action: (delta.action == "insert" ? "remove" : "insert"),
|
||||
lines: delta.lines.slice()
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Converts an index position in a document to a `{row, column}` object.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ module.exports = {
|
|||
var doc = new Document(["12", "34"]);
|
||||
|
||||
var deltas = [];
|
||||
doc.on("change", function(e) { deltas.push(e.data); });
|
||||
doc.on("change", function(e) { deltas.push(e); });
|
||||
|
||||
doc.insert({row: 0, column: 1}, "juhu");
|
||||
assert.equal(doc.getValue(), ["1juhu2", "34"].join("\n"));
|
||||
|
|
@ -63,9 +63,9 @@ module.exports = {
|
|||
var doc = new Document(["12", "34"]);
|
||||
|
||||
var deltas = [];
|
||||
doc.on("change", function(e) { deltas.push(e.data); });
|
||||
doc.on("change", function(e) { deltas.push(e); });
|
||||
|
||||
doc.insertNewLine({row: 0, column: 1});
|
||||
doc.insertMergedLines({row: 0, column: 1}, ['', '']);
|
||||
assert.equal(doc.getValue(), ["1", "2", "34"].join("\n"));
|
||||
|
||||
var d = deltas.concat();
|
||||
|
|
@ -80,9 +80,9 @@ module.exports = {
|
|||
var doc = new Document(["12", "34"]);
|
||||
|
||||
var deltas = [];
|
||||
doc.on("change", function(e) { deltas.push(e.data); });
|
||||
doc.on("change", function(e) { deltas.push(e); });
|
||||
|
||||
doc.insertLines(0, ["aa", "bb"]);
|
||||
doc.insertFullLines(0, ["aa", "bb"]);
|
||||
assert.equal(doc.getValue(), ["aa", "bb", "12", "34"].join("\n"));
|
||||
|
||||
var d = deltas.concat();
|
||||
|
|
@ -97,9 +97,9 @@ module.exports = {
|
|||
var doc = new Document(["12", "34"]);
|
||||
|
||||
var deltas = [];
|
||||
doc.on("change", function(e) { deltas.push(e.data); });
|
||||
doc.on("change", function(e) { deltas.push(e); });
|
||||
|
||||
doc.insertLines(2, ["aa", "bb"]);
|
||||
doc.insertFullLines(2, ["aa", "bb"]);
|
||||
assert.equal(doc.getValue(), ["12", "34", "aa", "bb"].join("\n"));
|
||||
},
|
||||
|
||||
|
|
@ -107,9 +107,9 @@ module.exports = {
|
|||
var doc = new Document(["12", "34"]);
|
||||
|
||||
var deltas = [];
|
||||
doc.on("change", function(e) { deltas.push(e.data); });
|
||||
doc.on("change", function(e) { deltas.push(e); });
|
||||
|
||||
doc.insertLines(1, ["aa", "bb"]);
|
||||
doc.insertFullLines(1, ["aa", "bb"]);
|
||||
assert.equal(doc.getValue(), ["12", "aa", "bb", "34"].join("\n"));
|
||||
|
||||
var d = deltas.concat();
|
||||
|
|
@ -124,7 +124,7 @@ module.exports = {
|
|||
var doc = new Document(["12", "34"]);
|
||||
|
||||
var deltas = [];
|
||||
doc.on("change", function(e) { deltas.push(e.data); });
|
||||
doc.on("change", function(e) { deltas.push(e); });
|
||||
|
||||
doc.insert({row: 0, column: 0}, "aa\nbb\ncc");
|
||||
assert.equal(doc.getValue(), ["aa", "bb", "cc12", "34"].join("\n"));
|
||||
|
|
@ -141,9 +141,9 @@ module.exports = {
|
|||
var doc = new Document(["12", "34"]);
|
||||
|
||||
var deltas = [];
|
||||
doc.on("change", function(e) { deltas.push(e.data); });
|
||||
doc.on("change", function(e) { deltas.push(e); });
|
||||
|
||||
doc.insert({row: 2, column: 0}, "aa\nbb\ncc");
|
||||
doc.insert({row: 1, column: 2}, "aa\nbb\ncc");
|
||||
assert.equal(doc.getValue(), ["12", "34aa", "bb", "cc"].join("\n"));
|
||||
|
||||
var d = deltas.concat();
|
||||
|
|
@ -158,7 +158,7 @@ module.exports = {
|
|||
var doc = new Document(["12", "34"]);
|
||||
|
||||
var deltas = [];
|
||||
doc.on("change", function(e) { deltas.push(e.data); });
|
||||
doc.on("change", function(e) { deltas.push(e); });
|
||||
|
||||
doc.insert({row: 0, column: 1}, "aa\nbb\ncc");
|
||||
assert.equal(doc.getValue(), ["1aa", "bb", "cc2", "34"].join("\n"));
|
||||
|
|
@ -175,7 +175,7 @@ module.exports = {
|
|||
var doc = new Document(["1234", "5678"]);
|
||||
|
||||
var deltas = [];
|
||||
doc.on("change", function(e) { deltas.push(e.data); });
|
||||
doc.on("change", function(e) { deltas.push(e); });
|
||||
|
||||
doc.remove(new Range(0, 1, 0, 3));
|
||||
assert.equal(doc.getValue(), ["14", "5678"].join("\n"));
|
||||
|
|
@ -192,7 +192,7 @@ module.exports = {
|
|||
var doc = new Document(["1234", "5678"]);
|
||||
|
||||
var deltas = [];
|
||||
doc.on("change", function(e) { deltas.push(e.data); });
|
||||
doc.on("change", function(e) { deltas.push(e); });
|
||||
|
||||
doc.remove(new Range(0, 4, 1, 0));
|
||||
assert.equal(doc.getValue(), ["12345678"].join("\n"));
|
||||
|
|
@ -209,7 +209,7 @@ module.exports = {
|
|||
var doc = new Document(["1234", "5678", "abcd"]);
|
||||
|
||||
var deltas = [];
|
||||
doc.on("change", function(e) { deltas.push(e.data); });
|
||||
doc.on("change", function(e) { deltas.push(e); });
|
||||
|
||||
doc.remove(new Range(0, 2, 2, 2));
|
||||
assert.equal(doc.getValue(), ["12cd"].join("\n"));
|
||||
|
|
@ -226,7 +226,7 @@ module.exports = {
|
|||
var doc = new Document(["1234", "5678", "abcd"]);
|
||||
|
||||
var deltas = [];
|
||||
doc.on("change", function(e) { deltas.push(e.data); });
|
||||
doc.on("change", function(e) { deltas.push(e); });
|
||||
|
||||
doc.remove(new Range(1, 0, 3, 0));
|
||||
assert.equal(doc.getValue(), ["1234", ""].join("\n"));
|
||||
|
|
@ -235,7 +235,7 @@ module.exports = {
|
|||
"test: remove lines should return the removed lines" : function() {
|
||||
var doc = new Document(["1234", "5678", "abcd"]);
|
||||
|
||||
var removed = doc.removeLines(1, 2);
|
||||
var removed = doc.removeFullLines(1, 2);
|
||||
assert.equal(removed.join("\n"), ["5678", "abcd"].join("\n"));
|
||||
},
|
||||
|
||||
|
|
@ -296,6 +296,35 @@ module.exports = {
|
|||
"test: empty document has to contain one line": function() {
|
||||
var doc = new Document("");
|
||||
assert.equal(doc.$lines.length, 1);
|
||||
},
|
||||
|
||||
"test: ignore empty delta": function() {
|
||||
var doc = new Document("");
|
||||
doc.on("change", function() {
|
||||
throw "should ignore empty delta";
|
||||
})
|
||||
doc.insert({row: 0, column: 0}, "");
|
||||
doc.insert({row: 1, column: 1}, "");
|
||||
doc.remove({start: {row: 1, column: 1}, end: {row: 1, column: 1}});
|
||||
},
|
||||
|
||||
"test: inserting huge delta": function() {
|
||||
var doc = new Document("");
|
||||
var val = "";
|
||||
var MAX = 0xF000;
|
||||
for (var i = 0; i < 10 * MAX; i++) {
|
||||
val += i + "\n"
|
||||
}
|
||||
doc.setValue(val);
|
||||
assert.equal(doc.getValue(), val);
|
||||
|
||||
for (var i = 3 * MAX + 2; i >= 3 * MAX - 2; i--) {
|
||||
val = doc.getLines(0, i).join("\n");
|
||||
doc.setValue("\nab");
|
||||
assert.equal(doc.getValue(), "\nab");
|
||||
doc.insert({row: 1, column: 1}, val);
|
||||
assert.equal(doc.getValue(), "\na" + val + "b");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ var EditSession = function(text, mode) {
|
|||
this.$foldData = [];
|
||||
this.$foldData.toString = function() {
|
||||
return this.join("\n");
|
||||
}
|
||||
};
|
||||
this.on("changeFold", this.onChangeFold.bind(this));
|
||||
this.$onChange = this.onChange.bind(this);
|
||||
|
||||
|
|
@ -163,7 +163,7 @@ var EditSession = function(text, mode) {
|
|||
|
||||
config.resetOptions(this);
|
||||
this.setMode(mode);
|
||||
config._emit("session", this);
|
||||
config._signal("session", this);
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -249,13 +249,12 @@ var EditSession = function(text, mode) {
|
|||
this.$resetRowCache(fold.start.row);
|
||||
};
|
||||
|
||||
this.onChange = function(e) {
|
||||
var delta = e.data;
|
||||
this.onChange = function(delta) {
|
||||
this.$modified = true;
|
||||
|
||||
this.$resetRowCache(delta.range.start.row);
|
||||
this.$resetRowCache(delta.start.row);
|
||||
|
||||
var removedFolds = this.$updateInternalDataOnChange(e);
|
||||
var removedFolds = this.$updateInternalDataOnChange(delta);
|
||||
if (!this.$fromUndo && this.$undoManager && !delta.ignore) {
|
||||
this.$deltasDoc.push(delta);
|
||||
if (removedFolds && removedFolds.length != 0) {
|
||||
|
|
@ -268,26 +267,24 @@ var EditSession = function(text, mode) {
|
|||
this.$informUndoManager.schedule();
|
||||
}
|
||||
|
||||
this.bgTokenizer.$updateOnChange(delta);
|
||||
this._emit("change", e);
|
||||
this.bgTokenizer && this.bgTokenizer.$updateOnChange(delta);
|
||||
this._signal("change", delta);
|
||||
};
|
||||
|
||||
/**
|
||||
* Sets the session text.
|
||||
* @param {String} text The new text to place
|
||||
*
|
||||
*
|
||||
*
|
||||
**/
|
||||
this.setValue = function(text) {
|
||||
this.doc.setValue(text);
|
||||
this.selection.moveCursorTo(0, 0);
|
||||
this.selection.clearSelection();
|
||||
this.selection.moveTo(0, 0);
|
||||
|
||||
this.$resetRowCache(0);
|
||||
this.$deltas = [];
|
||||
this.$deltasDoc = [];
|
||||
this.$deltasFold = [];
|
||||
this.setUndoManager(this.$undoManager);
|
||||
this.getUndoManager().reset();
|
||||
};
|
||||
|
||||
|
|
@ -412,7 +409,7 @@ var EditSession = function(text, mode) {
|
|||
}
|
||||
self.mergeUndoDeltas = false;
|
||||
self.$deltas = [];
|
||||
}
|
||||
};
|
||||
this.$informUndoManager = lang.delayedCall(this.$syncInformUndoManager);
|
||||
}
|
||||
};
|
||||
|
|
@ -470,7 +467,7 @@ var EditSession = function(text, mode) {
|
|||
* @param {Number} tabSize The new tab size
|
||||
**/
|
||||
this.setTabSize = function(tabSize) {
|
||||
this.setOption("tabSize", tabSize)
|
||||
this.setOption("tabSize", tabSize);
|
||||
};
|
||||
/**
|
||||
* Returns the current tab size.
|
||||
|
|
@ -486,7 +483,7 @@ var EditSession = function(text, mode) {
|
|||
*
|
||||
**/
|
||||
this.isTabStop = function(position) {
|
||||
return this.$useSoftTabs && (position.column % this.$tabSize == 0);
|
||||
return this.$useSoftTabs && (position.column % this.$tabSize === 0);
|
||||
};
|
||||
|
||||
this.$overwrite = false;
|
||||
|
|
@ -500,7 +497,7 @@ var EditSession = function(text, mode) {
|
|||
*
|
||||
**/
|
||||
this.setOverwrite = function(overwrite) {
|
||||
this.setOption("overwrite", overwrite)
|
||||
this.setOption("overwrite", overwrite);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -528,7 +525,7 @@ var EditSession = function(text, mode) {
|
|||
if (!this.$decorations[row])
|
||||
this.$decorations[row] = "";
|
||||
this.$decorations[row] += " " + className;
|
||||
this._emit("changeBreakpoint", {});
|
||||
this._signal("changeBreakpoint", {});
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -540,7 +537,7 @@ var EditSession = function(text, mode) {
|
|||
**/
|
||||
this.removeGutterDecoration = function(row, className) {
|
||||
this.$decorations[row] = (this.$decorations[row] || "").replace(" " + className, "");
|
||||
this._emit("changeBreakpoint", {});
|
||||
this._signal("changeBreakpoint", {});
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -563,7 +560,7 @@ var EditSession = function(text, mode) {
|
|||
for (var i=0; i<rows.length; i++) {
|
||||
this.$breakpoints[rows[i]] = "ace_breakpoint";
|
||||
}
|
||||
this._emit("changeBreakpoint", {});
|
||||
this._signal("changeBreakpoint", {});
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -571,7 +568,7 @@ var EditSession = function(text, mode) {
|
|||
**/
|
||||
this.clearBreakpoints = function() {
|
||||
this.$breakpoints = [];
|
||||
this._emit("changeBreakpoint", {});
|
||||
this._signal("changeBreakpoint", {});
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -588,7 +585,7 @@ var EditSession = function(text, mode) {
|
|||
this.$breakpoints[row] = className;
|
||||
else
|
||||
delete this.$breakpoints[row];
|
||||
this._emit("changeBreakpoint", {});
|
||||
this._signal("changeBreakpoint", {});
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -599,7 +596,7 @@ var EditSession = function(text, mode) {
|
|||
**/
|
||||
this.clearBreakpoint = function(row) {
|
||||
delete this.$breakpoints[row];
|
||||
this._emit("changeBreakpoint", {});
|
||||
this._signal("changeBreakpoint", {});
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -622,14 +619,14 @@ var EditSession = function(text, mode) {
|
|||
clazz : clazz,
|
||||
inFront: !!inFront,
|
||||
id: id
|
||||
}
|
||||
};
|
||||
|
||||
if (inFront) {
|
||||
this.$frontMarkers[id] = marker;
|
||||
this._emit("changeFrontMarker")
|
||||
this._signal("changeFrontMarker");
|
||||
} else {
|
||||
this.$backMarkers[id] = marker;
|
||||
this._emit("changeBackMarker")
|
||||
this._signal("changeBackMarker");
|
||||
}
|
||||
|
||||
return id;
|
||||
|
|
@ -652,10 +649,10 @@ var EditSession = function(text, mode) {
|
|||
|
||||
if (inFront) {
|
||||
this.$frontMarkers[id] = marker;
|
||||
this._emit("changeFrontMarker")
|
||||
this._signal("changeFrontMarker");
|
||||
} else {
|
||||
this.$backMarkers[id] = marker;
|
||||
this._emit("changeBackMarker")
|
||||
this._signal("changeBackMarker");
|
||||
}
|
||||
|
||||
return marker;
|
||||
|
|
@ -676,15 +673,15 @@ var EditSession = function(text, mode) {
|
|||
var markers = marker.inFront ? this.$frontMarkers : this.$backMarkers;
|
||||
if (marker) {
|
||||
delete (markers[markerId]);
|
||||
this._emit(marker.inFront ? "changeFrontMarker" : "changeBackMarker");
|
||||
this._signal(marker.inFront ? "changeFrontMarker" : "changeBackMarker");
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns an array containing the IDs of all the markers, either front or back.
|
||||
* Returns an object containing all of the markers, either front or back.
|
||||
* @param {Boolean} inFront If `true`, indicates you only want front markers; `false` indicates only back markers
|
||||
*
|
||||
* @returns {Array}
|
||||
* @returns {Object}
|
||||
**/
|
||||
this.getMarkers = function(inFront) {
|
||||
return inFront ? this.$frontMarkers : this.$backMarkers;
|
||||
|
|
@ -696,7 +693,7 @@ var EditSession = function(text, mode) {
|
|||
this.$searchHighlight = this.addDynamicMarker(highlight);
|
||||
}
|
||||
this.$searchHighlight.setRegexp(re);
|
||||
}
|
||||
};
|
||||
|
||||
// experimental
|
||||
this.highlightLines = function(startRow, endRow, clazz, inFront) {
|
||||
|
|
@ -728,7 +725,7 @@ var EditSession = function(text, mode) {
|
|||
**/
|
||||
this.setAnnotations = function(annotations) {
|
||||
this.$annotations = annotations;
|
||||
this._emit("changeAnnotation", {});
|
||||
this._signal("changeAnnotation", {});
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -858,7 +855,7 @@ var EditSession = function(text, mode) {
|
|||
this.onReloadTokenizer = function(e) {
|
||||
var rows = e.data;
|
||||
this.bgTokenizer.start(rows.first);
|
||||
this._emit("tokenizerUpdate", e);
|
||||
this._signal("tokenizerUpdate", e);
|
||||
};
|
||||
|
||||
this.$modes = {};
|
||||
|
|
@ -895,17 +892,17 @@ var EditSession = function(text, mode) {
|
|||
config.loadModule(["mode", path], function(m) {
|
||||
if (this.$modeId !== path)
|
||||
return cb && cb();
|
||||
if (this.$modes[path] && !options)
|
||||
return this.$onChangeMode(this.$modes[path]);
|
||||
if (m && m.Mode) {
|
||||
if (this.$modes[path] && !options) {
|
||||
this.$onChangeMode(this.$modes[path]);
|
||||
} else if (m && m.Mode) {
|
||||
m = new m.Mode(options);
|
||||
if (!options) {
|
||||
this.$modes[path] = m;
|
||||
m.$id = path;
|
||||
}
|
||||
this.$onChangeMode(m);
|
||||
cb && cb();
|
||||
}
|
||||
cb && cb();
|
||||
}.bind(this));
|
||||
|
||||
// set mode to text until loading is finished
|
||||
|
|
@ -937,7 +934,7 @@ var EditSession = function(text, mode) {
|
|||
this.bgTokenizer = new BackgroundTokenizer(tokenizer);
|
||||
var _self = this;
|
||||
this.bgTokenizer.addEventListener("update", function(e) {
|
||||
_self._emit("tokenizerUpdate", e);
|
||||
_self._signal("tokenizerUpdate", e);
|
||||
});
|
||||
} else {
|
||||
this.bgTokenizer.setTokenizer(tokenizer);
|
||||
|
|
@ -950,33 +947,30 @@ var EditSession = function(text, mode) {
|
|||
|
||||
|
||||
if (!$isPlaceholder) {
|
||||
// experimental method, used by c9 findiniles
|
||||
if (mode.attachToSession)
|
||||
mode.attachToSession(this);
|
||||
this.$options.wrapMethod.set.call(this, this.$wrapMethod);
|
||||
this.$setFolding(mode.foldingRules);
|
||||
this._emit("changeMode");
|
||||
this.bgTokenizer.start(0);
|
||||
this._emit("changeMode");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
this.$stopWorker = function() {
|
||||
if (this.$worker)
|
||||
if (this.$worker) {
|
||||
this.$worker.terminate();
|
||||
|
||||
this.$worker = null;
|
||||
this.$worker = null;
|
||||
}
|
||||
};
|
||||
|
||||
this.$startWorker = function() {
|
||||
if (typeof Worker !== "undefined" && !require.noWorker) {
|
||||
try {
|
||||
this.$worker = this.$mode.createWorker(this);
|
||||
} catch (e) {
|
||||
console.log("Could not load worker");
|
||||
console.log(e);
|
||||
this.$worker = null;
|
||||
}
|
||||
}
|
||||
else
|
||||
try {
|
||||
this.$worker = this.$mode.createWorker(this);
|
||||
} catch (e) {
|
||||
config.warn("Could not load worker", e);
|
||||
this.$worker = null;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -1043,14 +1037,14 @@ var EditSession = function(text, mode) {
|
|||
};
|
||||
|
||||
this.getLineWidgetMaxWidth = function() {
|
||||
if (this.lineWidgetsWidth != null) return this.lineWidgetsWidth
|
||||
if (this.lineWidgetsWidth != null) return this.lineWidgetsWidth;
|
||||
var width = 0;
|
||||
this.lineWidgets.forEach(function(w) {
|
||||
if (w && w.screenWidth > width)
|
||||
width = w.screenWidth;
|
||||
});
|
||||
return this.lineWidgetWidth = width;
|
||||
}
|
||||
};
|
||||
|
||||
this.$computeWidth = function(force) {
|
||||
if (this.$modified || force) {
|
||||
|
|
@ -1151,6 +1145,19 @@ var EditSession = function(text, mode) {
|
|||
this.remove = function(range) {
|
||||
return this.doc.remove(range);
|
||||
};
|
||||
|
||||
/**
|
||||
* Removes a range of full lines. This method also triggers the `'change'` event.
|
||||
* @param {Number} firstRow The first row to be removed
|
||||
* @param {Number} lastRow The last row to be removed
|
||||
* @returns {[String]} Returns all the removed lines.
|
||||
*
|
||||
* @related Document.removeFullLines
|
||||
*
|
||||
**/
|
||||
this.removeFullLines = function(firstRow, lastRow){
|
||||
return this.doc.removeFullLines(firstRow, lastRow);
|
||||
};
|
||||
|
||||
/**
|
||||
* Reverts previous changes to your document.
|
||||
|
|
@ -1227,39 +1234,36 @@ var EditSession = function(text, mode) {
|
|||
|
||||
this.$getUndoSelection = function(deltas, isUndo, lastUndoRange) {
|
||||
function isInsert(delta) {
|
||||
var insert =
|
||||
delta.action === "insertText" || delta.action === "insertLines";
|
||||
return isUndo ? !insert : insert;
|
||||
return isUndo ? delta.action !== "insert" : delta.action === "insert";
|
||||
}
|
||||
|
||||
var delta = deltas[0];
|
||||
var range, point;
|
||||
var lastDeltaIsInsert = false;
|
||||
if (isInsert(delta)) {
|
||||
range = Range.fromPoints(delta.range.start, delta.range.end);
|
||||
range = Range.fromPoints(delta.start, delta.end);
|
||||
lastDeltaIsInsert = true;
|
||||
} else {
|
||||
range = Range.fromPoints(delta.range.start, delta.range.start);
|
||||
range = Range.fromPoints(delta.start, delta.start);
|
||||
lastDeltaIsInsert = false;
|
||||
}
|
||||
|
||||
for (var i = 1; i < deltas.length; i++) {
|
||||
delta = deltas[i];
|
||||
if (isInsert(delta)) {
|
||||
point = delta.range.start;
|
||||
point = delta.start;
|
||||
if (range.compare(point.row, point.column) == -1) {
|
||||
range.setStart(delta.range.start);
|
||||
range.setStart(point);
|
||||
}
|
||||
point = delta.range.end;
|
||||
point = delta.end;
|
||||
if (range.compare(point.row, point.column) == 1) {
|
||||
range.setEnd(delta.range.end);
|
||||
range.setEnd(point);
|
||||
}
|
||||
lastDeltaIsInsert = true;
|
||||
} else {
|
||||
point = delta.range.start;
|
||||
point = delta.start;
|
||||
if (range.compare(point.row, point.column) == -1) {
|
||||
range =
|
||||
Range.fromPoints(delta.range.start, delta.range.start);
|
||||
range = Range.fromPoints(delta.start, delta.start);
|
||||
}
|
||||
lastDeltaIsInsert = false;
|
||||
}
|
||||
|
|
@ -1268,7 +1272,7 @@ var EditSession = function(text, mode) {
|
|||
// Check if this range and the last undo range has something in common.
|
||||
// If true, merge the ranges.
|
||||
if (lastUndoRange != null) {
|
||||
if (Range.comparePoints(lastUndoRange.start, range.start) == 0) {
|
||||
if (Range.comparePoints(lastUndoRange.start, range.start) === 0) {
|
||||
lastUndoRange.start.column += range.end.column - range.start.column;
|
||||
lastUndoRange.end.column += range.end.column - range.start.column;
|
||||
}
|
||||
|
|
@ -1373,7 +1377,7 @@ var EditSession = function(text, mode) {
|
|||
this.indentRows = function(startRow, endRow, indentString) {
|
||||
indentString = indentString.replace(/\t/g, this.getTabString());
|
||||
for (var row=startRow; row<=endRow; row++)
|
||||
this.insert({row: row, column:0}, indentString);
|
||||
this.doc.insertInLine({row: row, column: 0}, indentString);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -1430,11 +1434,11 @@ var EditSession = function(text, mode) {
|
|||
x.end.row += diff;
|
||||
return x;
|
||||
});
|
||||
|
||||
|
||||
var lines = dir == 0
|
||||
? this.doc.getLines(firstRow, lastRow)
|
||||
: this.doc.removeLines(firstRow, lastRow);
|
||||
this.doc.insertLines(firstRow+diff, lines);
|
||||
: this.doc.removeFullLines(firstRow, lastRow);
|
||||
this.doc.insertFullLines(firstRow+diff, lines);
|
||||
folds.length && this.addFolds(folds);
|
||||
return diff;
|
||||
};
|
||||
|
|
@ -1444,8 +1448,6 @@ var EditSession = function(text, mode) {
|
|||
* @param {Number} lastRow The final row to move up
|
||||
* @returns {Number} If `firstRow` is less-than or equal to 0, this function returns 0. Otherwise, on success, it returns -1.
|
||||
*
|
||||
* @related Document.insertLines
|
||||
*
|
||||
**/
|
||||
this.moveLinesUp = function(firstRow, lastRow) {
|
||||
return this.$moveLines(firstRow, lastRow, -1);
|
||||
|
|
@ -1456,8 +1458,6 @@ var EditSession = function(text, mode) {
|
|||
* @param {Number} firstRow The starting row to move down
|
||||
* @param {Number} lastRow The final row to move down
|
||||
* @returns {Number} If `firstRow` is less-than or equal to 0, this function returns 0. Otherwise, on success, it returns -1.
|
||||
*
|
||||
* @related Document.insertLines
|
||||
**/
|
||||
this.moveLinesDown = function(firstRow, lastRow) {
|
||||
return this.$moveLines(firstRow, lastRow, 1);
|
||||
|
|
@ -1556,14 +1556,11 @@ var EditSession = function(text, mode) {
|
|||
// If wrapMode is activaed, the wrapData array has to be initialized.
|
||||
if (useWrapMode) {
|
||||
var len = this.getLength();
|
||||
this.$wrapData = [];
|
||||
for (var i = 0; i < len; i++) {
|
||||
this.$wrapData.push([]);
|
||||
}
|
||||
this.$wrapData = Array(len);
|
||||
this.$updateWrapData(0, len - 1);
|
||||
}
|
||||
|
||||
this._emit("changeWrapMode");
|
||||
this._signal("changeWrapMode");
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -1588,13 +1585,11 @@ var EditSession = function(text, mode) {
|
|||
**/
|
||||
this.setWrapLimitRange = function(min, max) {
|
||||
if (this.$wrapLimitRange.min !== min || this.$wrapLimitRange.max !== max) {
|
||||
this.$wrapLimitRange = {
|
||||
min: min,
|
||||
max: max
|
||||
};
|
||||
this.$wrapLimitRange = { min: min, max: max };
|
||||
this.$modified = true;
|
||||
// This will force a recalculation of the wrap limit
|
||||
this._emit("changeWrapMode");
|
||||
if (this.$useWrapMode)
|
||||
this._signal("changeWrapMode");
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -1606,7 +1601,7 @@ var EditSession = function(text, mode) {
|
|||
* @private
|
||||
**/
|
||||
this.adjustWrapLimit = function(desiredLimit, $printMargin) {
|
||||
var limits = this.$wrapLimitRange
|
||||
var limits = this.$wrapLimitRange;
|
||||
if (limits.max < 0)
|
||||
limits = {min: $printMargin, max: $printMargin};
|
||||
var wrapLimit = this.$constrainWrapLimit(desiredLimit, limits.min, limits.max);
|
||||
|
|
@ -1616,7 +1611,7 @@ var EditSession = function(text, mode) {
|
|||
if (this.$useWrapMode) {
|
||||
this.$updateWrapData(0, this.getLength() - 1);
|
||||
this.$resetRowCache(0);
|
||||
this._emit("changeWrapLimit");
|
||||
this._signal("changeWrapLimit");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1666,34 +1661,23 @@ var EditSession = function(text, mode) {
|
|||
};
|
||||
};
|
||||
|
||||
this.$updateInternalDataOnChange = function(e) {
|
||||
this.$updateInternalDataOnChange = function(delta) {
|
||||
var useWrapMode = this.$useWrapMode;
|
||||
var len;
|
||||
var action = e.data.action;
|
||||
var firstRow = e.data.range.start.row;
|
||||
var lastRow = e.data.range.end.row;
|
||||
var start = e.data.range.start;
|
||||
var end = e.data.range.end;
|
||||
var action = delta.action;
|
||||
var start = delta.start;
|
||||
var end = delta.end;
|
||||
var firstRow = start.row;
|
||||
var lastRow = end.row;
|
||||
var len = lastRow - firstRow;
|
||||
var removedFolds = null;
|
||||
|
||||
if (action.indexOf("Lines") != -1) {
|
||||
if (action == "insertLines") {
|
||||
lastRow = firstRow + (e.data.lines.length);
|
||||
} else {
|
||||
lastRow = firstRow;
|
||||
}
|
||||
len = e.data.lines ? e.data.lines.length : lastRow - firstRow;
|
||||
} else {
|
||||
len = lastRow - firstRow;
|
||||
}
|
||||
|
||||
|
||||
this.$updating = true;
|
||||
if (len != 0) {
|
||||
if (action.indexOf("remove") != -1) {
|
||||
if (action === "remove") {
|
||||
this[useWrapMode ? "$wrapData" : "$rowLengthCache"].splice(firstRow, len);
|
||||
|
||||
var foldLines = this.$foldData;
|
||||
removedFolds = this.getFoldsInRange(e.data.range);
|
||||
removedFolds = this.getFoldsInRange(delta);
|
||||
this.removeFolds(removedFolds);
|
||||
|
||||
var foldLine = this.getFoldLine(end.row);
|
||||
|
|
@ -1719,16 +1703,10 @@ var EditSession = function(text, mode) {
|
|||
|
||||
lastRow = firstRow;
|
||||
} else {
|
||||
var args;
|
||||
if (useWrapMode) {
|
||||
args = [firstRow, 0];
|
||||
for (var i = 0; i < len; i++) args.push([]);
|
||||
this.$wrapData.splice.apply(this.$wrapData, args);
|
||||
} else {
|
||||
args = Array(len);
|
||||
args.unshift(firstRow, 0);
|
||||
this.$rowLengthCache.splice.apply(this.$rowLengthCache, args);
|
||||
}
|
||||
var args = Array(len);
|
||||
args.unshift(firstRow, 0);
|
||||
var arr = useWrapMode ? this.$wrapData : this.$rowLengthCache
|
||||
arr.splice.apply(arr, args);
|
||||
|
||||
// If some new line is added inside of a foldLine, then split
|
||||
// the fold line up.
|
||||
|
|
@ -1736,13 +1714,14 @@ var EditSession = function(text, mode) {
|
|||
var foldLine = this.getFoldLine(firstRow);
|
||||
var idx = 0;
|
||||
if (foldLine) {
|
||||
var cmp = foldLine.range.compareInside(start.row, start.column)
|
||||
var cmp = foldLine.range.compareInside(start.row, start.column);
|
||||
// Inside of the foldLine range. Need to split stuff up.
|
||||
if (cmp == 0) {
|
||||
foldLine = foldLine.split(start.row, start.column);
|
||||
foldLine.shiftRow(len);
|
||||
foldLine.addRemoveChars(
|
||||
lastRow, 0, end.column - start.column);
|
||||
if (foldLine) {
|
||||
foldLine.shiftRow(len);
|
||||
foldLine.addRemoveChars(lastRow, 0, end.column - start.column);
|
||||
}
|
||||
} else
|
||||
// Infront of the foldLine but same row. Need to shift column.
|
||||
if (cmp == -1) {
|
||||
|
|
@ -1763,10 +1742,10 @@ var EditSession = function(text, mode) {
|
|||
} else {
|
||||
// Realign folds. E.g. if you add some new chars before a fold, the
|
||||
// fold should "move" to the right.
|
||||
len = Math.abs(e.data.range.start.column - e.data.range.end.column);
|
||||
if (action.indexOf("remove") != -1) {
|
||||
len = Math.abs(delta.start.column - delta.end.column);
|
||||
if (action === "remove") {
|
||||
// Get all the folds in the change range and remove them.
|
||||
removedFolds = this.getFoldsInRange(e.data.range);
|
||||
removedFolds = this.getFoldsInRange(delta);
|
||||
this.removeFolds(removedFolds);
|
||||
|
||||
len = -len;
|
||||
|
|
@ -1833,8 +1812,7 @@ var EditSession = function(text, mode) {
|
|||
lines[foldLine.end.row].length + 1
|
||||
);
|
||||
|
||||
wrapData[foldLine.start.row]
|
||||
= this.$computeWrapSplits(tokens, wrapLimit, tabSize);
|
||||
wrapData[foldLine.start.row] = this.$computeWrapSplits(tokens, wrapLimit, tabSize);
|
||||
row = foldLine.end.row + 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -1851,7 +1829,7 @@ var EditSession = function(text, mode) {
|
|||
TAB_SPACE = 12;
|
||||
|
||||
|
||||
this.$computeWrapSplits = function(tokens, wrapLimit) {
|
||||
this.$computeWrapSplits = function(tokens, wrapLimit, tabSize) {
|
||||
if (tokens.length == 0) {
|
||||
return [];
|
||||
}
|
||||
|
|
@ -1862,6 +1840,31 @@ var EditSession = function(text, mode) {
|
|||
|
||||
var isCode = this.$wrapAsCode;
|
||||
|
||||
var indentedSoftWrap = this.$indentedSoftWrap;
|
||||
var maxIndent = wrapLimit <= Math.max(2 * tabSize, 8)
|
||||
|| indentedSoftWrap === false ? 0 : Math.floor(wrapLimit / 2);
|
||||
|
||||
function getWrapIndent() {
|
||||
var indentation = 0;
|
||||
if (maxIndent === 0)
|
||||
return indentation;
|
||||
if (indentedSoftWrap) {
|
||||
for (var i = 0; i < tokens.length; i++) {
|
||||
var token = tokens[i];
|
||||
if (token == SPACE)
|
||||
indentation += 1;
|
||||
else if (token == TAB)
|
||||
indentation += tabSize;
|
||||
else if (token == TAB_SPACE)
|
||||
continue;
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isCode && indentedSoftWrap !== false)
|
||||
indentation += tabSize;
|
||||
return Math.min(indentation, maxIndent);
|
||||
}
|
||||
function addSplit(screenPos) {
|
||||
var displayed = tokens.slice(lastSplit, screenPos);
|
||||
|
||||
|
|
@ -1878,14 +1881,18 @@ var EditSession = function(text, mode) {
|
|||
len -= 1;
|
||||
});
|
||||
|
||||
if (!splits.length) {
|
||||
indent = getWrapIndent();
|
||||
splits.indent = indent;
|
||||
}
|
||||
lastDocSplit += len;
|
||||
splits.push(lastDocSplit);
|
||||
lastSplit = screenPos;
|
||||
}
|
||||
|
||||
while (displayLength - lastSplit > wrapLimit) {
|
||||
var indent = 0;
|
||||
while (displayLength - lastSplit > wrapLimit - indent) {
|
||||
// This is, where the split should be.
|
||||
var split = lastSplit + wrapLimit;
|
||||
var split = lastSplit + wrapLimit - indent;
|
||||
|
||||
// If there is a space or tab at this split position, then making
|
||||
// a split is simple.
|
||||
|
|
@ -1945,7 +1952,7 @@ var EditSession = function(text, mode) {
|
|||
|
||||
// === ELSE ===
|
||||
// Search for the first non space/tab/placeholder/punctuation token backwards.
|
||||
var minSplit = Math.max(split - (isCode ? 10 : wrapLimit-(wrapLimit>>2)), lastSplit - 1);
|
||||
var minSplit = Math.max(split - (wrapLimit -(wrapLimit>>2)), lastSplit - 1);
|
||||
while (split > minSplit && tokens[split] < PLACEHOLDER_START) {
|
||||
split --;
|
||||
}
|
||||
|
|
@ -1971,7 +1978,9 @@ var EditSession = function(text, mode) {
|
|||
split = lastSplit + wrapLimit;
|
||||
// The split is inside of a CHAR or CHAR_EXT token and no space
|
||||
// around -> force a split.
|
||||
addSplit(split);
|
||||
if (tokens[split] == CHAR_EXT)
|
||||
split--;
|
||||
addSplit(split - indent);
|
||||
}
|
||||
return splits;
|
||||
};
|
||||
|
|
@ -2023,9 +2032,6 @@ var EditSession = function(text, mode) {
|
|||
* The first position indicates the number of columns for `str` on screen.<br/>
|
||||
* The second value contains the position of the document column that this function read until.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
**/
|
||||
this.$getStringScreenWidth = function(str, maxScreenColumn, screenColumn) {
|
||||
if (maxScreenColumn == 0)
|
||||
|
|
@ -2081,6 +2087,16 @@ var EditSession = function(text, mode) {
|
|||
}
|
||||
};
|
||||
|
||||
this.getRowWrapIndent = function(screenRow) {
|
||||
if (this.$useWrapMode) {
|
||||
var pos = this.screenToDocumentPosition(screenRow, Number.MAX_VALUE);
|
||||
var splits = this.$wrapData[pos.row];
|
||||
return splits.length && splits[0] < pos.column ? splits.indent : 0;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the position (on screen) for the last character in the provided screen row.
|
||||
* @param {Number} screenRow The screen row to check
|
||||
|
|
@ -2213,25 +2229,26 @@ var EditSession = function(text, mode) {
|
|||
return {
|
||||
row: maxRow,
|
||||
column: this.getLine(maxRow).length
|
||||
}
|
||||
};
|
||||
} else {
|
||||
line = this.getLine(docRow);
|
||||
foldLine = null;
|
||||
}
|
||||
|
||||
var wrapIndent = 0;
|
||||
if (this.$useWrapMode) {
|
||||
var splits = this.$wrapData[docRow];
|
||||
if (splits) {
|
||||
var splitIndex = Math.floor(screenRow - row);
|
||||
column = splits[splitIndex];
|
||||
if(splitIndex > 0 && splits.length) {
|
||||
wrapIndent = splits.indent;
|
||||
docColumn = splits[splitIndex - 1] || splits[splits.length - 1];
|
||||
line = line.substring(docColumn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
docColumn += this.$getStringScreenWidth(line, screenColumn)[1];
|
||||
docColumn += this.$getStringScreenWidth(line, screenColumn - wrapIndent)[1];
|
||||
|
||||
// We remove one character at the end so that the docColumn
|
||||
// position returned is not associated to the next row on the screen.
|
||||
|
|
@ -2323,22 +2340,26 @@ var EditSession = function(text, mode) {
|
|||
textLine = this.getLine(docRow).substring(0, docColumn);
|
||||
foldStartRow = docRow;
|
||||
}
|
||||
var wrapIndent = 0;
|
||||
// Clamp textLine if in wrapMode.
|
||||
if (this.$useWrapMode) {
|
||||
var wrapRow = this.$wrapData[foldStartRow];
|
||||
var screenRowOffset = 0;
|
||||
while (textLine.length >= wrapRow[screenRowOffset]) {
|
||||
screenRow ++;
|
||||
screenRowOffset++;
|
||||
if (wrapRow) {
|
||||
var screenRowOffset = 0;
|
||||
while (textLine.length >= wrapRow[screenRowOffset]) {
|
||||
screenRow ++;
|
||||
screenRowOffset++;
|
||||
}
|
||||
textLine = textLine.substring(
|
||||
wrapRow[screenRowOffset - 1] || 0, textLine.length
|
||||
);
|
||||
wrapIndent = screenRowOffset > 0 ? wrapRow.indent : 0;
|
||||
}
|
||||
textLine = textLine.substring(
|
||||
wrapRow[screenRowOffset - 1] || 0, textLine.length
|
||||
);
|
||||
}
|
||||
|
||||
return {
|
||||
row: screenRow,
|
||||
column: this.$getStringScreenWidth(textLine)[0]
|
||||
column: wrapIndent + this.$getStringScreenWidth(textLine)[0]
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -2387,7 +2408,8 @@ var EditSession = function(text, mode) {
|
|||
var foldStart = fold ? fold.start.row :Infinity;
|
||||
|
||||
while (row < lastRow) {
|
||||
screenRows += this.$wrapData[row].length + 1;
|
||||
var splits = this.$wrapData[row];
|
||||
screenRows += splits ? splits.length + 1 : 1;
|
||||
row ++;
|
||||
if (row > foldStart) {
|
||||
row = fold.end.row+1;
|
||||
|
|
@ -2403,14 +2425,25 @@ var EditSession = function(text, mode) {
|
|||
|
||||
return screenRows;
|
||||
};
|
||||
|
||||
// For every keystroke this gets called once per char in the whole doc!!
|
||||
// Wouldn't hurt to make it a bit faster for c >= 0x1100
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
*
|
||||
*/
|
||||
this.$setFontMetrics = function(fm) {
|
||||
// todo
|
||||
};
|
||||
|
||||
this.destroy = function() {
|
||||
if (this.bgTokenizer) {
|
||||
this.bgTokenizer.setDocument(null);
|
||||
this.bgTokenizer = null;
|
||||
}
|
||||
this.$stopWorker();
|
||||
};
|
||||
|
||||
// For every keystroke this gets called once per char in the whole doc!!
|
||||
// Wouldn't hurt to make it a bit faster for c >= 0x1100
|
||||
function isFullWidth(c) {
|
||||
if (c < 0x1100)
|
||||
return false;
|
||||
|
|
@ -2468,6 +2501,7 @@ config.defineOptions(EditSession.prototype, "session", {
|
|||
|
||||
if (this.$wrap == value)
|
||||
return;
|
||||
this.$wrap = value;
|
||||
if (!value) {
|
||||
this.setUseWrapMode(false);
|
||||
} else {
|
||||
|
|
@ -2475,10 +2509,16 @@ config.defineOptions(EditSession.prototype, "session", {
|
|||
this.setWrapLimitRange(col, col);
|
||||
this.setUseWrapMode(true);
|
||||
}
|
||||
this.$wrap = value;
|
||||
},
|
||||
get: function() {
|
||||
return this.getUseWrapMode() ? this.getWrapLimitRange().min || "free" : "off";
|
||||
if (this.getUseWrapMode()) {
|
||||
if (this.$wrap == -1)
|
||||
return "printMargin";
|
||||
if (!this.getWrapLimitRange().min)
|
||||
return "free";
|
||||
return this.$wrap;
|
||||
}
|
||||
return "off";
|
||||
},
|
||||
handlesSet: true
|
||||
},
|
||||
|
|
@ -2499,8 +2539,9 @@ config.defineOptions(EditSession.prototype, "session", {
|
|||
},
|
||||
initialValue: "auto"
|
||||
},
|
||||
indentedSoftWrap: { initialValue: true },
|
||||
firstLineNumber: {
|
||||
set: function() {this._emit("changeBreakpoint");},
|
||||
set: function() {this._signal("changeBreakpoint");},
|
||||
initialValue: 1
|
||||
},
|
||||
useWorker: {
|
||||
|
|
@ -2521,19 +2562,23 @@ config.defineOptions(EditSession.prototype, "session", {
|
|||
this.$modified = true;
|
||||
this.$rowLengthCache = [];
|
||||
this.$tabSize = tabSize;
|
||||
this._emit("changeTabSize");
|
||||
this._signal("changeTabSize");
|
||||
},
|
||||
initialValue: 4,
|
||||
handlesSet: true
|
||||
},
|
||||
overwrite: {
|
||||
set: function(val) {this._emit("changeOverwrite");},
|
||||
set: function(val) {this._signal("changeOverwrite");},
|
||||
initialValue: false
|
||||
},
|
||||
newLineMode: {
|
||||
set: function(val) {this.doc.setNewLineMode(val)},
|
||||
get: function() {return this.doc.getNewLineMode()},
|
||||
handlesSet: true
|
||||
},
|
||||
mode: {
|
||||
set: function(val) { this.setMode(val) },
|
||||
get: function() { return this.$modeId }
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -117,6 +117,7 @@ function BracketMatch() {
|
|||
typeRe = new RegExp(
|
||||
"(\\.?" +
|
||||
token.type.replace(".", "\\.").replace("rparen", ".paren")
|
||||
.replace(/\b(?:end)\b/, "(?:start|begin|end)")
|
||||
+ ")+"
|
||||
);
|
||||
}
|
||||
|
|
@ -173,6 +174,7 @@ function BracketMatch() {
|
|||
typeRe = new RegExp(
|
||||
"(\\.?" +
|
||||
token.type.replace(".", "\\.").replace("lparen", ".paren")
|
||||
.replace(/\b(?:start|begin)\b/, "(?:start|begin|end)")
|
||||
+ ")+"
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue