mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2025-08-17 16:31:45 +02:00
Compare commits
728 Commits
customized
...
customized
Author | SHA1 | Date | |
---|---|---|---|
8de7a9f741
|
|||
5977840cef
|
|||
d0fea229c4
|
|||
9eeac4a788
|
|||
8370661b0d
|
|||
3f88e64abf
|
|||
28e3a7c894
|
|||
bc859c65f5
|
|||
141fc8ed22
|
|||
dec494639c
|
|||
d06688033b
|
|||
98110b9132
|
|||
a0404b8664
|
|||
a2a30d545e
|
|||
4f3bf039c9
|
|||
1f4b97fa00
|
|||
61301fdbf5
|
|||
c980250529
|
|||
bdb4b02016
|
|||
62039a00d3
|
|||
95c66fd4a6
|
|||
![]() |
fb9bfbaeeb | ||
![]() |
09668f4fcb | ||
![]() |
4c7a6165ed | ||
![]() |
12d0d2613f | ||
![]() |
42ee78cd3d | ||
![]() |
58d308c1ed | ||
![]() |
29e1bcc53d | ||
![]() |
3531574e5e | ||
![]() |
b9721218ab | ||
![]() |
a119ea6a29 | ||
![]() |
95ef5f5f32 | ||
![]() |
b81b18645b | ||
![]() |
ce591f1b43 | ||
![]() |
28afa4b3ce | ||
![]() |
89a24d71a6 | ||
f69630b668 | |||
![]() |
a2d34a883b | ||
![]() |
5c79b887d8 | ||
![]() |
d0475bf659 | ||
![]() |
85c9576699 | ||
![]() |
2483450a1f | ||
![]() |
519d5eed06 | ||
![]() |
d87965775a | ||
![]() |
8c6f81aa00 | ||
![]() |
6ea0ab0968 | ||
![]() |
70ab3ecdbe | ||
![]() |
a24ae616df | ||
![]() |
cc838f614f | ||
![]() |
ae62a9f378 | ||
![]() |
1b5778a58c | ||
![]() |
27a689e7b8 | ||
![]() |
8e6c490c62 | ||
![]() |
ccda70fe53 | ||
![]() |
26c42e4f0d | ||
![]() |
3244dd52eb | ||
![]() |
4c6807a0c2 | ||
![]() |
03a6a2749a | ||
![]() |
82f69456e9 | ||
![]() |
6beda371fb | ||
![]() |
5b9cb2efc5 | ||
![]() |
733968723c | ||
![]() |
63c81d67f2 | ||
![]() |
ad8ba1dd24 | ||
![]() |
04f821e3e1 | ||
![]() |
4937985e2c | ||
![]() |
5fd7d83a70 | ||
![]() |
699a19d202 | ||
![]() |
0b42938197 | ||
![]() |
1e2bfb6216 | ||
![]() |
f755a4b23f | ||
![]() |
4f58e12fca | ||
![]() |
588cf89531 | ||
![]() |
4fe2dd2706 | ||
![]() |
11ad605cd6 | ||
![]() |
fa9f160bd1 | ||
![]() |
dae1fad54e | ||
![]() |
52200188d4 | ||
![]() |
0d74b9ef0b | ||
![]() |
549163d274 | ||
![]() |
755018c783 | ||
![]() |
2a1c4b3a1c | ||
![]() |
aae0d825e7 | ||
![]() |
855dbfab16 | ||
![]() |
f3a357c559 | ||
![]() |
63995e8c61 | ||
![]() |
7062d9b8f8 | ||
![]() |
ede62f5c75 | ||
![]() |
6386770ff3 | ||
![]() |
b4e831a81f | ||
![]() |
9b283360ce | ||
![]() |
fabbd4d156 | ||
![]() |
9bea5bf5f7 | ||
![]() |
9fbc990493 | ||
![]() |
b05fdaaa73 | ||
![]() |
52d5d4d64c | ||
![]() |
6ec712466c | ||
![]() |
6616b8dc07 | ||
![]() |
807457c718 | ||
![]() |
13d2a40903 | ||
![]() |
022b196d6a | ||
![]() |
7a64216830 | ||
![]() |
bf7d2bd465 | ||
![]() |
6e97b591de | ||
![]() |
fc7c470966 | ||
![]() |
51492ca121 | ||
![]() |
ce1df84330 | ||
![]() |
9b43e2a715 | ||
![]() |
732cabd6aa | ||
![]() |
7c14801d5c | ||
![]() |
66df09c065 | ||
![]() |
8fd6985316 | ||
![]() |
feac001499 | ||
![]() |
4c47e3a8eb | ||
![]() |
7773b625a5 | ||
![]() |
abe1abec72 | ||
![]() |
023838a96b | ||
![]() |
f4e743acc5 | ||
![]() |
06d58cbda5 | ||
![]() |
d199dea204 | ||
![]() |
5722060ed9 | ||
![]() |
d4f7e727c1 | ||
![]() |
ba9afc3f8e | ||
![]() |
39897bd012 | ||
![]() |
575d563154 | ||
![]() |
2bf46ce2f3 | ||
![]() |
b49a185efc | ||
![]() |
e305ebd1ed | ||
![]() |
6f5c9826f4 | ||
![]() |
6025eaaca9 | ||
![]() |
b2441c3cca | ||
![]() |
a73599e9ee | ||
![]() |
58398f40fa | ||
![]() |
43f5d5a8e8 | ||
![]() |
b20cbd3558 | ||
![]() |
7f835a407c | ||
![]() |
9859974db7 | ||
![]() |
6c24ddd1a0 | ||
![]() |
bd92ef08ec | ||
![]() |
8de6107a17 | ||
![]() |
e639f03ac7 | ||
![]() |
f9aac442c1 | ||
![]() |
5fdf675168 | ||
![]() |
232f81ff48 | ||
![]() |
1c4a6b2274 | ||
![]() |
deb71f8efc | ||
![]() |
4596596d9f | ||
![]() |
bbb6d42f8d | ||
![]() |
01efd0f9f0 | ||
![]() |
2d7597d206 | ||
![]() |
221741c891 | ||
![]() |
9f69beb450 | ||
![]() |
e843d9e9c3 | ||
![]() |
008b3d94fb | ||
![]() |
6756d83c55 | ||
![]() |
b52072a2e3 | ||
![]() |
3afb00d563 | ||
![]() |
a30c94fd2f | ||
![]() |
f50c29a285 | ||
![]() |
f238b0f138 | ||
![]() |
d0a8c98040 | ||
![]() |
b3d161ad97 | ||
![]() |
fce9cf2077 | ||
![]() |
efd0e56697 | ||
![]() |
b94a9bb9d9 | ||
![]() |
c153cc5a29 | ||
![]() |
a680e9a25a | ||
![]() |
3c18c4ef22 | ||
![]() |
c4e11b5976 | ||
![]() |
65be51dd48 | ||
![]() |
9684103f97 | ||
![]() |
f4c647d430 | ||
![]() |
f1eab3b9c1 | ||
![]() |
545d52bd93 | ||
![]() |
4e42198c09 | ||
![]() |
44736a51b9 | ||
![]() |
e675ffd623 | ||
![]() |
1f14e06bd3 | ||
![]() |
9871078269 | ||
![]() |
5e7a7f4d62 | ||
![]() |
7d690c6809 | ||
![]() |
6edb4266d5 | ||
![]() |
799e82d501 | ||
![]() |
a2370bff68 | ||
![]() |
c72f3bcd12 | ||
![]() |
295964a74d | ||
![]() |
d77cda0fae | ||
![]() |
6da072d47d | ||
![]() |
471a5a1b3e | ||
![]() |
cd5da2d237 | ||
![]() |
62f67cd626 | ||
![]() |
70db96d9e5 | ||
![]() |
98470111fb | ||
![]() |
557a3bb01f | ||
![]() |
dee70acdcb | ||
![]() |
862b16879c | ||
![]() |
ed7249558e | ||
![]() |
4f6c6f4d10 | ||
![]() |
650d02d9b3 | ||
![]() |
e4041a2f69 | ||
![]() |
4c284a6d13 | ||
![]() |
e14fc801bd | ||
![]() |
0478d468e0 | ||
![]() |
4ac98710fb | ||
![]() |
f256f6417e | ||
![]() |
ca94d55b62 | ||
![]() |
c11c061113 | ||
![]() |
c15c3eb802 | ||
![]() |
0ce102b782 | ||
![]() |
cc48207a99 | ||
![]() |
353ea5fc5d | ||
![]() |
64138310cc | ||
![]() |
1c4538af72 | ||
![]() |
755b47ef19 | ||
![]() |
c78a5d3cab | ||
![]() |
b9b8d30f3b | ||
![]() |
9be93212c3 | ||
![]() |
89973809af | ||
![]() |
e324af356d | ||
![]() |
f51fc6ed47 | ||
![]() |
ecce98289a | ||
![]() |
23c14aa2e4 | ||
![]() |
678d04c5db | ||
![]() |
691ba75372 | ||
![]() |
d2d7bbc632 | ||
![]() |
b3b1a6bdb9 | ||
![]() |
310125ea01 | ||
![]() |
208d1cbba2 | ||
![]() |
e94154ba80 | ||
![]() |
582fbdd9e7 | ||
![]() |
dd175912f4 | ||
![]() |
a6a0ae7a51 | ||
![]() |
8cdac91a01 | ||
![]() |
4c89f41daa | ||
![]() |
512e826a42 | ||
![]() |
bc0d277a21 | ||
![]() |
169fe5fc5b | ||
![]() |
30867702a4 | ||
![]() |
6131f92ae6 | ||
![]() |
823a52583c | ||
![]() |
e2c6c0539f | ||
![]() |
f7f1c0e90d | ||
![]() |
eca12607dd | ||
![]() |
006e3e11f9 | ||
![]() |
a9982cbdca | ||
![]() |
0fa9c5a2a2 | ||
![]() |
cdcc9729d3 | ||
![]() |
4acf651aa7 | ||
![]() |
4bba791c65 | ||
![]() |
662688d3b9 | ||
![]() |
21a3e8fdc4 | ||
![]() |
3815a1d538 | ||
![]() |
cbe0c5cfec | ||
![]() |
15db9b30e1 | ||
![]() |
e891294c0f | ||
![]() |
f6b9e7cc26 | ||
![]() |
052fd7162f | ||
![]() |
189acb73f5 | ||
![]() |
ec7c1677b4 | ||
![]() |
a9474c8e67 | ||
![]() |
3a70dfc5f3 | ||
![]() |
669177d803 | ||
![]() |
b1f43b061c | ||
![]() |
7ff3c84deb | ||
![]() |
ee642b63ce | ||
![]() |
17315e5096 | ||
![]() |
4e9d52fc62 | ||
![]() |
d7e87f8fc8 | ||
![]() |
3efe11f393 | ||
![]() |
26c6c464d8 | ||
![]() |
4db654e653 | ||
![]() |
048759d374 | ||
![]() |
db2424057f | ||
![]() |
472a53e3b9 | ||
![]() |
9e15d91900 | ||
![]() |
d5cff281c0 | ||
![]() |
57b6c4dffb | ||
![]() |
908a2d1d8c | ||
![]() |
69bdea9273 | ||
![]() |
5b21a653ee | ||
![]() |
cfddcf1630 | ||
![]() |
f009687ddf | ||
![]() |
6ddfe29465 | ||
![]() |
715c51f673 | ||
![]() |
b443e8f06a | ||
![]() |
0bd0466c9c | ||
![]() |
ad5db3c9e5 | ||
![]() |
fa3182cb5e | ||
![]() |
3f44bed66e | ||
![]() |
2a70530d0f | ||
![]() |
7c542d5fc7 | ||
![]() |
638dfb7777 | ||
![]() |
1323536a63 | ||
![]() |
419212e2d4 | ||
![]() |
5f1c234a7d | ||
![]() |
db1e8301cd | ||
![]() |
bf94a3c68d | ||
![]() |
96baa4ffc6 | ||
![]() |
7d472afe61 | ||
![]() |
f32a4d33a7 | ||
![]() |
0722991955 | ||
![]() |
bcc740cdbc | ||
![]() |
5cf46097f7 | ||
![]() |
61dc189f8b | ||
![]() |
23c2b008c9 | ||
![]() |
db14afdf3a | ||
![]() |
b7927336d1 | ||
![]() |
ee23a3d4cd | ||
![]() |
63c0112ffb | ||
![]() |
db08d7d280 | ||
![]() |
9892525fbc | ||
![]() |
34b87ff6bf | ||
![]() |
241ad68bd5 | ||
![]() |
a0ec18921b | ||
![]() |
45e17eb0b2 | ||
![]() |
59f0e9ae67 | ||
![]() |
af24611c73 | ||
![]() |
d4502dda3f | ||
![]() |
c0efa8af5d | ||
![]() |
1c06a3fc89 | ||
![]() |
c19fb38d1c | ||
![]() |
5dc1de9daf | ||
![]() |
6774301938 | ||
![]() |
4ef6cf0428 | ||
![]() |
ca5f8e4b44 | ||
![]() |
1907f03abe | ||
![]() |
6351a4e4f3 | ||
![]() |
fa34c3937f | ||
![]() |
cdac97ebf5 | ||
![]() |
fe958d28b8 | ||
![]() |
f71982e1d5 | ||
![]() |
cb2bfcea53 | ||
![]() |
4a9d5bbceb | ||
![]() |
10809eade6 | ||
![]() |
43d63527f8 | ||
![]() |
df51eb54ed | ||
![]() |
b47109ab4d | ||
![]() |
15b2b68940 | ||
![]() |
62a239f6fe | ||
![]() |
d89bc95a0a | ||
![]() |
2a76f21b31 | ||
![]() |
f07e22d742 | ||
![]() |
058ab7a1ea | ||
![]() |
fae3baa640 | ||
![]() |
2c4da9c634 | ||
![]() |
8de0313aca | ||
![]() |
143c5b17f9 | ||
![]() |
ec32fde60d | ||
![]() |
f2ac5d4995 | ||
![]() |
716962af03 | ||
![]() |
156efde6b9 | ||
![]() |
a9b7716dfe | ||
![]() |
76a67a6715 | ||
![]() |
c3defdcda4 | ||
![]() |
d8092aa916 | ||
![]() |
8b5a3d31aa | ||
![]() |
11761b66b2 | ||
![]() |
f83f107bd1 | ||
![]() |
f1b90857ff | ||
![]() |
5aea4cdd65 | ||
![]() |
1822a59c70 | ||
![]() |
37c6934802 | ||
![]() |
90c7f747a4 | ||
![]() |
b7efa3dcd6 | ||
![]() |
da80f537ac | ||
![]() |
0119912318 | ||
![]() |
5e0b1d0161 | ||
![]() |
35145d100b | ||
![]() |
584dd0ba89 | ||
![]() |
e5f5dc56c9 | ||
![]() |
880efb012a | ||
![]() |
b95308ac24 | ||
![]() |
3b192ad357 | ||
![]() |
b04938ac5e | ||
![]() |
56410ac1f2 | ||
![]() |
45a2eadc58 | ||
![]() |
0e03151505 | ||
![]() |
3e9706e6ce | ||
![]() |
a1646a7a88 | ||
![]() |
434511658b | ||
![]() |
04230fdd9c | ||
![]() |
2e16ad8a2a | ||
![]() |
7fb59b0fa9 | ||
![]() |
24e044bcda | ||
![]() |
1093656ec5 | ||
![]() |
674e997060 | ||
![]() |
37fd124f56 | ||
![]() |
7df2e67312 | ||
![]() |
8ea1f0796c | ||
![]() |
00fb5bc6cf | ||
![]() |
5e01f726d3 | ||
![]() |
e87290aeea | ||
![]() |
e7236beedd | ||
![]() |
5a6f54c96c | ||
![]() |
7769985439 | ||
![]() |
f4afdb21b2 | ||
![]() |
cc1b9e0a50 | ||
![]() |
2c58740cbb | ||
![]() |
808533b110 | ||
![]() |
e04a15bb99 | ||
![]() |
26d4074a61 | ||
![]() |
0137de5ca2 | ||
![]() |
b0a1b2edba | ||
![]() |
355c560ddc | ||
![]() |
72f286d9c6 | ||
![]() |
db6786414a | ||
![]() |
f8f046f193 | ||
![]() |
6c9ad4ded2 | ||
![]() |
32cae8ca11 | ||
![]() |
0cb65279d9 | ||
![]() |
412da06554 | ||
![]() |
247f8a2778 | ||
![]() |
017c9a6a70 | ||
![]() |
eccb2430b5 | ||
![]() |
5c64ebf1cc | ||
![]() |
1d7796805c | ||
![]() |
3479aaf6f6 | ||
![]() |
d2071cf05c | ||
![]() |
fb75508258 | ||
![]() |
0e69168382 | ||
![]() |
9970ab8643 | ||
![]() |
7ff82010c3 | ||
![]() |
1da8cd53d2 | ||
![]() |
9337a89eac | ||
![]() |
510564dd91 | ||
![]() |
a9ededc997 | ||
![]() |
722cffbd48 | ||
![]() |
a787befd72 | ||
![]() |
8ddd71a65a | ||
![]() |
280e1ec16d | ||
![]() |
52cf10cb2e | ||
![]() |
c12082affc | ||
![]() |
c0d7d74dac | ||
![]() |
df72b24ad2 | ||
![]() |
26bdd15400 | ||
![]() |
e13310b4e0 | ||
![]() |
e9d4218705 | ||
![]() |
56b80e4e60 | ||
![]() |
679f6471e6 | ||
![]() |
984179695c | ||
![]() |
5cca484a82 | ||
![]() |
d91e2296b0 | ||
![]() |
59768c16e2 | ||
![]() |
580efeae1a | ||
![]() |
0a3b508c8a | ||
![]() |
5e2f590b76 | ||
![]() |
ee94396afa | ||
![]() |
98764b6356 | ||
![]() |
f01cc4d0d0 | ||
![]() |
4c0f17429b | ||
![]() |
6a2ae1c572 | ||
![]() |
a2681ce6cc | ||
![]() |
4e43606932 | ||
![]() |
28c0c3207a | ||
![]() |
ecfa0e2b49 | ||
![]() |
ec3122f320 | ||
![]() |
7e4b4c973c | ||
![]() |
64753df2dd | ||
![]() |
75b36ab886 | ||
![]() |
208a78c748 | ||
![]() |
027249c575 | ||
![]() |
5ceb960205 | ||
![]() |
1cea156c5a | ||
![]() |
e1efa1ecbc | ||
![]() |
517de5e179 | ||
![]() |
825b62a2a9 | ||
![]() |
5ec817776c | ||
![]() |
3ad0519add | ||
![]() |
9868522341 | ||
![]() |
5b8d8c617f | ||
![]() |
a1f66061e3 | ||
![]() |
d8811933c9 | ||
![]() |
c9864dde8d | ||
![]() |
ca849d6649 | ||
![]() |
95a2354a86 | ||
![]() |
538e0ac48c | ||
![]() |
1c17411f04 | ||
![]() |
cbe0f89548 | ||
![]() |
615b071dcb | ||
![]() |
2d74f121aa | ||
![]() |
f65c180b8f | ||
![]() |
eb389c472d | ||
![]() |
befdf08035 | ||
![]() |
7a43ac865e | ||
![]() |
c43fcf9fbf | ||
![]() |
472a633010 | ||
![]() |
fc46acb2e4 | ||
![]() |
7fde66eb40 | ||
![]() |
b3cea3997d | ||
![]() |
2f20193086 | ||
![]() |
601e207f04 | ||
![]() |
f0d3d8b276 | ||
![]() |
e02d34f023 | ||
![]() |
0504be84b6 | ||
![]() |
216f020b70 | ||
![]() |
66505eedfa | ||
![]() |
b307c7d88b | ||
![]() |
47d4445fa8 | ||
![]() |
7098d2633a | ||
![]() |
61b5393b54 | ||
![]() |
6fe2cf13b6 | ||
![]() |
cc971eb2df | ||
![]() |
a260987f5c | ||
![]() |
5eb8f44dfc | ||
![]() |
e36131b38b | ||
![]() |
b67868afde | ||
![]() |
328fdee281 | ||
![]() |
8ab43e98fe | ||
![]() |
4f407ccc03 | ||
![]() |
5f3fddd3e4 | ||
![]() |
392f3b536d | ||
![]() |
155de2b396 | ||
![]() |
6c9930ac2a | ||
![]() |
9dddf4f4bc | ||
![]() |
314506c15c | ||
673222da6c | |||
![]() |
58b97e6361 | ||
![]() |
8bc2032b07 | ||
![]() |
40d4354dfc | ||
![]() |
27f2f5bb2b | ||
![]() |
490b934269 | ||
![]() |
e2e2b4d176 | ||
![]() |
7a1763bbee | ||
![]() |
ca8904b6bb | ||
![]() |
6384b28689 | ||
![]() |
e661466558 | ||
![]() |
8faf2beba4 | ||
![]() |
fb29319ec6 | ||
![]() |
7779d7d193 | ||
![]() |
2c5246b62f | ||
![]() |
e43a3f4518 | ||
![]() |
b5716f7a6d | ||
![]() |
fac5a3cc6f | ||
![]() |
671793078a | ||
![]() |
4f5ea1696f | ||
![]() |
b3e47e3bac | ||
![]() |
d67e990065 | ||
![]() |
7fb6f4b47f | ||
![]() |
df3b435a1f | ||
![]() |
5b65f1b544 | ||
![]() |
e159866d3b | ||
![]() |
aa0ce71612 | ||
![]() |
522e547f99 | ||
![]() |
9430341d4e | ||
![]() |
95838d045d | ||
![]() |
20832f11b6 | ||
![]() |
258203f400 | ||
![]() |
3b1768fa4e | ||
![]() |
23a3085bad | ||
![]() |
78c12e0ea6 | ||
![]() |
997cb85663 | ||
![]() |
968d5eabfa | ||
![]() |
590ce1f7ed | ||
![]() |
416a8838e4 | ||
![]() |
f6c349ac31 | ||
![]() |
517c6b40b5 | ||
![]() |
1fa78935a6 | ||
![]() |
4ddcd56740 | ||
![]() |
e5a2f33584 | ||
![]() |
c17cf3256a | ||
![]() |
5415bda02d | ||
![]() |
07cbaeb7aa | ||
![]() |
9d5aa83786 | ||
![]() |
463164cb88 | ||
![]() |
4809742088 | ||
![]() |
9cf0e285b4 | ||
![]() |
a6ca6f1cf9 | ||
![]() |
bd7479e1c0 | ||
![]() |
b35b51c203 | ||
![]() |
5652774888 | ||
![]() |
836e9a2fbc | ||
![]() |
64538c255d | ||
![]() |
62a9293dcf | ||
![]() |
1faae92f33 | ||
![]() |
dee808752f | ||
![]() |
5590af6995 | ||
![]() |
5afd161fba | ||
![]() |
336efa1e8b | ||
![]() |
568d5ca4ff | ||
![]() |
a9991f2a50 | ||
![]() |
1c8096444a | ||
![]() |
f424de46e6 | ||
![]() |
8fcca05565 | ||
![]() |
ed1f3cec59 | ||
![]() |
c29a409f28 | ||
![]() |
1a46936ad6 | ||
![]() |
e82abfb948 | ||
![]() |
c3409be780 | ||
![]() |
1557ab3474 | ||
![]() |
75fdda4fbf | ||
![]() |
4d75ef2849 | ||
![]() |
a1da23d1ba | ||
![]() |
c4bc751df7 | ||
![]() |
972d89ec6e | ||
![]() |
70f040e104 | ||
![]() |
d4de0b49c8 | ||
![]() |
2a42d58361 | ||
![]() |
14308956d7 | ||
![]() |
71339a66d7 | ||
![]() |
85f0664b56 | ||
![]() |
2f86ac0dfa | ||
![]() |
79d7b7a08d | ||
![]() |
b550d1990e | ||
![]() |
22062f0c77 | ||
![]() |
515f613a53 | ||
![]() |
615ed6b713 | ||
![]() |
f6eab62c3c | ||
![]() |
7d1e00ff0d | ||
![]() |
692439953c | ||
![]() |
6960a34d02 | ||
![]() |
b3662d4e6e | ||
![]() |
50c9b7c352 | ||
![]() |
f395d3b2bf | ||
![]() |
4fbf6cbc50 | ||
![]() |
9916958d6c | ||
![]() |
184a069c7f | ||
![]() |
0b65346633 | ||
![]() |
11f23dcc9e | ||
![]() |
f80d1defcb | ||
![]() |
e95d6343cb | ||
![]() |
a9052a068f | ||
![]() |
b1323c0d67 | ||
![]() |
87ceb8fb58 | ||
![]() |
c3134b9426 | ||
![]() |
06c036d373 | ||
![]() |
2f8bd29725 | ||
![]() |
1eae211b41 | ||
![]() |
b02eb7a422 | ||
![]() |
3db31e9347 | ||
![]() |
1dc6045ae1 | ||
![]() |
2436164b1e | ||
![]() |
c13fc8a805 | ||
![]() |
41025d78de | ||
![]() |
b3ad222cdc | ||
![]() |
efd9ed0a5f | ||
![]() |
9d20061924 | ||
![]() |
ddfe8cf361 | ||
![]() |
93c83f773a | ||
![]() |
876e16fa9e | ||
![]() |
37067d5c72 | ||
![]() |
083ac8cfa3 | ||
![]() |
fe6c1ae452 | ||
![]() |
30165f5047 | ||
![]() |
3046c61447 | ||
![]() |
ced50bb2e8 | ||
![]() |
dee84bcc63 | ||
![]() |
0f0bafb66a | ||
![]() |
7cdc3611a5 | ||
![]() |
6eda6aebba | ||
![]() |
2d23c81ebb | ||
![]() |
5602058849 | ||
![]() |
b1ec021c1e | ||
![]() |
7073b2410b | ||
![]() |
ab9068bc0a | ||
![]() |
0c66fb474e | ||
![]() |
fef6c651ea | ||
![]() |
620f54344f | ||
![]() |
ef1259a87a | ||
![]() |
5ef4af6b55 | ||
![]() |
6d17304e4e | ||
![]() |
2e4062b5db | ||
![]() |
b294bdd013 | ||
![]() |
dc95c7fc2c | ||
![]() |
dfe8c43c33 | ||
![]() |
3e54ad5a68 | ||
![]() |
288c66d8a2 | ||
![]() |
44c8a97f44 | ||
![]() |
60c27b1dea | ||
![]() |
ce8b77b240 | ||
![]() |
718c5fb30e | ||
419160724c | |||
![]() |
c905dfe6d8 | ||
![]() |
70eb008412 | ||
![]() |
93feaadacf | ||
![]() |
0b7610607d | ||
![]() |
922fea5395 | ||
![]() |
1841b7c4e6 | ||
![]() |
ed966faaf4 | ||
![]() |
03efeed6ae | ||
![]() |
675c5ae480 | ||
![]() |
d575b22e2e | ||
![]() |
5e4ee1b60f | ||
![]() |
d8ce20c2f9 | ||
![]() |
b164dc1b55 | ||
![]() |
530eba3d00 | ||
![]() |
808066f2e2 | ||
![]() |
cb3e683c8e | ||
![]() |
6ff57775ed | ||
![]() |
6c07687a86 | ||
![]() |
497a8c19c5 | ||
![]() |
c13f7468ef | ||
![]() |
847872cdb6 | ||
![]() |
f0abe5d80d | ||
![]() |
465c5b9e77 | ||
fb78cdd304 | |||
![]() |
5b17fe2410 | ||
![]() |
5fd54dccd3 | ||
![]() |
1695afd915 | ||
![]() |
5ab549ae96 | ||
![]() |
35123e7c1e | ||
![]() |
1badade841 | ||
![]() |
b357625529 | ||
![]() |
9ccd39d724 | ||
![]() |
c876079e04 | ||
![]() |
162c1c59fe | ||
![]() |
06ef1c1182 | ||
![]() |
a9ba9789fd | ||
![]() |
fdd32cb954 | ||
![]() |
9fd7d86998 | ||
![]() |
5973903313 | ||
![]() |
75e4b19b88 | ||
![]() |
af7bdb55a1 | ||
![]() |
69af9aeff0 | ||
![]() |
88f4192d61 | ||
![]() |
96db8a326e | ||
![]() |
8c06767fdc | ||
![]() |
25877e369b | ||
![]() |
0271a475a2 | ||
![]() |
eef3ab5a15 | ||
![]() |
26f48c5820 | ||
![]() |
236ca36c79 | ||
![]() |
405b9ba7ea | ||
![]() |
ab9bd76d34 | ||
![]() |
677da7d80a | ||
![]() |
b3ad2fd715 | ||
![]() |
97ca6ce5b8 | ||
![]() |
e1abc4374e | ||
![]() |
9eeeb15c6c |
1
.github/workflows/checkNewPlugins.yml
vendored
1
.github/workflows/checkNewPlugins.yml
vendored
@@ -14,6 +14,7 @@ jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'JetBrains/ideavim'
|
||||
|
||||
steps:
|
||||
- name: Fetch origin repo
|
||||
|
1
.github/workflows/closeYoutrackOnCommit.yml
vendored
1
.github/workflows/closeYoutrackOnCommit.yml
vendored
@@ -12,6 +12,7 @@ jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'JetBrains/ideavim'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
1
.github/workflows/integrationsTest.yml
vendored
1
.github/workflows/integrationsTest.yml
vendored
@@ -12,6 +12,7 @@ jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'JetBrains/ideavim'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
1
.github/workflows/kover.yml
vendored
1
.github/workflows/kover.yml
vendored
@@ -12,6 +12,7 @@ jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'JetBrains/ideavim'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
2
.github/workflows/mergeDependabotPR.yml
vendored
2
.github/workflows/mergeDependabotPR.yml
vendored
@@ -8,7 +8,7 @@ permissions:
|
||||
jobs:
|
||||
dependabot:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.actor == 'dependabot[bot]' }}
|
||||
if: ${{ github.actor == 'dependabot[bot]' && github.repository == 'JetBrains/ideavim' }}
|
||||
steps:
|
||||
- name: Auto-merge Dependabot PR
|
||||
run: gh pr merge --auto --rebase "$PR_URL"
|
||||
|
2
.github/workflows/mergePr.yml
vendored
2
.github/workflows/mergePr.yml
vendored
@@ -11,7 +11,7 @@ on:
|
||||
jobs:
|
||||
build:
|
||||
|
||||
if: github.event.pull_request.merged == true
|
||||
if: github.event.pull_request.merged == true && github.repository == 'JetBrains/ideavim'
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
|
87
.github/workflows/runUiOctopusTests.yml
vendored
Normal file
87
.github/workflows/runUiOctopusTests.yml
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
name: Run Non Octopus UI Tests
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '0 12 * * *'
|
||||
jobs:
|
||||
build-for-ui-test-mac-os:
|
||||
if: github.repository == 'JetBrains/ideavim'
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Apply Patch
|
||||
run: |
|
||||
git apply tests/ui-ij-tests/src/test/kotlin/ui/octopus.patch
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: zulu
|
||||
java-version: 17
|
||||
- name: Setup FFmpeg
|
||||
uses: FedericoCarboni/setup-ffmpeg@v3
|
||||
with:
|
||||
# Not strictly necessary, but it may prevent rate limit
|
||||
# errors especially on GitHub-hosted macos machines.
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Setup Gradle
|
||||
uses: gradle/gradle-build-action@v2.4.2
|
||||
- name: Build Plugin
|
||||
run: gradle :buildPlugin
|
||||
- name: Run Idea
|
||||
run: |
|
||||
mkdir -p build/reports
|
||||
gradle runIdeForUiTests > build/reports/idea.log &
|
||||
- name: Wait for Idea started
|
||||
uses: jtalk/url-health-check-action@v3
|
||||
with:
|
||||
url: http://127.0.0.1:8082
|
||||
max-attempts: 20
|
||||
retry-delay: 10s
|
||||
- name: Tests
|
||||
run: gradle :tests:ui-ij-tests:testUi
|
||||
- name: Move video
|
||||
if: always()
|
||||
run: mv tests/ui-ij-tests/video build/reports
|
||||
- name: Move sandbox logs
|
||||
if: always()
|
||||
run: mv build/idea-sandbox/system/log sandbox-idea-log
|
||||
- name: Save report
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ui-test-fails-report-mac
|
||||
path: |
|
||||
build/reports
|
||||
sandbox-idea-log
|
||||
# build-for-ui-test-linux:
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - uses: actions/checkout@v2
|
||||
# - name: Setup Java
|
||||
# uses: actions/setup-java@v2.1.0
|
||||
# with:
|
||||
# distribution: zulu
|
||||
# java-version: 11
|
||||
# - name: Build Plugin
|
||||
# run: gradle :buildPlugin
|
||||
# - name: Run Idea
|
||||
# run: |
|
||||
# export DISPLAY=:99.0
|
||||
# Xvfb -ac :99 -screen 0 1920x1080x16 &
|
||||
# mkdir -p build/reports
|
||||
# gradle :runIdeForUiTests #> build/reports/idea.log
|
||||
# - name: Wait for Idea started
|
||||
# uses: jtalk/url-health-check-action@1.5
|
||||
# with:
|
||||
# url: http://127.0.0.1:8082
|
||||
# max-attempts: 15
|
||||
# retry-delay: 30s
|
||||
# - name: Tests
|
||||
# run: gradle :testUi
|
||||
# - name: Save fails report
|
||||
# if: ${{ failure() }}
|
||||
# uses: actions/upload-artifact@v2
|
||||
# with:
|
||||
# name: ui-test-fails-report-linux
|
||||
# path: |
|
||||
# ui-test-example/build/reports
|
55
.github/workflows/runUiPyTests.yml
vendored
Normal file
55
.github/workflows/runUiPyTests.yml
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
name: Run UI PyCharm Tests
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '0 12 * * *'
|
||||
jobs:
|
||||
build-for-ui-test-mac-os:
|
||||
if: github.repository == 'JetBrains/ideavim'
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: zulu
|
||||
java-version: 17
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.10'
|
||||
- name: Setup FFmpeg
|
||||
uses: FedericoCarboni/setup-ffmpeg@v3
|
||||
with:
|
||||
# Not strictly necessary, but it may prevent rate limit
|
||||
# errors especially on GitHub-hosted macos machines.
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Setup Gradle
|
||||
uses: gradle/gradle-build-action@v2.4.2
|
||||
- name: Build Plugin
|
||||
run: gradle :buildPlugin
|
||||
- name: Run Idea
|
||||
run: |
|
||||
mkdir -p build/reports
|
||||
gradle :runIdeForUiTests -PideaType=PC > build/reports/idea.log &
|
||||
- name: Wait for Idea started
|
||||
uses: jtalk/url-health-check-action@v3
|
||||
with:
|
||||
url: http://127.0.0.1:8082
|
||||
max-attempts: 20
|
||||
retry-delay: 10s
|
||||
- name: Tests
|
||||
run: gradle :tests:ui-py-tests:testUi
|
||||
- name: Move video
|
||||
if: always()
|
||||
run: mv tests/ui-py-tests/video build/reports
|
||||
- name: Move sandbox logs
|
||||
if: always()
|
||||
run: mv build/idea-sandbox/system/log sandbox-idea-log
|
||||
- name: Save report
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ui-test-fails-report-mac
|
||||
path: |
|
||||
build/reports
|
||||
sandbox-idea-log
|
33
.github/workflows/runUiTests.yml
vendored
33
.github/workflows/runUiTests.yml
vendored
@@ -5,44 +5,51 @@ on:
|
||||
- cron: '0 12 * * *'
|
||||
jobs:
|
||||
build-for-ui-test-mac-os:
|
||||
if: github.repository == 'JetBrains/ideavim'
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v2.1.0
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: zulu
|
||||
java-version: 11
|
||||
java-version: 17
|
||||
- name: Setup FFmpeg
|
||||
uses: FedericoCarboni/setup-ffmpeg@v1
|
||||
uses: FedericoCarboni/setup-ffmpeg@v3
|
||||
with:
|
||||
# Not strictly necessary, but it may prevent rate limit
|
||||
# errors especially on GitHub-hosted macos machines.
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Setup Gradle
|
||||
uses: gradle/gradle-build-action@v2.4.2
|
||||
- name: Build Plugin
|
||||
run: gradle :buildPlugin
|
||||
- name: Run Idea
|
||||
run: |
|
||||
mkdir -p build/reports
|
||||
gradle :runIdeForUiTests > build/reports/idea.log &
|
||||
gradle runIdeForUiTests > build/reports/idea.log &
|
||||
- name: Wait for Idea started
|
||||
uses: jtalk/url-health-check-action@1.5
|
||||
uses: jtalk/url-health-check-action@v3
|
||||
with:
|
||||
url: http://127.0.0.1:8082
|
||||
max-attempts: 20
|
||||
retry-delay: 10s
|
||||
- name: Tests
|
||||
run: gradle :testUi
|
||||
run: gradle :tests:ui-ij-tests:testUi
|
||||
- name: Move video
|
||||
if: ${{ failure() }}
|
||||
run: mv video build/reports
|
||||
- name: Save fails report
|
||||
if: ${{ failure() }}
|
||||
uses: actions/upload-artifact@v2
|
||||
if: always()
|
||||
run: mv tests/ui-ij-tests/video build/reports
|
||||
- name: Move sandbox logs
|
||||
if: always()
|
||||
run: mv build/idea-sandbox/system/log sandbox-idea-log
|
||||
- name: Save report
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ui-test-fails-report-mac
|
||||
path: |
|
||||
build/reports
|
||||
sandbox-idea-log
|
||||
# build-for-ui-test-linux:
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
|
1
.github/workflows/syncDoc.yml
vendored
1
.github/workflows/syncDoc.yml
vendored
@@ -14,6 +14,7 @@ jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'JetBrains/ideavim'
|
||||
|
||||
steps:
|
||||
- name: Fetch origin repo
|
||||
|
1
.github/workflows/updateAffectedRate.yml
vendored
1
.github/workflows/updateAffectedRate.yml
vendored
@@ -14,6 +14,7 @@ jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'JetBrains/ideavim'
|
||||
|
||||
steps:
|
||||
- name: Fetch origin repo
|
||||
|
1
.github/workflows/updateAuthors.yml
vendored
1
.github/workflows/updateAuthors.yml
vendored
@@ -15,6 +15,7 @@ jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'JetBrains/ideavim'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
1
.github/workflows/updateChangelog.yml
vendored
1
.github/workflows/updateChangelog.yml
vendored
@@ -15,6 +15,7 @@ jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'JetBrains/ideavim'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
1
.github/workflows/updateFormatting.yml
vendored
1
.github/workflows/updateFormatting.yml
vendored
@@ -12,6 +12,7 @@ jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'JetBrains/ideavim'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
4
.gitignore
vendored
4
.gitignore
vendored
@@ -23,6 +23,10 @@
|
||||
|
||||
# Generated by gradle task "generateGrammarSource"
|
||||
src/main/java/com/maddyhome/idea/vim/vimscript/parser/generated
|
||||
vim-engine/src/main/java/com/maddyhome/idea/vim/regexp/parser/generated
|
||||
# Generated JSONs for lazy classloading
|
||||
/vim-engine/src/main/resources/ksp-generated
|
||||
/src/main/resources/ksp-generated
|
||||
|
||||
# Created by github automation
|
||||
settings.xml
|
||||
|
2
.idea/copyright/IdeaVim.xml
generated
2
.idea/copyright/IdeaVim.xml
generated
@@ -1,6 +1,6 @@
|
||||
<component name="CopyrightManager">
|
||||
<copyright>
|
||||
<option name="notice" value="Copyright 2003-2023 The IdeaVim authors Use of this source code is governed by an MIT-style license that can be found in the LICENSE.txt file or at https://opensource.org/licenses/MIT." />
|
||||
<option name="notice" value="Copyright 2003-&#36;today.year The IdeaVim authors Use of this source code is governed by an MIT-style license that can be found in the LICENSE.txt file or at https://opensource.org/licenses/MIT." />
|
||||
<option name="myName" value="IdeaVim" />
|
||||
</copyright>
|
||||
</component>
|
18
.teamcity/_Self/Constants.kt
vendored
18
.teamcity/_Self/Constants.kt
vendored
@@ -5,15 +5,13 @@ object Constants {
|
||||
const val EAP_CHANNEL = "eap"
|
||||
const val DEV_CHANNEL = "Dev"
|
||||
|
||||
const val VERSION = "2.4.0"
|
||||
const val GITHUB_TESTS = "2023.3.2"
|
||||
const val NVIM_TESTS = "2023.3.2"
|
||||
const val PROPERTY_TESTS = "2023.3.2"
|
||||
const val LONG_RUNNING_TESTS = "2023.3.2"
|
||||
const val QODANA_TESTS = "2023.3.2"
|
||||
const val RELEASE = "2023.3.2"
|
||||
|
||||
const val GITHUB_TESTS = "LATEST-EAP-SNAPSHOT"
|
||||
const val NVIM_TESTS = "LATEST-EAP-SNAPSHOT"
|
||||
const val PROPERTY_TESTS = "LATEST-EAP-SNAPSHOT"
|
||||
const val LONG_RUNNING_TESTS = "LATEST-EAP-SNAPSHOT"
|
||||
const val QODANA_TESTS = "LATEST-EAP-SNAPSHOT"
|
||||
const val RELEASE = "2023.1.2"
|
||||
|
||||
const val RELEASE_DEV = "2023.1.2"
|
||||
const val RELEASE_EAP = "2023.1.2"
|
||||
const val RELEASE_DEV = "2023.3.2"
|
||||
const val RELEASE_EAP = "2023.3.2"
|
||||
}
|
||||
|
8
.teamcity/_Self/Project.kt
vendored
8
.teamcity/_Self/Project.kt
vendored
@@ -15,7 +15,7 @@ import jetbrains.buildServer.configs.kotlin.v2019_2.BuildType
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.Project
|
||||
|
||||
object Project : Project({
|
||||
description = "Vim engine for IDEs based on the IntelliJ platform"
|
||||
description = "Vim engine for JetBrains IDEs"
|
||||
|
||||
subProjects(Releases, OldTests, GitHub)
|
||||
|
||||
@@ -24,6 +24,7 @@ object Project : Project({
|
||||
|
||||
// Active tests
|
||||
buildType(TestingBuildType("Latest EAP", "<default>", version = "LATEST-EAP-SNAPSHOT"))
|
||||
buildType(TestingBuildType("2023.3", "<default>", version = "2023.3"))
|
||||
buildType(TestingBuildType("Latest EAP With Xorg", "<default>", version = "LATEST-EAP-SNAPSHOT"))
|
||||
|
||||
buildType(PropertyBased)
|
||||
@@ -38,6 +39,11 @@ object Project : Project({
|
||||
|
||||
// Common build type for all configurations
|
||||
abstract class IdeaVimBuildType(init: BuildType.() -> Unit) : BuildType({
|
||||
artifactRules = """
|
||||
+:build/reports => build/reports
|
||||
+:/mnt/agent/temp/buildTmp/ => /mnt/agent/temp/buildTmp/
|
||||
""".trimIndent()
|
||||
|
||||
init()
|
||||
|
||||
requirements {
|
||||
|
1
.teamcity/_Self/buildTypes/Compatibility.kt
vendored
1
.teamcity/_Self/buildTypes/Compatibility.kt
vendored
@@ -34,7 +34,6 @@ object Compatibility : IdeaVimBuildType({
|
||||
|
||||
java --version
|
||||
java -jar verifier1/verifier-cli-dev-all-1.jar check-plugin '${'$'}org.jetbrains.IdeaVim-EasyMotion' [latest-IU] -team-city
|
||||
java -jar verifier1/verifier-cli-dev-all-1.jar check-plugin '${'$'}io.github.mishkun.ideavimsneak' [latest-IU] -team-city
|
||||
java -jar verifier1/verifier-cli-dev-all-1.jar check-plugin '${'$'}eu.theblob42.idea.whichkey' [latest-IU] -team-city
|
||||
java -jar verifier1/verifier-cli-dev-all-1.jar check-plugin '${'$'}IdeaVimExtension' [latest-IU] -team-city
|
||||
# Outdated java -jar verifier/verifier-cli-dev-all.jar check-plugin '${'$'}github.zgqq.intellij-enhance' [latest-IU] -team-city
|
||||
|
2
.teamcity/_Self/buildTypes/LongRunning.kt
vendored
2
.teamcity/_Self/buildTypes/LongRunning.kt
vendored
@@ -25,7 +25,7 @@ object LongRunning : IdeaVimBuildType({
|
||||
|
||||
steps {
|
||||
gradle {
|
||||
tasks = "clean testLongRunning"
|
||||
tasks = "clean :tests:long-running-tests:testLongRunning"
|
||||
buildFile = ""
|
||||
enableStacktrace = true
|
||||
}
|
||||
|
2
.teamcity/_Self/buildTypes/Nvim.kt
vendored
2
.teamcity/_Self/buildTypes/Nvim.kt
vendored
@@ -39,7 +39,7 @@ object Nvim : IdeaVimBuildType({
|
||||
""".trimIndent()
|
||||
}
|
||||
gradle {
|
||||
tasks = "clean testWithNeovim"
|
||||
tasks = "clean test -Dnvim"
|
||||
buildFile = ""
|
||||
enableStacktrace = true
|
||||
}
|
||||
|
2
.teamcity/_Self/buildTypes/PropertyBased.kt
vendored
2
.teamcity/_Self/buildTypes/PropertyBased.kt
vendored
@@ -24,7 +24,7 @@ object PropertyBased : IdeaVimBuildType({
|
||||
|
||||
steps {
|
||||
gradle {
|
||||
tasks = "clean testPropertyBased"
|
||||
tasks = "clean :tests:property-tests:testPropertyBased"
|
||||
buildFile = ""
|
||||
enableStacktrace = true
|
||||
}
|
||||
|
@@ -20,8 +20,8 @@ object PublishVimEngine : IdeaVimBuildType({
|
||||
params {
|
||||
param("env.ORG_GRADLE_PROJECT_engineVersion", "%build.number%")
|
||||
param("env.ORG_GRADLE_PROJECT_uploadUrl", "https://packages.jetbrains.team/maven/p/ij/intellij-dependencies")
|
||||
password("env.ORG_GRADLE_PROJECT_spacePassword", "credentialsJSON:790b4e43-ee83-4184-b81b-678afab60409", display = ParameterDisplay.HIDDEN)
|
||||
param("env.ORG_GRADLE_PROJECT_spaceUsername", "Aleksei.Plate")
|
||||
password("env.ORG_GRADLE_PROJECT_spacePassword", "credentialsJSON:5ea56f8c-efe7-4e1e-83de-0c02bcc39d0b", display = ParameterDisplay.HIDDEN)
|
||||
param("env.ORG_GRADLE_PROJECT_spaceUsername", "a121c67e-39ac-40e6-bf82-649855ec27b6")
|
||||
}
|
||||
|
||||
vcs {
|
||||
|
20
.teamcity/_Self/buildTypes/ReleaseEap.kt
vendored
20
.teamcity/_Self/buildTypes/ReleaseEap.kt
vendored
@@ -5,6 +5,7 @@ import _Self.Constants.RELEASE_EAP
|
||||
import _Self.IdeaVimBuildType
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.CheckoutMode
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.DslContext
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.ParameterDisplay
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.buildFeatures.sshAgent
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.gradle
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.script
|
||||
@@ -30,6 +31,11 @@ object ReleaseEap : IdeaVimBuildType({
|
||||
"credentialsJSON:a8ab8150-e6f8-4eaf-987c-bcd65eac50b5",
|
||||
label = "Slack Token"
|
||||
)
|
||||
password(
|
||||
"env.YOUTRACK_TOKEN",
|
||||
"credentialsJSON:2479995b-7b60-4fbb-b095-f0bafae7f622",
|
||||
display = ParameterDisplay.HIDDEN
|
||||
)
|
||||
}
|
||||
|
||||
vcs {
|
||||
@@ -61,26 +67,26 @@ object ReleaseEap : IdeaVimBuildType({
|
||||
tasks = "scripts:addReleaseTag"
|
||||
}
|
||||
gradle {
|
||||
name = "Publish plugin"
|
||||
tasks = "publishPlugin"
|
||||
}
|
||||
// Same as the script below. However, jgit can't find ssh keys on TeamCity
|
||||
// gradle {
|
||||
// name = "Push changes to the repo"
|
||||
// tasks = "scripts:pushChanges"
|
||||
// }
|
||||
script {
|
||||
name = "Push changes to the repo"
|
||||
scriptContent = """
|
||||
branch=$(git branch --show-current)
|
||||
branch=$(git branch --show-current)
|
||||
echo current branch is ${'$'}branch
|
||||
if [ "master" != "${'$'}branch" ];
|
||||
then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
git push origin %build.number%
|
||||
""".trimIndent()
|
||||
}
|
||||
gradle {
|
||||
name = "YouTrack post release actions"
|
||||
tasks = "scripts:eapReleaseActions"
|
||||
}
|
||||
}
|
||||
|
||||
features {
|
||||
|
71
.teamcity/_Self/buildTypes/ReleasePlugin.kt
vendored
71
.teamcity/_Self/buildTypes/ReleasePlugin.kt
vendored
@@ -45,7 +45,11 @@ sealed class ReleasePlugin(private val releaseType: String) : IdeaVimBuildType({
|
||||
"credentialsJSON:a8ab8150-e6f8-4eaf-987c-bcd65eac50b5",
|
||||
label = "Slack Token"
|
||||
)
|
||||
password("env.ORG_GRADLE_PROJECT_youtrackToken", "credentialsJSON:3cd3e867-282c-451f-b958-bc95d56a8450", display = ParameterDisplay.HIDDEN)
|
||||
password(
|
||||
"env.ORG_GRADLE_PROJECT_youtrackToken",
|
||||
"credentialsJSON:7bc0eb3a-b86a-4ebd-b622-d4ef12d7e1d3",
|
||||
display = ParameterDisplay.HIDDEN
|
||||
)
|
||||
param("env.ORG_GRADLE_PROJECT_releaseType", releaseType)
|
||||
}
|
||||
|
||||
@@ -65,9 +69,25 @@ sealed class ReleasePlugin(private val releaseType: String) : IdeaVimBuildType({
|
||||
name = "Pull git history"
|
||||
scriptContent = "git fetch --unshallow"
|
||||
}
|
||||
gradle {
|
||||
name = "Select branch"
|
||||
tasks = "scripts:selectBranch"
|
||||
script {
|
||||
name = "Reset release branch"
|
||||
scriptContent = """
|
||||
if [ "major" = "$releaseType" ] || [ "minor" = "$releaseType" ]
|
||||
then
|
||||
echo Resetting the release branch because the release type is $releaseType
|
||||
git checkout master
|
||||
latest_eap=${'$'}(git describe --tags --match="[0-9].[0-9]*.[0-9]-eap.[0-9]*" --abbrev=0 HEAD)
|
||||
echo Latest EAP: ${'$'}latest_eap
|
||||
commit_of_latest_eap=${'$'}(git rev-list -n 1 ${'$'}latest_eap)
|
||||
echo Commit of latest EAP: ${'$'}commit_of_latest_eap
|
||||
git checkout release
|
||||
git reset --hard ${'$'}commit_of_latest_eap
|
||||
else
|
||||
git checkout release
|
||||
echo Do not reset the release branch because the release type is $releaseType
|
||||
fi
|
||||
echo Checked out release branch
|
||||
""".trimIndent()
|
||||
}
|
||||
gradle {
|
||||
name = "Calculate new version"
|
||||
@@ -89,40 +109,47 @@ sealed class ReleasePlugin(private val releaseType: String) : IdeaVimBuildType({
|
||||
name = "Add release tag"
|
||||
tasks = "scripts:addReleaseTag"
|
||||
}
|
||||
gradle {
|
||||
name = "Reset release branch"
|
||||
tasks = "scripts:resetReleaseBranch"
|
||||
script {
|
||||
name = "Run tests"
|
||||
scriptContent = "./gradlew test"
|
||||
}
|
||||
gradle {
|
||||
name = "Publish release"
|
||||
tasks = "publishPlugin"
|
||||
}
|
||||
// gradle {
|
||||
// name = "Push changes to the repo"
|
||||
// tasks = "scripts:pushChangesWithReleaseBranch"
|
||||
// }
|
||||
script {
|
||||
name = "Checkout master branch"
|
||||
scriptContent = """
|
||||
echo Checkout master
|
||||
git checkout master
|
||||
""".trimIndent()
|
||||
}
|
||||
gradle {
|
||||
name = "Update change log in master"
|
||||
tasks = "scripts:changelogUpdateUnreleased"
|
||||
}
|
||||
gradle {
|
||||
name = "Commit preparation changes in master"
|
||||
tasks = "scripts:commitChanges"
|
||||
}
|
||||
script {
|
||||
name = "Push changes to the repo"
|
||||
scriptContent = """
|
||||
branch=$(git branch --show-current)
|
||||
echo current branch is ${'$'}branch
|
||||
echo Current branch is ${'$'}branch
|
||||
if [ "master" != "${'$'}branch" ];
|
||||
then
|
||||
git checkout master
|
||||
fi
|
||||
|
||||
git push origin --tags
|
||||
git push origin
|
||||
|
||||
if [ "patch" != $releaseType ];
|
||||
then
|
||||
git checkout release
|
||||
echo checkout release branch
|
||||
git push --tags
|
||||
git push origin --force
|
||||
fi
|
||||
|
||||
git checkout ${'$'}branch
|
||||
git checkout release
|
||||
echo checkout release branch
|
||||
git branch --set-upstream-to=origin/release release
|
||||
git push origin --force
|
||||
# Push tag
|
||||
git push origin %build.number%
|
||||
""".trimIndent()
|
||||
}
|
||||
gradle {
|
||||
|
2
.teamcity/_Self/subprojects/OldTests.kt
vendored
2
.teamcity/_Self/subprojects/OldTests.kt
vendored
@@ -20,4 +20,6 @@ object OldTests : Project({
|
||||
buildType(TestingBuildType("IC-2021.2.2", "203-212", javaVersion = "1.8", javaPlugin = false))
|
||||
buildType(TestingBuildType("IC-2021.3.2", "213-221", javaVersion = "1.8", javaPlugin = false))
|
||||
buildType(TestingBuildType("IC-2022.2.3", branch = "222", javaPlugin = false))
|
||||
buildType(TestingBuildType("IC-2023.1", "231-232", javaPlugin = false))
|
||||
buildType(TestingBuildType("IC-2023.2", "231-232", javaPlugin = false))
|
||||
})
|
||||
|
29
.teamcity/patches/buildTypes/IdeaVimTests_Latest_EAP.kts
vendored
Normal file
29
.teamcity/patches/buildTypes/IdeaVimTests_Latest_EAP.kts
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
package patches.buildTypes
|
||||
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.RelativeId
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.GradleBuildStep
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.gradle
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.ui.changeBuildType
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.ui.expectSteps
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.ui.update
|
||||
|
||||
/*
|
||||
This patch script was generated by TeamCity on settings change in UI.
|
||||
To apply the patch, change the buildType with id = 'IdeaVimTests_Latest_EAP'
|
||||
accordingly, and delete the patch script.
|
||||
*/
|
||||
changeBuildType(RelativeId("IdeaVimTests_Latest_EAP")) {
|
||||
expectSteps {
|
||||
gradle {
|
||||
tasks = "clean test"
|
||||
buildFile = ""
|
||||
enableStacktrace = true
|
||||
}
|
||||
}
|
||||
steps {
|
||||
update<GradleBuildStep>(0) {
|
||||
clearConditions()
|
||||
jdkHome = "/usr/lib/jvm/java-17-amazon-corretto"
|
||||
}
|
||||
}
|
||||
}
|
19
.teamcity/patches/buildTypes/PublishVimEngine.kts
vendored
Normal file
19
.teamcity/patches/buildTypes/PublishVimEngine.kts
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
package patches.buildTypes
|
||||
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.*
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.ui.*
|
||||
|
||||
/*
|
||||
This patch script was generated by TeamCity on settings change in UI.
|
||||
To apply the patch, change the buildType with id = 'PublishVimEngine'
|
||||
accordingly, and delete the patch script.
|
||||
*/
|
||||
changeBuildType(RelativeId("PublishVimEngine")) {
|
||||
vcs {
|
||||
|
||||
check(branchFilter == "+:<default>") {
|
||||
"Unexpected option value: branchFilter = $branchFilter"
|
||||
}
|
||||
branchFilter = "+:fleet"
|
||||
}
|
||||
}
|
20
.teamcity/patches/buildTypes/ReleasePatch.kts
vendored
20
.teamcity/patches/buildTypes/ReleasePatch.kts
vendored
@@ -1,20 +0,0 @@
|
||||
package patches.buildTypes
|
||||
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.*
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.ui.*
|
||||
|
||||
/*
|
||||
This patch script was generated by TeamCity on settings change in UI.
|
||||
To apply the patch, change the buildType with id = 'ReleasePatch'
|
||||
accordingly, and delete the patch script.
|
||||
*/
|
||||
changeBuildType(RelativeId("ReleasePatch")) {
|
||||
params {
|
||||
expect {
|
||||
password("env.ORG_GRADLE_PROJECT_youtrackToken", "credentialsJSON:3cd3e867-282c-451f-b958-bc95d56a8450", display = ParameterDisplay.HIDDEN)
|
||||
}
|
||||
update {
|
||||
password("env.ORG_GRADLE_PROJECT_youtrackToken", "credentialsJSON:7bc0eb3a-b86a-4ebd-b622-d4ef12d7e1d3", display = ParameterDisplay.HIDDEN)
|
||||
}
|
||||
}
|
||||
}
|
2
.teamcity/settings.kts
vendored
2
.teamcity/settings.kts
vendored
@@ -30,5 +30,5 @@ node (Plugins -> teamcity-configs -> teamcity-configs:generate),
|
||||
the 'Debug' option is available in the context menu for the task.
|
||||
*/
|
||||
|
||||
version = "2023.05"
|
||||
version = "2023.11"
|
||||
project(_Self.Project)
|
||||
|
12
AUTHORS.md
12
AUTHORS.md
@@ -483,6 +483,18 @@ Contributors:
|
||||
[![icon][github]](https://github.com/ludwig-jb)
|
||||
|
||||
ludwig-jb
|
||||
* [![icon][mail]](mailto:pvydmuch@gmail.com)
|
||||
[![icon][github]](https://github.com/pWydmuch)
|
||||
|
||||
pWydmuch
|
||||
* [![icon][mail]](mailto:leonid989@gmail.com)
|
||||
[![icon][github]](https://github.com/Infonautica)
|
||||
|
||||
Leonid Danilov
|
||||
* [![icon][mail]](mailto:emanuel-367@hotmail.com)
|
||||
[![icon][github]](https://github.com/emanuelgestosa)
|
||||
|
||||
Emanuel Gestosa
|
||||
|
||||
Previous contributors:
|
||||
|
||||
|
73
CHANGES.md
73
CHANGES.md
@@ -25,11 +25,84 @@ usual beta standards.
|
||||
|
||||
## To Be Released
|
||||
|
||||
### Fixes:
|
||||
* [VIM-3055](https://youtrack.jetbrains.com/issue/VIM-3055) Fix the issue with double deleting after dot
|
||||
|
||||
### Merged PRs:
|
||||
* [725](https://github.com/JetBrains/ideavim/pull/725) by [Emanuel Gestosa](https://github.com/emanuelgestosa): Regex
|
||||
* [805](https://github.com/JetBrains/ideavim/pull/805) by [chylex](https://github.com/chylex): VIM-3238 Fix recording a macro that replays another macro
|
||||
|
||||
## 2.8.0, 2024-01-30
|
||||
|
||||
### Fixes:
|
||||
* [VIM-3130](https://youtrack.jetbrains.com/issue/VIM-3130) Change the build version to 2023.1.2
|
||||
* [VIM-3168](https://youtrack.jetbrains.com/issue/VIM-3168) Do not switch to block caret after enter if the IdeaVim is disabled
|
||||
* [VIM-3165](https://youtrack.jetbrains.com/issue/VIM-3165) Do not process enter key as IdeaVim shortcut if it's not an actual keypress
|
||||
* [VIM-3159](https://youtrack.jetbrains.com/issue/VIM-3159) Shift-enter now works in normal mode again
|
||||
* [VIM-3157](https://youtrack.jetbrains.com/issue/VIM-3157) Do not invoke enter in invokeLater for python console
|
||||
* [VIM-3195](https://youtrack.jetbrains.com/issue/VIM-3195) Fix escape in injected editor
|
||||
* [VIM-3190](https://youtrack.jetbrains.com/issue/VIM-3190) Do not use octopus handler if the enter key is used with modifiers like shift or control
|
||||
* [VIM-3203](https://youtrack.jetbrains.com/issue/VIM-3203) Split action not works in normal mode
|
||||
* [VIM-3184](https://youtrack.jetbrains.com/issue/VIM-3184) Revert "VIM-3184: Temporally disable new handlers for the thin client"
|
||||
* [VIM-3186](https://youtrack.jetbrains.com/issue/VIM-3186) Do not multiply the enter action by the amount of carets
|
||||
* [VIM-3177](https://youtrack.jetbrains.com/issue/VIM-3177) Formatting of commit message works again
|
||||
* [VIM-1611](https://youtrack.jetbrains.com/issue/VIM-1611) actions related to resolving conflicts doesn't seem to work
|
||||
* [VIM-3204](https://youtrack.jetbrains.com/issue/VIM-3204) Add checker that verifies the configuratin of the keymap
|
||||
* [VIM-3084](https://youtrack.jetbrains.com/issue/VIM-3084) Double update for the status bar icon
|
||||
* [VIM-3176](https://youtrack.jetbrains.com/issue/VIM-3176) Reselecting visual selection after pasting above it select wrong lines
|
||||
* [VIM-3206](https://youtrack.jetbrains.com/issue/VIM-3206) Disable both copilot suggestion and insert mode on a single escape
|
||||
* [VIM-3090](https://youtrack.jetbrains.com/issue/VIM-3090) Cmd line mode saves the visual mode
|
||||
* [VIM-3085](https://youtrack.jetbrains.com/issue/VIM-3085) Open access to VimTypedActionHandler and VimShortcutKeyAction
|
||||
* [VIM-3260](https://youtrack.jetbrains.com/issue/VIM-3260) Processing the offsets at the file end
|
||||
* [VIM-3183](https://youtrack.jetbrains.com/issue/VIM-3183) Execute .ideavimrc on pooled thread
|
||||
|
||||
### Merged PRs:
|
||||
* [763](https://github.com/JetBrains/ideavim/pull/763) by [Sam Ng](https://github.com/samabcde): Fix(VIM-3176) add test for restore selection after pasting in/below s…
|
||||
* [772](https://github.com/JetBrains/ideavim/pull/772) by [chylex](https://github.com/chylex): Prevent code completion popup from appearing after running a macro
|
||||
* [787](https://github.com/JetBrains/ideavim/pull/787) by [Leonid Danilov](https://github.com/Infonautica): Added "Which-Key" to Plugins
|
||||
* [778](https://github.com/JetBrains/ideavim/pull/778) by [lippfi](https://github.com/lippfi): Showmode
|
||||
* [788](https://github.com/JetBrains/ideavim/pull/788) by [Matt Ellis](https://github.com/citizenmatt): Refactor VimOptionGroupBase
|
||||
|
||||
## 2.7.0, 2023-11-07
|
||||
|
||||
### Fixes:
|
||||
* [VIM-2933](https://youtrack.jetbrains.com/issue/VIM-2933) Reloading/sourcing .ideavimrc does not initialize new plugins
|
||||
* [VIM-3138](https://youtrack.jetbrains.com/issue/VIM-3138) Do not try to register disposer if the caret is already disposed
|
||||
|
||||
### Merged PRs:
|
||||
* [734](https://github.com/JetBrains/ideavim/pull/734) by [Matt Ellis](https://github.com/citizenmatt): Support `~/` on Windows
|
||||
* [736](https://github.com/JetBrains/ideavim/pull/736) by [chylex](https://github.com/chylex): Fix(VIM-2933): Reloading/sourcing .ideavimrc does not initialize new plugins
|
||||
|
||||
## 2.6.3, 2023-10-30
|
||||
|
||||
### Changes:
|
||||
- 2.6.0 and 2.6.1 releases are broken. Version 2.6.3 reverts IdeaVim plugin to the working state as for 2.5.1.
|
||||
|
||||
## 2.6.0, 2023-10-27
|
||||
|
||||
This version of IdeaVim contains a lot of issues. Version 2.6.3 reverts these changes.
|
||||
|
||||
### Features:
|
||||
|
||||
* `ShowHoverInfo` action can be used in mappings to open a tooltip that is shown by
|
||||
mouse hovering | [VIM-2106](https://youtrack.jetbrains.com/issue/VIM-2106)
|
||||
* `has` Vim Script function supports the most common OS checks: win32, win64, linux, mac, macunix, osx, osxdarwin, bsd, sun, unix
|
||||
* See https://github.com/JetBrains/ideavim#vim-script for details about Vim Script
|
||||
|
||||
### Fixes:
|
||||
* [VIM-3060](https://youtrack.jetbrains.com/issue/VIM-3060) Clipboard interaction stopped working
|
||||
* [VIM-3095](https://youtrack.jetbrains.com/issue/VIM-3095) Fix missing ellipsis digraph
|
||||
* [VIM-2562](https://youtrack.jetbrains.com/issue/VIM-2562) Fix hang with multi-width chars in command line
|
||||
* [VIM-696](https://youtrack.jetbrains.com/issue/VIM-696) Vim selection issue after undo
|
||||
* [VIM-1639](https://youtrack.jetbrains.com/issue/VIM-1639) Ctrl-o and Ctrl-i jumping in files of different projects
|
||||
|
||||
### Merged PRs:
|
||||
* [697](https://github.com/JetBrains/ideavim/pull/697) by [Matt Ellis](https://github.com/citizenmatt): Support per-window "global" values for local-to-window options
|
||||
* [717](https://github.com/JetBrains/ideavim/pull/717) by [Matt Ellis](https://github.com/citizenmatt): Fix(VIM-2562): Fix hang with multi-width chars in command line
|
||||
* [732](https://github.com/JetBrains/ideavim/pull/732) by [pWydmuch](https://github.com/pWydmuch): Fix md links in doc
|
||||
* [733](https://github.com/JetBrains/ideavim/pull/733) by [Matt Ellis](https://github.com/citizenmatt): Add support for ShowHoverInfo action to 2023.1 and 2023.2
|
||||
* [729](https://github.com/JetBrains/ideavim/pull/729) by [chylex](https://github.com/chylex): Add operating system type to `has()` function
|
||||
* [726](https://github.com/JetBrains/ideavim/pull/726) by [Matt Ellis](https://github.com/citizenmatt): Fix range for fall back comment mode
|
||||
|
||||
## 2.5.0, 2023-09-01
|
||||
|
||||
|
@@ -255,8 +255,7 @@ Ex commands or via `:map` command mappings:
|
||||
##### Some popular actions:
|
||||
|
||||
```
|
||||
QuickJavaDoc - Quick Documentation (not only for java, all languages)
|
||||
ShowErrorDescription - Show description of the error under the caret (cursor hovering)
|
||||
ShowHoverInfo - Quick Documentation and Error Description
|
||||
QuickImplementations - Quick Definition
|
||||
```
|
||||
|
||||
@@ -325,7 +324,7 @@ IdeaVim tips and tricks
|
||||
- Use the power of IJ and Vim:
|
||||
- `set ideajoin` to enable join via the IDE. See the [examples](https://jb.gg/f9zji9).
|
||||
- Make sure `ideaput` is enabled for `clipboard` to enable native IJ insertion in Vim.
|
||||
- Sync IJ bookmarks and Vim marks: `set ideamarks`
|
||||
- Sync IJ bookmarks and IdeaVim global marks: `set ideamarks` (works for marks with capital letters only)
|
||||
- Check out more [ex commands](https://github.com/JetBrains/ideavim/wiki/%22set%22-commands).
|
||||
|
||||
- Use your vim settings with IdeaVim. Put `source ~/.vimrc` in `~/.ideavimrc`.
|
||||
|
@@ -84,3 +84,8 @@ IV) It is not allowed to remove this license from the distribution of the Vim
|
||||
license for previous Vim releases instead of the license that they came
|
||||
with, at your option.
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
File [sneakIcon.png](doc/images/sneakIcon.svg), which is originally an icon of the ideavim-sneak plugin,
|
||||
is merged icons of IdeaVim plugin and a random sneaker by FreePic from flaticon.com.
|
||||
|
@@ -8,8 +8,11 @@
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
kotlin("plugin.serialization") version "1.9.22"
|
||||
}
|
||||
|
||||
val kotlinxSerializationVersion: String by project
|
||||
|
||||
group = "com.intellij"
|
||||
version = "SNAPSHOT"
|
||||
|
||||
@@ -18,6 +21,10 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("com.google.devtools.ksp:symbol-processing-api:1.9.10-1.0.13")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.6.0")
|
||||
}
|
||||
compileOnly("com.google.devtools.ksp:symbol-processing-api:1.9.22-1.0.17")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:$kotlinxSerializationVersion") {
|
||||
// kotlin stdlib is provided by IJ, so there is no need to include it into the distribution
|
||||
exclude("org.jetbrains.kotlin", "kotlin-stdlib")
|
||||
exclude("org.jetbrains.kotlin", "kotlin-stdlib-common")
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright 2003-2023 The IdeaVim authors
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE.txt file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
|
||||
package com.intellij.vim.annotations
|
||||
|
||||
// TODO support numpad keys parsing, see :keycodes
|
||||
/**
|
||||
* It's not necessary a Vim command
|
||||
* This annotation may be used for:
|
||||
* - commands
|
||||
* - motions
|
||||
*/
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
annotation class CommandOrMotion(val keys: Array<String>, vararg val modes: Mode)
|
||||
|
||||
annotation class TextObject(val keys: String)
|
||||
|
||||
|
||||
enum class Mode(val abbrev: Char) {
|
||||
/**
|
||||
* Indicates this key mapping applies to Normal mode
|
||||
*/
|
||||
NORMAL('N'),
|
||||
|
||||
/**
|
||||
* Indicates this key mapping applies to Visual mode
|
||||
*/
|
||||
VISUAL('X'),
|
||||
|
||||
/**
|
||||
* Indicates this key mapping applies to Select mode
|
||||
*/
|
||||
SELECT('S'),
|
||||
|
||||
/**
|
||||
* Indicates this key mapping applies to Operator Pending mode
|
||||
*/
|
||||
OP_PENDING('O'),
|
||||
|
||||
/**
|
||||
* Indicates this key mapping applies to Insert or Replace modes
|
||||
*/
|
||||
INSERT('I'),
|
||||
|
||||
/**
|
||||
* Indicates this key mapping applies to Command Line mode
|
||||
*/
|
||||
CMD_LINE('C'),
|
||||
}
|
@@ -6,10 +6,9 @@
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
|
||||
package com.maddyhome.idea.vim.api
|
||||
package com.intellij.vim.processors
|
||||
|
||||
import com.maddyhome.idea.vim.handler.EditorActionHandlerBase
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
public interface VimActionsInitiator {
|
||||
public fun getInstance(): EditorActionHandlerBase
|
||||
}
|
||||
@Serializable
|
||||
data class CommandBean(val keys: String, val `class`: String, val modes: String)
|
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright 2003-2023 The IdeaVim authors
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE.txt file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
|
||||
package com.intellij.vim.processors
|
||||
|
||||
import com.google.devtools.ksp.KspExperimental
|
||||
import com.google.devtools.ksp.getAnnotationsByType
|
||||
import com.google.devtools.ksp.processing.Resolver
|
||||
import com.google.devtools.ksp.processing.SymbolProcessor
|
||||
import com.google.devtools.ksp.processing.SymbolProcessorEnvironment
|
||||
import com.google.devtools.ksp.symbol.KSAnnotated
|
||||
import com.google.devtools.ksp.symbol.KSClassDeclaration
|
||||
import com.google.devtools.ksp.symbol.KSFile
|
||||
import com.google.devtools.ksp.symbol.KSVisitorVoid
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import kotlinx.serialization.encodeToString
|
||||
import kotlinx.serialization.json.Json
|
||||
import java.nio.file.Files
|
||||
import kotlin.io.path.Path
|
||||
import kotlin.io.path.writeText
|
||||
|
||||
class CommandOrMotionProcessor(private val environment: SymbolProcessorEnvironment): SymbolProcessor {
|
||||
private val visitor = CommandOrMotionVisitor()
|
||||
private val commands = mutableListOf<CommandBean>()
|
||||
|
||||
private val json = Json { prettyPrint = true }
|
||||
|
||||
override fun process(resolver: Resolver): List<KSAnnotated> {
|
||||
resolver.getAllFiles().forEach { it.accept(visitor, Unit) }
|
||||
|
||||
val generatedDirPath = Path(environment.options["generated_directory"]!!)
|
||||
Files.createDirectories(generatedDirPath)
|
||||
|
||||
val filePath = generatedDirPath.resolve(environment.options["commands_file"]!!)
|
||||
val fileContent = json.encodeToString(commands)
|
||||
filePath.writeText(fileContent)
|
||||
|
||||
return emptyList()
|
||||
}
|
||||
|
||||
private inner class CommandOrMotionVisitor : KSVisitorVoid() {
|
||||
@OptIn(KspExperimental::class)
|
||||
override fun visitClassDeclaration(classDeclaration: KSClassDeclaration, data: Unit) {
|
||||
val commandAnnotation = classDeclaration.getAnnotationsByType(CommandOrMotion::class).firstOrNull() ?: return
|
||||
for (key in commandAnnotation.keys) {
|
||||
commands.add(
|
||||
CommandBean(key, classDeclaration.qualifiedName!!.asString(), commandAnnotation.modes.map { it.abbrev }.joinToString(separator = ""))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override fun visitFile(file: KSFile, data: Unit) {
|
||||
file.declarations.forEach { it.accept(this, Unit) }
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@@ -20,6 +20,7 @@ import com.google.devtools.ksp.symbol.KSVisitorVoid
|
||||
import com.intellij.vim.annotations.ExCommand
|
||||
import kotlinx.serialization.encodeToString
|
||||
import kotlinx.serialization.json.Json
|
||||
import java.nio.file.Files
|
||||
import kotlin.io.path.Path
|
||||
import kotlin.io.path.writeText
|
||||
|
||||
@@ -31,7 +32,11 @@ class ExCommandProcessor(private val environment: SymbolProcessorEnvironment): S
|
||||
|
||||
override fun process(resolver: Resolver): List<KSAnnotated> {
|
||||
resolver.getAllFiles().forEach { it.accept(visitor, Unit) }
|
||||
val filePath = Path(environment.options["generated_directory"]!!, environment.options["ex_commands_file"]!!)
|
||||
|
||||
val generatedDirPath = Path(environment.options["generated_directory"]!!)
|
||||
Files.createDirectories(generatedDirPath)
|
||||
|
||||
val filePath = generatedDirPath.resolve(environment.options["ex_commands_file"]!!)
|
||||
val fileContent = json.encodeToString(commandToClass)
|
||||
filePath.writeText(fileContent)
|
||||
|
||||
|
@@ -20,6 +20,7 @@ import com.google.devtools.ksp.symbol.KSVisitorVoid
|
||||
import com.intellij.vim.annotations.VimscriptFunction
|
||||
import kotlinx.serialization.encodeToString
|
||||
import kotlinx.serialization.json.Json
|
||||
import java.nio.file.Files
|
||||
import kotlin.io.path.Path
|
||||
import kotlin.io.path.writeText
|
||||
|
||||
@@ -31,7 +32,11 @@ class VimscriptFunctionProcessor(private val environment: SymbolProcessorEnviron
|
||||
|
||||
override fun process(resolver: Resolver): List<KSAnnotated> {
|
||||
resolver.getAllFiles().forEach { it.accept(visitor, Unit) }
|
||||
val filePath = Path(environment.options["generated_directory"]!!, environment.options["vimscript_functions_file"]!!)
|
||||
|
||||
val generatedDirPath = Path(environment.options["generated_directory"]!!)
|
||||
Files.createDirectories(generatedDirPath)
|
||||
|
||||
val filePath = generatedDirPath.resolve(environment.options["vimscript_functions_file"]!!)
|
||||
val fileContent = json.encodeToString(nameToClass)
|
||||
filePath.writeText(fileContent)
|
||||
|
||||
|
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2003-2023 The IdeaVim authors
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE.txt file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
|
||||
package com.intellij.vim.providers
|
||||
|
||||
import com.google.devtools.ksp.processing.SymbolProcessor
|
||||
import com.google.devtools.ksp.processing.SymbolProcessorEnvironment
|
||||
import com.google.devtools.ksp.processing.SymbolProcessorProvider
|
||||
import com.intellij.vim.processors.CommandOrMotionProcessor
|
||||
|
||||
class CommandOrMotionProcessorProvider : SymbolProcessorProvider {
|
||||
override fun create(environment: SymbolProcessorEnvironment): SymbolProcessor {
|
||||
return CommandOrMotionProcessor(environment)
|
||||
}
|
||||
}
|
@@ -1,2 +1,3 @@
|
||||
com.intellij.vim.providers.CommandOrMotionProcessorProvider
|
||||
com.intellij.vim.providers.ExCommandProcessorProvider
|
||||
com.intellij.vim.providers.VimscriptFunctionProcessorProvider
|
||||
com.intellij.vim.providers.ExCommandProcessorProvider
|
1346
build.gradle.kts
1346
build.gradle.kts
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
Welcome to the IdeaVim wiki!
|
||||
|
||||
- List of IdeaVim plugins: [[plugins|IdeaVim Plugins]]
|
||||
- Examples of `ideajoin` option (also known as "smart join"): [["ideajoin" examples|ideajoin-examples]]
|
||||
- List of "set" commands: [["set" commands|set-commands]]
|
||||
- Docs about "select" mode in vim: [[select mode|Select-mode]]
|
||||
- List of IdeaVim plugins: [plugins](IdeaVim%20Plugins.md)
|
||||
- Examples of `ideajoin` option (also known as "smart join"): ["ideajoin" examples](ideajoin-examples.md)
|
||||
- List of "set" commands: ["set" commands](set-commands.md)
|
||||
- Docs about "select" mode in vim: [select mode](Select-mode.md)
|
||||
|
@@ -44,16 +44,21 @@ All commands with the mappings are supported. See the [full list of supported co
|
||||
|
||||
<details>
|
||||
<summary><h2>sneak</h2></summary>
|
||||
|
||||
|
||||
<img src="images/sneakIcon.svg" width="80" height="80" alt="icon"/>
|
||||
|
||||
By [Mikhail Levchenko](https://github.com/Mishkun)
|
||||
Original repository with the plugin: https://github.com/Mishkun/ideavim-sneak
|
||||
Original plugin: [vim-sneak](https://github.com/justinmk/vim-sneak).
|
||||
|
||||
### Setup:
|
||||
- Install [IdeaVim-sneak](https://plugins.jetbrains.com/plugin/15348-ideavim-sneak) plugin.
|
||||
- Add the following command to `~/.ideavimrc`: `set sneak`
|
||||
- Add the following command to `~/.ideavimrc`: `Plug 'justinmk/vim-sneak'`
|
||||
|
||||
### Instructions
|
||||
|
||||
See the [docs](https://github.com/Mishkun/ideavim-sneak#usage)
|
||||
|
||||
* Type `s` and two chars to start sneaking in forward direction
|
||||
* Type `S` and two chars to start sneaking in backward direction
|
||||
* Type `;` or `,` to proceed with sneaking just as if you were using `f` or `t` commands
|
||||
|
||||
</details>
|
||||
|
||||
@@ -77,7 +82,7 @@ Original plugin: [NERDTree](https://github.com/preservim/nerdtree).
|
||||
|
||||
### Instructions
|
||||
|
||||
[[See here|NERDTree-support]].
|
||||
[See here](NERDTree-support.md).
|
||||
|
||||
</details>
|
||||
|
||||
@@ -396,3 +401,19 @@ Original plugin: [quick-scope](https://github.com/unblevable/quick-scope).
|
||||
https://plugins.jetbrains.com/plugin/19417-ideavim-quickscope
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
<details>
|
||||
<summary><h2>Which-Key</h2></summary>
|
||||
|
||||
Original plugin: [vim-which-key](https://github.com/liuchengxu/vim-which-key).
|
||||
|
||||
### Setup:
|
||||
- Install [Which-Key](https://plugins.jetbrains.com/plugin/15976-which-key) plugin.
|
||||
- Add the following command to `~/.ideavimrc`: `set which-key`
|
||||
|
||||
### Instructions
|
||||
|
||||
https://github.com/TheBlob42/idea-which-key?tab=readme-ov-file#installation
|
||||
|
||||
</details>
|
||||
|
@@ -3,6 +3,11 @@ Put `set ideajoin` to your `~/.ideavimrc` to enable this functionality.
|
||||
|
||||
Now, you can press `J` (`shift+j`) on a line or a selected block of text to join the lines together.
|
||||
|
||||
:warning: This feature is language-specific. This means that the IDE should implement this feature for a particular
|
||||
language in order for the IDE to work as described below. If any of the examples provided below don't match your case,
|
||||
please file an issue in the project related to your IDE: https://youtrack.jetbrains.com/.
|
||||
Here is a list of known requests: https://youtrack.jetbrains.com/issues?q=links:VIM-3214.
|
||||
|
||||
* Automatic join concatenated lines:
|
||||
|
||||
```
|
||||
|
28
doc/images/sneakIcon.svg
Normal file
28
doc/images/sneakIcon.svg
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<svg viewBox="386.498 234 32 32" xmlns="http://www.w3.org/2000/svg">
|
||||
<defs>
|
||||
<linearGradient id="ideavim_plugin-a" x1="-6.748%" x2="47.286%" y1="33.61%" y2="85.907%">
|
||||
<stop offset="0" stop-color="#3BEA62"/>
|
||||
<stop offset="1" stop-color="#087CFA"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<g transform="matrix(1.238978, 0.90017, -0.90017, 1.238978, 131.776901, -422.953003)" style="">
|
||||
<path d="M 399.962 247.648 C 399.207 246.894 399.147 246.318 399.692 245.453 C 400.237 244.588 401.955 245.886 401.955 245.886 L 401.955 250.737" style="fill: rgb(248, 245, 231);"/>
|
||||
<path d="M 413.846 253.602 C 413.846 255.077 411.827 256.134 409.392 256.134 L 396.381 256.134 C 395.211 256.134 394.232 256.003 393.433 255.817 C 391.496 255.367 390.613 254.596 390.613 254.596 L 391.478 252.513 L 393.607 252.617 Z M 413.846 253.602" fill="#cce6f6" style=""/>
|
||||
<path d="M 413.846 253.602 C 413.846 253.602 411.475 254.468 408.27 254.468 C 405.94 254.468 398.116 253.433 394.023 252.869 C 392.488 252.658 391.478 252.512 391.478 252.512 C 390.864 251.662 392.078 248.741 392.758 247.263 C 393.118 246.484 393.85 245.929 394.703 245.83 C 394.782 245.82 394.861 245.815 394.939 245.815 C 395.369 245.815 395.645 246.532 396.059 247.225 C 396.446 247.877 396.955 248.507 397.823 248.507 C 399.617 248.507 401.955 245.886 401.955 245.886 C 406.544 249.03 410.097 250.43 410.097 250.43 C 410.097 250.43 413.061 250.446 413.782 251.167 C 414.503 251.888 414.422 253.218 413.846 253.602 Z M 413.846 253.602" style="fill: rgb(8, 124, 250);"/>
|
||||
<path d="M 394.023 252.869 L 393.433 255.817 C 391.496 255.367 390.613 254.596 390.613 254.596 L 391.478 252.513 L 393.607 252.617 Z M 394.023 252.869" fill="#9dcae0" style=""/>
|
||||
<path d="M 396.059 247.225 C 395.073 245.986 393.193 250.255 394.023 252.869 C 392.488 252.658 391.478 252.513 391.478 252.513 C 390.864 251.662 392.078 248.741 392.758 247.263 C 393.118 246.484 393.85 245.929 394.703 245.83 C 394.782 245.82 394.861 245.815 394.939 245.815 C 395.369 245.815 395.645 246.532 396.059 247.225 Z M 396.059 247.225" style="fill: rgb(14, 112, 142);"/>
|
||||
<path d="M 403.527 246.924 L 399.174 251.768 C 397.7 250.892 395.578 250.174 394.016 249.717 C 392.843 249.372 391.985 249.174 391.959 249.168 C 392.108 248.769 392.268 248.379 392.421 248.022 L 394.341 248.65 L 394.884 248.827 C 395.509 249.031 396.192 248.95 396.753 248.608 L 397.153 248.363 C 397.35 248.454 397.572 248.507 397.823 248.507 C 399.617 248.507 401.955 245.886 401.955 245.886 C 402.494 246.256 403.02 246.601 403.527 246.924 Z M 403.527 246.924" style="fill: rgb(59, 234, 98);"/>
|
||||
<path d="M 413.847 253.602 C 413.847 253.602 411.475 254.468 408.27 254.468 C 407.586 254.468 406.426 254.378 405.025 254.238 L 405.025 254.237 C 405.025 253.495 406.924 251.743 408.366 251.616 C 408.623 252.865 410.097 252.512 411.219 252.128 C 412.341 251.743 413.783 251.167 413.783 251.167 C 414.503 251.888 414.422 253.218 413.847 253.602 Z M 413.847 253.602" style="fill: rgb(8, 124, 250);"/>
|
||||
<path d="M 394.341 248.65 C 394.214 248.978 394.103 249.339 394.016 249.717 C 392.843 249.372 391.985 249.174 391.959 249.168 C 392.108 248.769 392.268 248.379 392.421 248.022 Z M 394.341 248.65" style="fill: rgb(37, 187, 163);"/>
|
||||
<path d="M 408.366 251.616 C 406.924 251.743 405.025 253.495 405.025 254.237 L 405.025 254.238 C 403.784 254.113 402.355 253.948 400.899 253.77 C 400.899 253.051 400.191 252.372 399.174 251.768 L 399.174 251.768 L 403.528 246.924 C 407.331 249.34 410.097 250.43 410.097 250.43 C 410.77 251.102 409.809 251.487 408.366 251.616 Z M 408.366 251.616" style="fill: rgb(248, 245, 231);"/>
|
||||
<polygon fill="url(#ideavim_plugin-a)" fill-rule="evenodd" points="406.356 248.463 403.261 252.616 402.183 248.212 400.984 249.899 401.999 254.236 403.927 254.176 407.639 249.062" style="" transform="matrix(0.994522, 0.104529, -0.104529, 0.994522, 28.475005, -40.88594)"/>
|
||||
<g fill="#fb6572" transform="matrix(0.046265, 0, 0, 0.046265, 390.612823, 245.155533)" style="">
|
||||
<path d="m288.839844 72.65625c-2.007813 0-4.011719-.761719-5.542969-2.292969-3.058594-3.0625-3.058594-8.023437 0-11.082031l20.089844-20.089844c3.0625-3.058594 8.023437-3.058594 11.082031 0 3.058594 3.0625 3.0625 8.023438 0 11.082032l-20.089844 20.089843c-1.527344 1.53125-3.535156 2.292969-5.539062 2.292969zm0 0" style="fill: rgb(56, 228, 105);"/>
|
||||
<path d="m314.589844 87.082031c-2.007813 0-4.011719-.765625-5.542969-2.296875-3.0625-3.058594-3.0625-8.019531 0-11.082031l20.089844-20.085937c3.0625-3.058594 8.023437-3.058594 11.082031 0 3.058594 3.0625 3.058594 8.023437 0 11.082031l-20.089844 20.085937c-1.527344 1.53125-3.535156 2.296875-5.539062 2.296875zm0 0" style="fill: rgb(59, 233, 100);"/>
|
||||
<path d="m340.339844 101.507812c-2.007813 0-4.011719-.765624-5.542969-2.296874-3.058594-3.058594-3.058594-8.023438 0-11.082032l20.089844-20.085937c3.0625-3.0625 8.023437-3.0625 11.082031 0 3.058594 3.058593 3.0625 8.023437 0 11.082031l-20.089844 20.085938c-1.527344 1.53125-3.535156 2.296874-5.539062 2.296874zm0 0" style="fill: rgb(59, 233, 100);"/>
|
||||
<path d="m366.089844 115.929688c-2.003906 0-4.011719-.761719-5.539063-2.292969-3.0625-3.0625-3.0625-8.023438 0-11.082031l20.085938-20.089844c3.0625-3.058594 8.023437-3.058594 11.082031 0 3.0625 3.0625 3.0625 8.023437 0 11.082031l-20.085938 20.089844c-1.53125 1.53125-3.535156 2.292969-5.542968 2.292969zm0 0" style="fill: rgb(59, 233, 100);"/>
|
||||
</g>
|
||||
<path d="M 401.925 247.748 C 401.761 247.748 401.611 247.629 401.573 247.469 C 401.536 247.312 401.611 247.144 401.753 247.067 C 402 246.933 402.318 247.147 402.286 247.426 C 402.265 247.606 402.107 247.748 401.925 247.748 Z M 401.925 247.748" fill="#1e2628" style=""/>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 5.6 KiB |
@@ -8,21 +8,28 @@
|
||||
|
||||
# suppress inspection "UnusedProperty" for whole file
|
||||
|
||||
ideaVersion=2023.2
|
||||
ideaVersion=2023.3.3
|
||||
# Values for type: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#intellij-extension-type
|
||||
ideaType=IC
|
||||
downloadIdeaSources=true
|
||||
instrumentPluginCode=true
|
||||
version=chylex-19
|
||||
version=chylex-27
|
||||
javaVersion=17
|
||||
remoteRobotVersion=0.11.17
|
||||
remoteRobotVersion=0.11.22
|
||||
antlrVersion=4.10.1
|
||||
|
||||
kotlin.incremental.useClasspathSnapshot=false
|
||||
|
||||
# Please don't forget to update kotlin version in buildscript section
|
||||
kotlinVersion=1.8.21
|
||||
# Also update kotlinxSerializationVersion version
|
||||
kotlinVersion=1.9.22
|
||||
publishToken=token
|
||||
publishChannels=eap
|
||||
|
||||
# Kotlinx serialization also uses some version of kotlin stdlib under the hood. However,
|
||||
# we exclude this version from the dependency and use our own version of kotlin that is specified above
|
||||
kotlinxSerializationVersion=1.5.1
|
||||
|
||||
slackUrl=
|
||||
youtrackToken=
|
||||
|
||||
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
3
gradle/wrapper/gradle-wrapper.properties
vendored
3
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
5
gradlew
vendored
5
gradlew
vendored
@@ -130,10 +130,13 @@ location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
|
@@ -20,17 +20,17 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("org.jetbrains.kotlin:kotlin-stdlib:1.9.10")
|
||||
compileOnly("org.jetbrains.kotlin:kotlin-stdlib:1.9.22")
|
||||
|
||||
implementation("io.ktor:ktor-client-core:2.3.4")
|
||||
implementation("io.ktor:ktor-client-cio:2.3.4")
|
||||
implementation("io.ktor:ktor-client-content-negotiation:2.3.4")
|
||||
implementation("io.ktor:ktor-serialization-kotlinx-json:2.3.4")
|
||||
implementation("io.ktor:ktor-client-auth:2.3.4")
|
||||
implementation("io.ktor:ktor-client-core:2.3.7")
|
||||
implementation("io.ktor:ktor-client-cio:2.3.7")
|
||||
implementation("io.ktor:ktor-client-content-negotiation:2.3.7")
|
||||
implementation("io.ktor:ktor-serialization-kotlinx-json:2.3.7")
|
||||
implementation("io.ktor:ktor-client-auth:2.3.7")
|
||||
implementation("org.eclipse.jgit:org.eclipse.jgit:6.6.0.202305301015-r")
|
||||
|
||||
// This is needed for jgit to connect to ssh
|
||||
implementation("org.eclipse.jgit:org.eclipse.jgit.ssh.apache:6.7.0.202309050840-r")
|
||||
implementation("org.eclipse.jgit:org.eclipse.jgit.ssh.apache:6.8.0.202311291450-r")
|
||||
implementation("com.vdurmont:semver4j:3.1.0")
|
||||
}
|
||||
|
||||
@@ -93,28 +93,16 @@ tasks.register("addReleaseTag", JavaExec::class) {
|
||||
args = listOf(project.version.toString(), rootProject.rootDir.toString(), releaseType ?: "")
|
||||
}
|
||||
|
||||
tasks.register("resetReleaseBranch", JavaExec::class) {
|
||||
tasks.register("selectBranch", JavaExec::class) {
|
||||
group = "release"
|
||||
mainClass.set("scripts.release.ResetReleaseBranchKt")
|
||||
mainClass.set("scripts.release.SelectBranchKt")
|
||||
classpath = sourceSets["main"].runtimeClasspath
|
||||
args = listOf(project.version.toString(), rootProject.rootDir.toString(), releaseType ?: "")
|
||||
}
|
||||
|
||||
tasks.register("pushChanges", JavaExec::class) {
|
||||
mainClass.set("scripts.PushChangesKt")
|
||||
classpath = sourceSets["main"].runtimeClasspath
|
||||
args = listOf(rootProject.rootDir.toString())
|
||||
}
|
||||
|
||||
tasks.register("pushChangesWithReleaseBranch", JavaExec::class) {
|
||||
mainClass.set("scripts.PushChangesWithReleaseBranchKt")
|
||||
classpath = sourceSets["main"].runtimeClasspath
|
||||
args = listOf(rootProject.rootDir.toString(), releaseType ?: "")
|
||||
}
|
||||
|
||||
tasks.register("selectBranch", JavaExec::class) {
|
||||
tasks.register("eapReleaseActions", JavaExec::class) {
|
||||
group = "release"
|
||||
mainClass.set("scripts.release.SelectBranchKt")
|
||||
mainClass.set("scripts.releaseEap.EapReleaseActionsKt")
|
||||
classpath = sourceSets["main"].runtimeClasspath
|
||||
args = listOf(project.version.toString(), rootProject.rootDir.toString(), releaseType ?: "")
|
||||
}
|
||||
|
@@ -32,6 +32,7 @@ val knownPlugins = listOf(
|
||||
"com.github.dankinsoid.multicursor",
|
||||
"com.joshestein.ideavim-quickscope",
|
||||
"ca.alexgirard.HarpoonIJ",
|
||||
"com.protoseo.input-source-auto-converter",
|
||||
|
||||
// "cc.implicated.intellij.plugins.bunny", // I don't want to include this plugin in the list of IdeaVim plugins as I don't understand what this is for
|
||||
)
|
||||
|
@@ -32,7 +32,7 @@ fun httpClient(): HttpClient {
|
||||
install(Auth) {
|
||||
bearer {
|
||||
loadTokens {
|
||||
val accessToken = System.getenv("YOUTRACK_TOKEN")!!
|
||||
val accessToken = System.getenv("YOUTRACK_TOKEN") ?: error("Missing YOUTRACK_TOKEN")
|
||||
BearerTokens(accessToken, "")
|
||||
}
|
||||
}
|
||||
|
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* Copyright 2003-2023 The IdeaVim authors
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE.txt file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
|
||||
package scripts
|
||||
|
||||
import scripts.release.checkoutBranch
|
||||
import scripts.release.withGit
|
||||
import scripts.release.withRepo
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val rootDir = args[0]
|
||||
println("root dir: $rootDir")
|
||||
|
||||
val currentBranch = withRepo(rootDir) { it.branch }
|
||||
println("Current branch is $currentBranch")
|
||||
|
||||
|
||||
withGit(rootDir) { git ->
|
||||
if (currentBranch != "master") {
|
||||
git.checkoutBranch("master")
|
||||
println("Check out master branch")
|
||||
}
|
||||
|
||||
git.push()
|
||||
.setPushTags()
|
||||
.call()
|
||||
println("Master pushed with tags")
|
||||
|
||||
git.checkoutBranch(currentBranch)
|
||||
println("Checked out $currentBranch branch")
|
||||
}
|
||||
}
|
@@ -1,54 +0,0 @@
|
||||
/*
|
||||
* Copyright 2003-2023 The IdeaVim authors
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE.txt file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
|
||||
package scripts
|
||||
|
||||
import scripts.release.checkoutBranch
|
||||
import scripts.release.withGit
|
||||
import scripts.release.withRepo
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val rootDir = args[0]
|
||||
val releaseType = args[1]
|
||||
println("root dir: $rootDir")
|
||||
println("releaseType: $releaseType")
|
||||
|
||||
val currentBranch = withRepo(rootDir) { it.branch }
|
||||
println("Current branch is $currentBranch")
|
||||
|
||||
|
||||
withGit(rootDir) { git ->
|
||||
if (currentBranch != "master") {
|
||||
git.checkoutBranch("master")
|
||||
println("Check out master branch")
|
||||
}
|
||||
|
||||
git.push()
|
||||
.setPushTags()
|
||||
.call()
|
||||
println("Master pushed with tags")
|
||||
|
||||
if (releaseType != "patch") {
|
||||
git.checkoutBranch("release")
|
||||
println("Checked out release")
|
||||
|
||||
git
|
||||
.push()
|
||||
.setForce(true)
|
||||
.setPushTags()
|
||||
.call()
|
||||
println("Pushed release branch with tags")
|
||||
}
|
||||
else {
|
||||
println("Do not push release branch because type of release is $releaseType")
|
||||
}
|
||||
|
||||
git.checkoutBranch(currentBranch)
|
||||
println("Checked out $currentBranch branch")
|
||||
}
|
||||
}
|
@@ -12,7 +12,7 @@ fun main(args: Array<String>) {
|
||||
println("HI!")
|
||||
val projectDir = args[0]
|
||||
println("Working directory: $projectDir")
|
||||
val (lastVersion, objectId) = getVersion(projectDir, onlyStable = true)
|
||||
val (lastVersion, objectId) = getVersion(projectDir, ReleaseType.STABLE_NO_PATCH)
|
||||
println("Last version: $lastVersion, hash: ${objectId.name}")
|
||||
|
||||
val branch = withRepo(projectDir) { it.branch }
|
||||
|
@@ -12,7 +12,7 @@ fun main(args: Array<String>) {
|
||||
println("HI!")
|
||||
val projectDir = args[0]
|
||||
println("Working directory: $projectDir")
|
||||
val (lastVersion, _) = getVersion(projectDir, onlyStable = false)
|
||||
val (lastVersion, _) = getVersion(projectDir, ReleaseType.ANY)
|
||||
|
||||
val nextVersion = if (lastVersion.suffixTokens.isEmpty()) {
|
||||
lastVersion.nextMinor().withSuffix("eap.1").value
|
||||
|
@@ -14,7 +14,7 @@ fun main(args: Array<String>) {
|
||||
val releaseType = args[1]
|
||||
println("Working directory: $projectDir")
|
||||
println("Release type: $releaseType")
|
||||
val (lastVersion, _) = getVersion(projectDir, onlyStable = true)
|
||||
val (lastVersion, _) = getVersion(projectDir, ReleaseType.ONLY_STABLE)
|
||||
|
||||
val nextVersion = when (releaseType) {
|
||||
"major" -> lastVersion.nextMajor()
|
||||
|
@@ -8,28 +8,45 @@
|
||||
|
||||
package scripts.release
|
||||
|
||||
import com.vdurmont.semver4j.Semver
|
||||
import java.time.LocalDate
|
||||
import java.time.format.DateTimeFormatter
|
||||
import kotlin.io.path.Path
|
||||
import kotlin.io.path.readText
|
||||
import kotlin.io.path.writeText
|
||||
|
||||
private const val toBeReleased = "## To Be Released"
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
println("Start updating unreleased section")
|
||||
val (newVersion, rootDir, releaseType) = readArgs(args)
|
||||
|
||||
checkReleaseType(releaseType)
|
||||
|
||||
if (releaseType == "patch") {
|
||||
println("Skip updating the changelog because release type is 'patch'")
|
||||
return
|
||||
}
|
||||
|
||||
val currentDate = LocalDate.now().format(DateTimeFormatter.ISO_LOCAL_DATE)
|
||||
val newItem = "## $newVersion, $currentDate"
|
||||
|
||||
val changelogPath = Path("$rootDir/CHANGES.md")
|
||||
val changelog = changelogPath.readText()
|
||||
val newChangelog = changelog.replace("## To Be Released", newItem)
|
||||
val newChangelog = if (releaseType == "patch") {
|
||||
val decreasedVersion = Semver(newVersion).withIncPatch(-1)
|
||||
val firstEntry = changelog.indexOf("## $decreasedVersion")
|
||||
if (firstEntry != -1) {
|
||||
val newLog = StringBuilder(changelog)
|
||||
newLog.insert(firstEntry, newItem + "\n")
|
||||
newLog.toString()
|
||||
} else {
|
||||
changelog
|
||||
}
|
||||
} else {
|
||||
if (toBeReleased in changelog) {
|
||||
changelog.replace(toBeReleased, newItem)
|
||||
} else {
|
||||
val firstEntry = changelog.indexOf("##")
|
||||
val newLog = StringBuilder(changelog)
|
||||
newLog.insert(firstEntry, newItem + "\n")
|
||||
newLog.toString()
|
||||
}
|
||||
}
|
||||
changelogPath.writeText(newChangelog)
|
||||
}
|
@@ -13,21 +13,20 @@ fun main(args: Array<String>) {
|
||||
|
||||
checkReleaseType(releaseType)
|
||||
|
||||
if (releaseType == "patch") {
|
||||
println("Skip committing changes because release type is 'patch'")
|
||||
return
|
||||
}
|
||||
|
||||
withGit(rootDir) { git ->
|
||||
git
|
||||
.commit()
|
||||
.setAll(true)
|
||||
.setAuthor("IdeaVim Bot", "maintainers@ideavim.dev")
|
||||
.setMessage("Preparation to $newVersion release")
|
||||
.setSign(false)
|
||||
.call()
|
||||
if (git.diff().call().isNotEmpty()) {
|
||||
git
|
||||
.commit()
|
||||
.setAll(true)
|
||||
.setAuthor("IdeaVim Bot", "maintainers@ideavim.dev")
|
||||
.setMessage("Preparation to $newVersion release")
|
||||
.setSign(false)
|
||||
.call()
|
||||
|
||||
val lastGitMessage = git.log().call().first().shortMessage
|
||||
println("Changes committed. Last gitlog message: $lastGitMessage")
|
||||
val lastGitMessage = git.log().call().first().shortMessage
|
||||
println("Changes committed. Last gitlog message: $lastGitMessage")
|
||||
} else {
|
||||
println("No Changes")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Copyright 2003-2023 The IdeaVim authors
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE.txt file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
|
||||
package scripts.release
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val (_, rootDir, releaseType) = readArgs(args)
|
||||
|
||||
checkReleaseType(releaseType)
|
||||
|
||||
checkBranch(rootDir, releaseType)
|
||||
|
||||
if (releaseType == "patch") {
|
||||
println("Skip release branch reset because release type is 'patch'")
|
||||
return
|
||||
}
|
||||
|
||||
withGit(rootDir) { git ->
|
||||
val currentCommit = git.log().setMaxCount(1).call().first()
|
||||
println("Current commit id: ${currentCommit.id.name}")
|
||||
|
||||
git.checkoutBranch("release")
|
||||
println("Checked out release branch")
|
||||
|
||||
git.reset()
|
||||
.setRef(currentCommit.id.name)
|
||||
.call()
|
||||
println("release branch reset")
|
||||
|
||||
git.checkoutBranch("master")
|
||||
println("Checked out master branch")
|
||||
}
|
||||
}
|
@@ -15,8 +15,7 @@ fun main(args: Array<String>) {
|
||||
|
||||
withGit(rootDir) { git ->
|
||||
val branchName = when (releaseType) {
|
||||
"major", "minor" -> "master"
|
||||
"patch" -> "release"
|
||||
"major", "minor", "patch" -> "release"
|
||||
else -> error("Unsupported release type: $releaseType")
|
||||
}
|
||||
|
||||
|
@@ -9,6 +9,7 @@
|
||||
package scripts.release
|
||||
|
||||
import com.vdurmont.semver4j.Semver
|
||||
import org.eclipse.jgit.api.CreateBranchCommand
|
||||
import org.eclipse.jgit.api.Git
|
||||
import org.eclipse.jgit.lib.ObjectId
|
||||
import org.eclipse.jgit.lib.Repository
|
||||
@@ -57,7 +58,13 @@ internal fun checkBranch(rootDir: String, releaseType: String) {
|
||||
}
|
||||
}
|
||||
|
||||
internal fun getVersion(projectDir: String, onlyStable: Boolean): Pair<Semver, ObjectId> {
|
||||
enum class ReleaseType {
|
||||
ANY,
|
||||
ONLY_STABLE,
|
||||
STABLE_NO_PATCH, // Version that ends on 0. Like 2.5.0
|
||||
}
|
||||
|
||||
internal fun getVersion(projectDir: String, releaseType: ReleaseType): Pair<Semver, ObjectId> {
|
||||
val repository = RepositoryBuilder().setGitDir(File("$projectDir/.git")).build()
|
||||
val git = Git(repository)
|
||||
println(git.log().call().first())
|
||||
@@ -74,19 +81,24 @@ internal fun getVersion(projectDir: String, onlyStable: Boolean): Pair<Semver, O
|
||||
}
|
||||
.sortedBy { it.first }
|
||||
|
||||
val version = if (onlyStable) {
|
||||
versions.last { it.first.isStable }
|
||||
} else {
|
||||
versions.last()
|
||||
val version = when (releaseType) {
|
||||
ReleaseType.ANY -> versions.last()
|
||||
ReleaseType.ONLY_STABLE -> versions.last { it.first.isStable }
|
||||
ReleaseType.STABLE_NO_PATCH -> versions.last { it.first.isStable && it.first.patch == 0 }
|
||||
}
|
||||
|
||||
return version
|
||||
}
|
||||
|
||||
internal fun Git.checkoutBranch(name: String) {
|
||||
println("Checking out $name")
|
||||
val shouldCreateBranch = this.branchList().call().any { it.name == "refs/heads/$name" }.not()
|
||||
checkout()
|
||||
val checkoutCommand = checkout()
|
||||
.setCreateBranch(shouldCreateBranch)
|
||||
.setName(name)
|
||||
.call()
|
||||
if (shouldCreateBranch) {
|
||||
// Without starting point the branch will be created on HEAD.
|
||||
checkoutCommand.setStartPoint("origin/$name").setUpstreamMode(CreateBranchCommand.SetupUpstreamMode.TRACK)
|
||||
}
|
||||
checkoutCommand.call()
|
||||
}
|
||||
|
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright 2003-2024 The IdeaVim authors
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE.txt file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
|
||||
package scripts.releaseEap
|
||||
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import scripts.addComment
|
||||
import scripts.getYoutrackTicketsByQuery
|
||||
import scripts.release.readArgs
|
||||
import scripts.releasedInEapTagId
|
||||
import scripts.setTag
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
runBlocking {
|
||||
val (newVersion, _, _) = readArgs(args)
|
||||
|
||||
// Search for Ready to release, but without "IdeaVim Released In EAP" tag
|
||||
val ticketsToUpdate =
|
||||
getYoutrackTicketsByQuery("%23%7BReady%20To%20Release%7D%20tag:%20-%7BIdeaVim%20Released%20In%20EAP%7D%20")
|
||||
println("Have to update the following tickets: $ticketsToUpdate")
|
||||
|
||||
ticketsToUpdate.forEach { ticketId ->
|
||||
setTag(ticketId, releasedInEapTagId)
|
||||
addComment(
|
||||
ticketId, """
|
||||
The fix is available in the IdeaVim $newVersion. See https://jb.gg/ideavim-eap for the instructions on how to get EAP builds as updates within the IDE. You can also wait till the next stable release with this fix, you’ll get it automatically.
|
||||
""".trimIndent()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
@@ -11,6 +11,8 @@ package scripts
|
||||
import io.ktor.client.call.*
|
||||
import io.ktor.client.request.*
|
||||
import io.ktor.http.*
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import kotlinx.serialization.json.JsonArray
|
||||
import kotlinx.serialization.json.JsonObject
|
||||
import kotlinx.serialization.json.addJsonObject
|
||||
import kotlinx.serialization.json.buildJsonObject
|
||||
@@ -21,6 +23,10 @@ import kotlinx.serialization.json.put
|
||||
import kotlinx.serialization.json.putJsonArray
|
||||
import kotlinx.serialization.json.putJsonObject
|
||||
|
||||
|
||||
// YouTrack tag "IdeaVim Released In EAP"
|
||||
const val releasedInEapTagId = "68-385032"
|
||||
|
||||
suspend fun setYoutrackStatus(tickets: Collection<String>, status: String) {
|
||||
val client = httpClient()
|
||||
|
||||
@@ -59,3 +65,59 @@ suspend fun setYoutrackStatus(tickets: Collection<String>, status: String) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun getYoutrackTicketsByQuery(query: String): Set<String> {
|
||||
val client = httpClient()
|
||||
|
||||
return runBlocking {
|
||||
val response = client.get("https://youtrack.jetbrains.com/api/issues/?fields=idReadable&query=project:VIM+$query")
|
||||
response.body<JsonArray>().mapTo(HashSet()) { it.jsonObject.getValue("idReadable").jsonPrimitive.content }
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 68-385032
|
||||
* [issueHumanId] is like VIM-123
|
||||
* [tagId] is like "145-23"
|
||||
*/
|
||||
suspend fun setTag(issueHumanId: String, tagId: String) {
|
||||
val client = httpClient()
|
||||
|
||||
println("Try to add tag $tagId to $issueHumanId")
|
||||
val response =
|
||||
// I've updated default url in client, so this may be broken now
|
||||
client.post("https://youtrack.jetbrains.com/api/issues/$issueHumanId/tags?fields=customFields(id,name,value(id,name))") {
|
||||
contentType(ContentType.Application.Json)
|
||||
accept(ContentType.Application.Json)
|
||||
val request = buildJsonObject {
|
||||
put("id", tagId)
|
||||
}
|
||||
setBody(request)
|
||||
}
|
||||
println(response)
|
||||
println(response.body<String>())
|
||||
if (!response.status.isSuccess()) {
|
||||
error("Request failed. $issueHumanId, ${response.body<String>()}")
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun addComment(issueHumanId: String, text: String) {
|
||||
val client = httpClient()
|
||||
|
||||
println("Try to add comment to $issueHumanId")
|
||||
val response =
|
||||
// I've updated default url in client, so this may be broken now
|
||||
client.post("https://youtrack.jetbrains.com/api/issues/$issueHumanId/comments?fields=customFields(id,name,value(id,name))") {
|
||||
contentType(ContentType.Application.Json)
|
||||
accept(ContentType.Application.Json)
|
||||
val request = buildJsonObject {
|
||||
put("text", text)
|
||||
}
|
||||
setBody(request)
|
||||
}
|
||||
println(response)
|
||||
println(response.body<String>())
|
||||
if (!response.status.isSuccess()) {
|
||||
error("Request failed. $issueHumanId, ${response.body<String>()}")
|
||||
}
|
||||
}
|
||||
|
@@ -12,4 +12,9 @@ rootProject.name = 'IdeaVIM'
|
||||
include 'vim-engine'
|
||||
include 'scripts'
|
||||
include 'annotation-processors'
|
||||
|
||||
include 'tests:java-tests'
|
||||
include 'tests:property-tests'
|
||||
include 'tests:long-running-tests'
|
||||
include 'tests:ui-ij-tests'
|
||||
include 'tests:ui-py-tests'
|
||||
include 'tests:ui-fixtures'
|
||||
|
@@ -11,7 +11,7 @@ package com.maddyhome.idea.vim
|
||||
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.project.ProjectManagerListener
|
||||
import com.intellij.openapi.startup.StartupActivity
|
||||
import com.intellij.openapi.startup.ProjectActivity
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
import com.maddyhome.idea.vim.helper.EditorHelper
|
||||
import com.maddyhome.idea.vim.helper.localEditors
|
||||
@@ -20,16 +20,11 @@ import com.maddyhome.idea.vim.newapi.globalIjOptions
|
||||
/**
|
||||
* @author Alex Plate
|
||||
*/
|
||||
// This service should be migrated to ProjectActivity. But we should cariful because simple replacement
|
||||
// leads to deadlock in tests. I'm not sure about the exact reasons, but "invokeAndWait" inside "initialize" function
|
||||
// causes this deadlock. Good new: it's easy reproducible in tests.
|
||||
// Previous migration: fc7efd5484a13b40ba9bf86a1d5429e215d973f3
|
||||
// Revert: 24dd84b31cffb99eb6114524859a46d02717d33f
|
||||
internal class PluginStartup : StartupActivity.DumbAware/*, LightEditCompatible*/ {
|
||||
internal class PluginStartup : ProjectActivity/*, LightEditCompatible*/ {
|
||||
|
||||
private var firstInitializationOccurred = false
|
||||
|
||||
override fun runActivity(project: Project) {
|
||||
override suspend fun execute(project: Project) {
|
||||
if (firstInitializationOccurred) return
|
||||
firstInitializationOccurred = true
|
||||
|
||||
|
@@ -1,79 +0,0 @@
|
||||
/*
|
||||
* Copyright 2003-2023 The IdeaVim authors
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE.txt file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
package com.maddyhome.idea.vim;
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.extensions.ExtensionPointName;
|
||||
import com.maddyhome.idea.vim.group.KeyGroup;
|
||||
import com.maddyhome.idea.vim.handler.ActionBeanClass;
|
||||
import com.maddyhome.idea.vim.handler.EditorActionHandlerBase;
|
||||
import com.maddyhome.idea.vim.key.MappingOwner;
|
||||
import com.maddyhome.idea.vim.newapi.IjVimActionsInitiator;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.KeyEvent;
|
||||
|
||||
public class RegisterActions {
|
||||
|
||||
public static final ExtensionPointName<ActionBeanClass> VIM_ACTIONS_EP =
|
||||
ExtensionPointName.create("IdeaVIM.vimAction");
|
||||
|
||||
/**
|
||||
* Register all the key/action mappings for the plugin.
|
||||
*/
|
||||
public static void registerActions() {
|
||||
registerVimCommandActions();
|
||||
registerEmptyShortcuts();
|
||||
registerEpListener();
|
||||
}
|
||||
|
||||
private static void registerEpListener() {
|
||||
// IdeaVim doesn't support contribution to VIM_ACTIONS_EP extension point, so technically we can skip this update,
|
||||
// but let's support dynamic plugins in a more classic way and reload actions on every EP change.
|
||||
VIM_ACTIONS_EP.addChangeListener(() -> {
|
||||
unregisterActions();
|
||||
registerActions();
|
||||
}, VimPlugin.getInstance());
|
||||
}
|
||||
|
||||
public static @Nullable EditorActionHandlerBase findAction(@NotNull String id) {
|
||||
return VIM_ACTIONS_EP.getExtensionList(ApplicationManager.getApplication()).stream()
|
||||
.filter(vimActionBean -> vimActionBean.getActionId().equals(id)).findFirst().map(ActionBeanClass::getInstance)
|
||||
.orElse(null);
|
||||
}
|
||||
|
||||
public static @NotNull EditorActionHandlerBase findActionOrDie(@NotNull String id) {
|
||||
EditorActionHandlerBase action = findAction(id);
|
||||
if (action == null) throw new RuntimeException("Action " + id + " is not registered");
|
||||
return action;
|
||||
}
|
||||
|
||||
public static void unregisterActions() {
|
||||
KeyGroup keyGroup = VimPlugin.getKeyIfCreated();
|
||||
if (keyGroup != null) {
|
||||
keyGroup.unregisterCommandActions();
|
||||
}
|
||||
}
|
||||
|
||||
private static void registerVimCommandActions() {
|
||||
KeyGroup parser = VimPlugin.getKey();
|
||||
VIM_ACTIONS_EP.getExtensionList(ApplicationManager.getApplication()).stream().map(IjVimActionsInitiator::new)
|
||||
.forEach(parser::registerCommandAction);
|
||||
}
|
||||
|
||||
private static void registerEmptyShortcuts() {
|
||||
final KeyGroup parser = VimPlugin.getKey();
|
||||
|
||||
// The {char1} <BS> {char2} shortcut is handled directly by KeyHandler#handleKey, so doesn't have an action. But we
|
||||
// still need to register the shortcut, to make sure the editor doesn't swallow it.
|
||||
parser
|
||||
.registerShortcutWithoutAction(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0), MappingOwner.IdeaVim.System.INSTANCE);
|
||||
}
|
||||
}
|
57
src/main/java/com/maddyhome/idea/vim/RegisterActions.kt
Normal file
57
src/main/java/com/maddyhome/idea/vim/RegisterActions.kt
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright 2003-2023 The IdeaVim authors
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE.txt file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
package com.maddyhome.idea.vim
|
||||
|
||||
import com.maddyhome.idea.vim.action.EngineCommandProvider
|
||||
import com.maddyhome.idea.vim.action.IntellijCommandProvider
|
||||
import com.maddyhome.idea.vim.handler.EditorActionHandlerBase
|
||||
import com.maddyhome.idea.vim.key.MappingOwner
|
||||
import java.awt.event.KeyEvent
|
||||
import javax.swing.KeyStroke
|
||||
|
||||
public object RegisterActions {
|
||||
/**
|
||||
* Register all the key/action mappings for the plugin.
|
||||
*/
|
||||
@JvmStatic
|
||||
public fun registerActions() {
|
||||
registerVimCommandActions()
|
||||
registerEmptyShortcuts() // todo most likely it is not needed
|
||||
}
|
||||
|
||||
public fun findAction(id: String): EditorActionHandlerBase? {
|
||||
val commandBean = EngineCommandProvider.getCommands().firstOrNull { it.actionId == id }
|
||||
?: IntellijCommandProvider.getCommands().firstOrNull { it.actionId == id } ?: return null
|
||||
return commandBean.instance
|
||||
}
|
||||
|
||||
public fun findActionOrDie(id: String): EditorActionHandlerBase {
|
||||
return findAction(id) ?: throw RuntimeException("Action $id is not registered")
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public fun unregisterActions() {
|
||||
val keyGroup = VimPlugin.getKeyIfCreated()
|
||||
keyGroup?.unregisterCommandActions()
|
||||
}
|
||||
|
||||
private fun registerVimCommandActions() {
|
||||
val parser = VimPlugin.getKey()
|
||||
EngineCommandProvider.getCommands().forEach { parser.registerCommandAction(it) }
|
||||
IntellijCommandProvider.getCommands().forEach { parser.registerCommandAction(it) }
|
||||
}
|
||||
|
||||
private fun registerEmptyShortcuts() {
|
||||
val parser = VimPlugin.getKey()
|
||||
|
||||
// The {char1} <BS> {char2} shortcut is handled directly by KeyHandler#handleKey, so doesn't have an action. But we
|
||||
// still need to register the shortcut, to make sure the editor doesn't swallow it.
|
||||
parser
|
||||
.registerShortcutWithoutAction(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0), MappingOwner.IdeaVim.System)
|
||||
}
|
||||
}
|
@@ -39,11 +39,9 @@ import com.maddyhome.idea.vim.listener.VimListenerManager;
|
||||
import com.maddyhome.idea.vim.newapi.IjVimInjector;
|
||||
import com.maddyhome.idea.vim.ui.StatusBarIconFactory;
|
||||
import com.maddyhome.idea.vim.ui.ex.ExEntryPanel;
|
||||
import com.maddyhome.idea.vim.vimscript.services.OptionService;
|
||||
import com.maddyhome.idea.vim.vimscript.services.VariableService;
|
||||
import com.maddyhome.idea.vim.yank.YankGroupBase;
|
||||
import org.jdom.Element;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -117,12 +115,6 @@ public class VimPlugin implements PersistentStateComponent<Element>, Disposable
|
||||
return ApplicationManager.getApplication().getService(CommandGroup.class);
|
||||
}
|
||||
|
||||
@Deprecated // "Please use `injector.markService` instead"
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.3")
|
||||
public static @NotNull MarkGroup getMark() {
|
||||
return ApplicationManager.getApplication().getService(MarkGroup.class);
|
||||
}
|
||||
|
||||
public static @NotNull RegisterGroup getRegister() {
|
||||
return ((RegisterGroup)VimInjectorKt.getInjector().getRegisterGroup());
|
||||
}
|
||||
@@ -195,13 +187,6 @@ public class VimPlugin implements PersistentStateComponent<Element>, Disposable
|
||||
return VimInjectorKt.getInjector().getOptionGroup();
|
||||
}
|
||||
|
||||
/** Deprecated: Use getOptionGroup */
|
||||
@Deprecated
|
||||
// Used by which-key 0.8.0, IdeaVimExtension 1.6.5 + 1.6.8
|
||||
public static @NotNull OptionService getOptionService() {
|
||||
return VimInjectorKt.getInjector().getOptionService();
|
||||
}
|
||||
|
||||
private static @NotNull NotificationService getNotifications() {
|
||||
return getNotifications(null);
|
||||
}
|
||||
@@ -219,6 +204,10 @@ public class VimPlugin implements PersistentStateComponent<Element>, Disposable
|
||||
return getInstance().enabled;
|
||||
}
|
||||
|
||||
public static boolean isNotEnabled() {
|
||||
return !isEnabled();
|
||||
}
|
||||
|
||||
public static void setEnabled(final boolean enabled) {
|
||||
if (isEnabled() == enabled) return;
|
||||
|
||||
@@ -232,7 +221,13 @@ public class VimPlugin implements PersistentStateComponent<Element>, Disposable
|
||||
getInstance().turnOnPlugin();
|
||||
}
|
||||
|
||||
StatusBarIconFactory.Companion.updateIcon();
|
||||
if (enabled) {
|
||||
VimInjectorKt.getInjector().getListenersNotifier().notifyPluginTurnedOn();
|
||||
} else {
|
||||
VimInjectorKt.getInjector().getListenersNotifier().notifyPluginTurnedOff();
|
||||
}
|
||||
|
||||
StatusBarIconFactory.Util.INSTANCE.updateIcon();
|
||||
}
|
||||
|
||||
public static String getMessage() {
|
||||
@@ -264,7 +259,8 @@ public class VimPlugin implements PersistentStateComponent<Element>, Disposable
|
||||
if (enabled) {
|
||||
Application application = ApplicationManager.getApplication();
|
||||
if (application.isUnitTestMode()) {
|
||||
application.invokeAndWait(this::turnOnPlugin);
|
||||
turnOnPlugin();
|
||||
//application.invokeAndWait(this::turnOnPlugin);
|
||||
}
|
||||
else {
|
||||
application.invokeLater(this::turnOnPlugin);
|
||||
@@ -306,11 +302,6 @@ public class VimPlugin implements PersistentStateComponent<Element>, Disposable
|
||||
* This is required to ensure that all options are correctly initialised and registered. Must be before any commands
|
||||
* are executed.</li>
|
||||
* <li>~/.ideavimrc execution<br>
|
||||
* <ul>
|
||||
* <li>4.1 executes commands from the .ideavimrc file and 4.2 initializes extensions.</li>
|
||||
* <li>4.1 MUST BE BEFORE 4.2. This is a flow of vim/IdeaVim initialization, firstly .ideavimrc is executed and then
|
||||
* the extensions are initialized.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Components initialization<br>
|
||||
* This should happen after ideavimrc execution because VimListenerManager accesses `number` option
|
||||
@@ -339,13 +330,9 @@ public class VimPlugin implements PersistentStateComponent<Element>, Disposable
|
||||
VimInjectorKt.getInjector().getOptionGroup().initialiseOptions();
|
||||
|
||||
// 4) ~/.ideavimrc execution
|
||||
// 4.1) Execute ~/.ideavimrc
|
||||
// Evaluate in the context of the fallback window, to capture local option state, to copy to the first editor window
|
||||
registerIdeavimrc(VimInjectorKt.getInjector().getFallbackWindow());
|
||||
|
||||
// 4.2) Initialize extensions. Always after 4.1
|
||||
VimExtensionRegistrar.enableDelayedExtensions();
|
||||
|
||||
// Turing on should be performed after all commands registration
|
||||
getSearch().turnOn();
|
||||
VimListenerManager.INSTANCE.turnOn();
|
||||
|
@@ -28,8 +28,11 @@ import javax.swing.KeyStroke
|
||||
* Accepts all regular keystrokes and passes them on to the Vim key handler.
|
||||
*
|
||||
* IDE shortcut keys used by Vim commands are handled by [com.maddyhome.idea.vim.action.VimShortcutKeyAction].
|
||||
*
|
||||
* This class is used in Which-Key plugin, so don't make it internal. Generally, we should provide a proper
|
||||
* way to get ideavim keys for this plugin. See VIM-3085
|
||||
*/
|
||||
internal class VimTypedActionHandler(origHandler: TypedActionHandler) : TypedActionHandlerEx {
|
||||
public class VimTypedActionHandler(origHandler: TypedActionHandler) : TypedActionHandlerEx {
|
||||
private val handler = KeyHandler.getInstance()
|
||||
private val traceTime = injector.globalOptions().ideatracetime
|
||||
|
||||
@@ -86,7 +89,7 @@ internal class VimTypedActionHandler(origHandler: TypedActionHandler) : TypedAct
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
internal companion object {
|
||||
private val LOG = logger<VimTypedActionHandler>()
|
||||
}
|
||||
}
|
||||
|
@@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.VimPlugin
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@@ -14,6 +16,7 @@ import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
|
||||
@CommandOrMotion(keys = [":"], modes = [Mode.NORMAL, Mode.VISUAL, Mode.OP_PENDING])
|
||||
internal class ExEntryAction : VimActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.OTHER_READONLY
|
||||
|
||||
|
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* Copyright 2003-2023 The IdeaVim authors
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE.txt file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
|
||||
package com.maddyhome.idea.vim.action
|
||||
|
||||
public object IntellijCommandProvider : CommandProvider {
|
||||
override val commandListFileName: String = "intellij_commands.json"
|
||||
}
|
@@ -14,14 +14,10 @@ import com.intellij.openapi.actionSystem.ActionUpdateThread
|
||||
import com.intellij.openapi.actionSystem.AnAction
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent
|
||||
import com.intellij.openapi.actionSystem.AnActionWrapper
|
||||
import com.intellij.openapi.actionSystem.IdeActions
|
||||
import com.intellij.openapi.actionSystem.KeyboardShortcut
|
||||
import com.intellij.openapi.actionSystem.PlatformDataKeys
|
||||
import com.intellij.openapi.application.invokeLater
|
||||
import com.intellij.openapi.diagnostic.logger
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.openapi.editor.actionSystem.EditorActionManager
|
||||
import com.intellij.openapi.keymap.KeymapManager
|
||||
import com.intellij.openapi.progress.ProcessCanceledException
|
||||
import com.intellij.openapi.project.DumbAware
|
||||
import com.intellij.openapi.util.Key
|
||||
@@ -59,9 +55,17 @@ import javax.swing.KeyStroke
|
||||
*
|
||||
*
|
||||
* These keys are not passed to [com.maddyhome.idea.vim.VimTypedActionHandler] and should be handled by actions.
|
||||
*
|
||||
* This class is used in Which-Key plugin, so don't make it internal. Generally, we should provide a proper
|
||||
* way to get ideavim keys for this plugin. See VIM-3085
|
||||
*/
|
||||
internal class VimShortcutKeyAction : AnAction(), DumbAware/*, LightEditCompatible*/ {
|
||||
private val traceTime = injector.globalOptions().ideatracetime
|
||||
public class VimShortcutKeyAction : AnAction(), DumbAware/*, LightEditCompatible*/ {
|
||||
private val traceTime: Boolean
|
||||
get() {
|
||||
// Make sure the injector is initialized
|
||||
VimPlugin.getInstance()
|
||||
return injector.globalOptions().ideatracetime
|
||||
}
|
||||
|
||||
override fun actionPerformed(e: AnActionEvent) {
|
||||
LOG.trace("Executing shortcut key action")
|
||||
@@ -95,28 +99,30 @@ internal class VimShortcutKeyAction : AnAction(), DumbAware/*, LightEditCompatib
|
||||
|
||||
// There is a chance that we can use BGT, but we call for isCell inside the update.
|
||||
// Not sure if can can use BGT with this call. Let's use EDT for now.
|
||||
override fun getActionUpdateThread() = ActionUpdateThread.EDT
|
||||
override fun getActionUpdateThread(): ActionUpdateThread = ActionUpdateThread.EDT
|
||||
|
||||
override fun update(e: AnActionEvent) {
|
||||
val start = if (traceTime) System.currentTimeMillis() else null
|
||||
val actionEnableStatus = isEnabled(e)
|
||||
val keyStroke = getKeyStroke(e)
|
||||
val actionEnableStatus = isEnabled(e, keyStroke)
|
||||
e.presentation.isEnabled = actionEnableStatus.isEnabled
|
||||
actionEnableStatus.printLog()
|
||||
actionEnableStatus.printLog(keyStroke)
|
||||
if (start != null) {
|
||||
val keyStroke = getKeyStroke(e)
|
||||
val duration = System.currentTimeMillis() - start
|
||||
LOG.info("VimShortcut update '$keyStroke': $duration ms")
|
||||
}
|
||||
}
|
||||
|
||||
private fun isEnabled(e: AnActionEvent): ActionEnableStatus {
|
||||
if (!VimPlugin.isEnabled()) return ActionEnableStatus.no("IdeaVim is disabled", LogLevel.DEBUG)
|
||||
private fun isEnabled(e: AnActionEvent, keyStroke: KeyStroke?): ActionEnableStatus {
|
||||
if (VimPlugin.isNotEnabled()) return ActionEnableStatus.no("IdeaVim is disabled", LogLevel.DEBUG)
|
||||
val editor = getEditor(e)
|
||||
val keyStroke = getKeyStroke(e)
|
||||
if (editor != null && keyStroke != null) {
|
||||
if (enableOctopus) {
|
||||
if (isOctopusEnabled(keyStroke, editor)) {
|
||||
return ActionEnableStatus.no("Octopus handler is enabled", LogLevel.DEBUG)
|
||||
return ActionEnableStatus.no(
|
||||
"Processing VimShortcutKeyAction for the key that is used in the octopus handler",
|
||||
LogLevel.ERROR
|
||||
)
|
||||
}
|
||||
}
|
||||
if (editor.isIdeaVimDisabledHere) {
|
||||
@@ -164,14 +170,6 @@ internal class VimShortcutKeyAction : AnAction(), DumbAware/*, LightEditCompatib
|
||||
return ActionEnableStatus.no("App code template is active", LogLevel.INFO)
|
||||
}
|
||||
|
||||
val nextTemplateVariableShortcuts = KeymapManager.getInstance().activeKeymap.getShortcuts(IdeActions.ACTION_EDITOR_NEXT_TEMPLATE_VARIABLE)
|
||||
if (nextTemplateVariableShortcuts.any { it is KeyboardShortcut && it.firstKeyStroke == keyStroke }) {
|
||||
val handler = EditorActionManager.getInstance().getActionHandler(IdeActions.ACTION_EDITOR_NEXT_TEMPLATE_VARIABLE)
|
||||
if (handler.isEnabled(editor, null, e.dataContext)) {
|
||||
return ActionEnableStatus.no("Next template variable or finish in-place refactoring", LogLevel.INFO)
|
||||
}
|
||||
}
|
||||
|
||||
if (editor.inInsertMode) {
|
||||
if (keyCode == KeyEvent.VK_TAB) {
|
||||
// TODO: This stops VimEditorTab seeing <Tab> in insert mode and correctly scrolling the view
|
||||
@@ -237,9 +235,9 @@ internal class VimShortcutKeyAction : AnAction(), DumbAware/*, LightEditCompatib
|
||||
/**
|
||||
* getDefaultKeyStroke is needed for NEO layout keyboard VIM-987
|
||||
* but we should cache the value because on the second call (isEnabled -> actionPerformed)
|
||||
* the event is already consumed
|
||||
* the event is already consumed and getDefaultKeyStroke returns null
|
||||
*/
|
||||
private var keyStrokeCache: Pair<KeyEvent?, KeyStroke?> = null to null
|
||||
private var keyStrokeCache: Pair<Long?, KeyStroke?> = null to null
|
||||
|
||||
private fun getKeyStroke(e: AnActionEvent): KeyStroke? {
|
||||
val inputEvent = e.inputEvent
|
||||
@@ -247,9 +245,9 @@ internal class VimShortcutKeyAction : AnAction(), DumbAware/*, LightEditCompatib
|
||||
val defaultKeyStroke = KeyStrokeAdapter.getDefaultKeyStroke(inputEvent)
|
||||
val strokeCache = keyStrokeCache
|
||||
if (defaultKeyStroke != null) {
|
||||
keyStrokeCache = inputEvent to defaultKeyStroke
|
||||
keyStrokeCache = inputEvent.`when` to defaultKeyStroke
|
||||
return defaultKeyStroke
|
||||
} else if (strokeCache.first === inputEvent) {
|
||||
} else if (strokeCache.first == inputEvent.`when`) {
|
||||
keyStrokeCache = null to null
|
||||
return strokeCache.second
|
||||
}
|
||||
@@ -282,7 +280,7 @@ internal class VimShortcutKeyAction : AnAction(), DumbAware/*, LightEditCompatib
|
||||
.toSet()
|
||||
}
|
||||
|
||||
companion object {
|
||||
internal companion object {
|
||||
@JvmField
|
||||
val VIM_ONLY_EDITOR_KEYS: Set<KeyStroke> =
|
||||
ImmutableSet.builder<KeyStroke>().addAll(getKeyStrokes(KeyEvent.VK_ENTER, 0))
|
||||
@@ -373,10 +371,12 @@ private class ActionEnableStatus(
|
||||
val message: String,
|
||||
val logLevel: LogLevel,
|
||||
) {
|
||||
fun printLog() {
|
||||
fun printLog(keyStroke: KeyStroke?) {
|
||||
val message = "IdeaVim keys are enabled = $isEnabled for key '$keyStroke': $message"
|
||||
when (logLevel) {
|
||||
LogLevel.INFO -> LOG.info("IdeaVim keys are enabled = $isEnabled: $message")
|
||||
LogLevel.DEBUG -> LOG.debug("IdeaVim keys are enabled = $isEnabled: $message")
|
||||
LogLevel.INFO -> LOG.info(message)
|
||||
LogLevel.DEBUG -> LOG.debug(message)
|
||||
LogLevel.ERROR -> LOG.error(message)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -389,5 +389,5 @@ private class ActionEnableStatus(
|
||||
}
|
||||
|
||||
private enum class LogLevel {
|
||||
DEBUG, INFO,
|
||||
DEBUG, INFO, ERROR,
|
||||
}
|
@@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.KeyHandler
|
||||
import com.maddyhome.idea.vim.VimPlugin
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
@@ -16,9 +18,7 @@ import com.maddyhome.idea.vim.api.injector
|
||||
import com.maddyhome.idea.vim.api.setChangeMarks
|
||||
import com.maddyhome.idea.vim.command.Argument
|
||||
import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.command.CommandFlags
|
||||
import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.state.mode.SelectionType
|
||||
import com.maddyhome.idea.vim.common.TextRange
|
||||
import com.maddyhome.idea.vim.common.argumentCaptured
|
||||
import com.maddyhome.idea.vim.group.MotionGroup
|
||||
@@ -26,10 +26,9 @@ import com.maddyhome.idea.vim.group.visual.VimSelection
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler
|
||||
import com.maddyhome.idea.vim.helper.MessageHelper
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import com.maddyhome.idea.vim.helper.vimStateMachine
|
||||
import com.maddyhome.idea.vim.newapi.ij
|
||||
import java.util.*
|
||||
import com.maddyhome.idea.vim.state.mode.SelectionType
|
||||
|
||||
// todo make it multicaret
|
||||
private fun doOperatorAction(editor: VimEditor, context: ExecutionContext, textRange: TextRange, selectionType: SelectionType): Boolean {
|
||||
@@ -47,6 +46,7 @@ private fun doOperatorAction(editor: VimEditor, context: ExecutionContext, textR
|
||||
return result
|
||||
}
|
||||
|
||||
@CommandOrMotion(keys = ["g@"], modes = [Mode.NORMAL])
|
||||
internal class OperatorAction : VimActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.OTHER_SELF_SYNCHRONIZED
|
||||
|
||||
@@ -97,11 +97,10 @@ internal class OperatorAction : VimActionHandler.SingleExecution() {
|
||||
}
|
||||
}
|
||||
|
||||
@CommandOrMotion(keys = ["g@"], modes = [Mode.VISUAL])
|
||||
internal class VisualOperatorAction : VisualOperatorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.OTHER_SELF_SYNCHRONIZED
|
||||
|
||||
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_EXIT_VISUAL)
|
||||
|
||||
override fun executeAction(
|
||||
editor: VimEditor,
|
||||
caret: VimCaret,
|
||||
|
@@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.intellij.openapi.command.CommandProcessor
|
||||
import com.maddyhome.idea.vim.VimPlugin
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
@@ -18,6 +20,7 @@ import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
import com.maddyhome.idea.vim.helper.vimStateMachine
|
||||
import com.maddyhome.idea.vim.newapi.ij
|
||||
|
||||
@CommandOrMotion(keys = ["."], modes = [Mode.NORMAL])
|
||||
internal class RepeatChangeAction : VimActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.OTHER_WRITABLE
|
||||
|
||||
|
@@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.delete
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@@ -17,6 +19,7 @@ import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
import com.maddyhome.idea.vim.newapi.ijOptions
|
||||
|
||||
@CommandOrMotion(keys = ["gJ"], modes = [Mode.NORMAL])
|
||||
public class DeleteJoinLinesAction : ChangeEditorActionHandler.ConditionalSingleExecution() {
|
||||
override val type: Command.Type = Command.Type.DELETE
|
||||
override fun runAsMulticaret(
|
||||
|
@@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.delete
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
@@ -16,6 +18,7 @@ import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
import com.maddyhome.idea.vim.newapi.ijOptions
|
||||
|
||||
@CommandOrMotion(keys = ["J"], modes = [Mode.NORMAL])
|
||||
public class DeleteJoinLinesSpacesAction : ChangeEditorActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.DELETE
|
||||
|
||||
|
@@ -7,27 +7,25 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.delete
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.command.CommandFlags
|
||||
import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.group.visual.VimSelection
|
||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import com.maddyhome.idea.vim.newapi.ijOptions
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* @author vlan
|
||||
*/
|
||||
@CommandOrMotion(keys = ["gJ"], modes = [Mode.VISUAL])
|
||||
public class DeleteJoinVisualLinesAction : VisualOperatorActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.DELETE
|
||||
|
||||
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_EXIT_VISUAL)
|
||||
|
||||
override fun executeForAllCarets(
|
||||
editor: VimEditor,
|
||||
context: ExecutionContext,
|
||||
|
@@ -7,27 +7,25 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.delete
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.command.CommandFlags
|
||||
import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.group.visual.VimSelection
|
||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import com.maddyhome.idea.vim.newapi.ijOptions
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* @author vlan
|
||||
*/
|
||||
@CommandOrMotion(keys = ["J"], modes = [Mode.VISUAL])
|
||||
public class DeleteJoinVisualLinesSpacesAction : VisualOperatorActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.DELETE
|
||||
|
||||
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_EXIT_VISUAL)
|
||||
|
||||
override fun executeForAllCarets(
|
||||
editor: VimEditor,
|
||||
context: ExecutionContext,
|
||||
|
@@ -9,7 +9,8 @@
|
||||
package com.maddyhome.idea.vim.action.editor
|
||||
|
||||
import com.intellij.openapi.actionSystem.IdeActions
|
||||
import com.maddyhome.idea.vim.action.ComplicatedKeysAction
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
@@ -19,53 +20,37 @@ import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.IdeActionHandler
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import java.awt.event.KeyEvent
|
||||
import java.util.*
|
||||
import javax.swing.KeyStroke
|
||||
|
||||
internal class VimEditorBackSpace : IdeActionHandler(IdeActions.ACTION_EDITOR_BACKSPACE), ComplicatedKeysAction {
|
||||
override val keyStrokesSet: Set<List<KeyStroke>> = setOf(
|
||||
listOf(KeyStroke.getKeyStroke(KeyEvent.VK_H, KeyEvent.CTRL_DOWN_MASK)),
|
||||
listOf(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0)),
|
||||
)
|
||||
@CommandOrMotion(keys = ["<C-H>", "<BS>"], modes = [Mode.INSERT])
|
||||
internal class VimEditorBackSpace : IdeActionHandler(IdeActions.ACTION_EDITOR_BACKSPACE) {
|
||||
override val type: Command.Type = Command.Type.DELETE
|
||||
}
|
||||
|
||||
internal class VimEditorDelete : IdeActionHandler(IdeActions.ACTION_EDITOR_DELETE), ComplicatedKeysAction {
|
||||
override val keyStrokesSet: Set<List<KeyStroke>> = setOf(
|
||||
listOf(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0)),
|
||||
)
|
||||
@CommandOrMotion(keys = ["<Del>"], modes = [Mode.INSERT])
|
||||
internal class VimEditorDelete : IdeActionHandler(IdeActions.ACTION_EDITOR_DELETE) {
|
||||
override val type: Command.Type = Command.Type.DELETE
|
||||
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_SAVE_STROKE)
|
||||
}
|
||||
|
||||
internal class VimEditorDown : IdeActionHandler(IdeActions.ACTION_EDITOR_MOVE_CARET_DOWN), ComplicatedKeysAction {
|
||||
override val keyStrokesSet: Set<List<KeyStroke>> = setOf(
|
||||
listOf(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0)),
|
||||
listOf(KeyStroke.getKeyStroke(KeyEvent.VK_KP_DOWN, 0)),
|
||||
)
|
||||
@CommandOrMotion(keys = ["<Down>", "<kDown>"], modes = [Mode.INSERT])
|
||||
internal class VimEditorDown : IdeActionHandler(IdeActions.ACTION_EDITOR_MOVE_CARET_DOWN) {
|
||||
override val type: Command.Type = Command.Type.MOTION
|
||||
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_CLEAR_STROKES)
|
||||
}
|
||||
|
||||
internal class VimEditorTab : IdeActionHandler(IdeActions.ACTION_EDITOR_TAB), ComplicatedKeysAction {
|
||||
override val keyStrokesSet: Set<List<KeyStroke>> = setOf(
|
||||
listOf(KeyStroke.getKeyStroke(KeyEvent.VK_I, KeyEvent.CTRL_DOWN_MASK)),
|
||||
listOf(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0)),
|
||||
)
|
||||
@CommandOrMotion(keys = ["<Tab>", "<C-I>"], modes = [Mode.INSERT])
|
||||
internal class VimEditorTab : IdeActionHandler(IdeActions.ACTION_EDITOR_TAB) {
|
||||
override val type: Command.Type = Command.Type.INSERT
|
||||
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_SAVE_STROKE)
|
||||
}
|
||||
|
||||
internal class VimEditorUp : IdeActionHandler(IdeActions.ACTION_EDITOR_MOVE_CARET_UP), ComplicatedKeysAction {
|
||||
override val keyStrokesSet: Set<List<KeyStroke>> = setOf(
|
||||
listOf(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0)),
|
||||
listOf(KeyStroke.getKeyStroke(KeyEvent.VK_KP_UP, 0)),
|
||||
)
|
||||
@CommandOrMotion(keys = ["<Up>", "<kUp>"], modes = [Mode.INSERT])
|
||||
internal class VimEditorUp : IdeActionHandler(IdeActions.ACTION_EDITOR_MOVE_CARET_UP) {
|
||||
override val type: Command.Type = Command.Type.MOTION
|
||||
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_CLEAR_STROKES)
|
||||
}
|
||||
|
||||
@CommandOrMotion(keys = ["K"], modes = [Mode.NORMAL])
|
||||
internal class VimQuickJavaDoc : VimActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.OTHER_READONLY
|
||||
|
||||
|
@@ -7,8 +7,9 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.ex
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.VimPlugin
|
||||
import com.maddyhome.idea.vim.action.ComplicatedKeysAction
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.command.Command
|
||||
@@ -16,17 +17,14 @@ import com.maddyhome.idea.vim.command.CommandFlags
|
||||
import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
import java.util.*
|
||||
import javax.swing.KeyStroke
|
||||
|
||||
/**
|
||||
* Called by KeyHandler to process the contents of the ex entry panel
|
||||
*
|
||||
* The mapping for this action means that the ex command is executed as a write action
|
||||
*/
|
||||
public class ProcessExEntryAction : VimActionHandler.SingleExecution(), ComplicatedKeysAction {
|
||||
override val keyStrokesSet: Set<List<KeyStroke>> =
|
||||
parseKeysSet("<CR>", "<C-M>", 0x0a.toChar().toString(), 0x0d.toChar().toString())
|
||||
|
||||
@CommandOrMotion(keys = ["<CR>", "<C-M>", "<C-J>"], modes = [Mode.CMD_LINE])
|
||||
public class ProcessExEntryAction : VimActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.OTHER_SELF_SYNCHRONIZED
|
||||
|
||||
override val flags: EnumSet<CommandFlags> = EnumSet.of(CommandFlags.FLAG_COMPLETE_EX)
|
||||
|
@@ -27,7 +27,7 @@ public class CommandState(private val machine: VimStateMachine) {
|
||||
get() {
|
||||
val myMode = machine.mode
|
||||
return when (myMode) {
|
||||
com.maddyhome.idea.vim.state.mode.Mode.CMD_LINE -> CommandState.Mode.CMD_LINE
|
||||
is com.maddyhome.idea.vim.state.mode.Mode.CMD_LINE -> CommandState.Mode.CMD_LINE
|
||||
com.maddyhome.idea.vim.state.mode.Mode.INSERT -> CommandState.Mode.INSERT
|
||||
is com.maddyhome.idea.vim.state.mode.Mode.NORMAL -> CommandState.Mode.COMMAND
|
||||
is com.maddyhome.idea.vim.state.mode.Mode.OP_PENDING -> CommandState.Mode.OP_PENDING
|
||||
|
@@ -9,6 +9,7 @@ package com.maddyhome.idea.vim.extension
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager
|
||||
import com.intellij.openapi.components.service
|
||||
import com.intellij.openapi.diagnostic.logger
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.maddyhome.idea.vim.KeyHandler
|
||||
import com.maddyhome.idea.vim.VimPlugin
|
||||
@@ -17,7 +18,6 @@ import com.maddyhome.idea.vim.api.ImmutableVimCaret
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
import com.maddyhome.idea.vim.command.MappingMode
|
||||
import com.maddyhome.idea.vim.state.mode.SelectionType
|
||||
import com.maddyhome.idea.vim.common.CommandAlias
|
||||
import com.maddyhome.idea.vim.common.CommandAliasHandler
|
||||
import com.maddyhome.idea.vim.helper.CommandLineHelper
|
||||
@@ -26,6 +26,7 @@ import com.maddyhome.idea.vim.helper.vimStateMachine
|
||||
import com.maddyhome.idea.vim.key.MappingOwner
|
||||
import com.maddyhome.idea.vim.key.OperatorFunction
|
||||
import com.maddyhome.idea.vim.newapi.vim
|
||||
import com.maddyhome.idea.vim.state.mode.SelectionType
|
||||
import com.maddyhome.idea.vim.ui.ModalEntry
|
||||
import java.awt.event.KeyEvent
|
||||
import javax.swing.KeyStroke
|
||||
@@ -38,6 +39,9 @@ import javax.swing.KeyStroke
|
||||
* @author vlan
|
||||
*/
|
||||
public object VimExtensionFacade {
|
||||
|
||||
private val LOG = logger<VimExtensionFacade>()
|
||||
|
||||
/** The 'map' command for mapping keys to handlers defined in extensions. */
|
||||
@JvmStatic
|
||||
public fun putExtensionHandlerMapping(
|
||||
@@ -140,10 +144,12 @@ public object VimExtensionFacade {
|
||||
public fun inputKeyStroke(editor: Editor): KeyStroke {
|
||||
if (editor.vim.vimStateMachine.isDotRepeatInProgress) {
|
||||
val input = Extension.consumeKeystroke()
|
||||
LOG.trace("inputKeyStroke: dot repeat in progress. Input: $input")
|
||||
return input ?: error("Not enough keystrokes saved: ${Extension.lastExtensionHandler}")
|
||||
}
|
||||
|
||||
val key: KeyStroke? = if (ApplicationManager.getApplication().isUnitTestMode) {
|
||||
LOG.trace("Unit test mode is active")
|
||||
val mappingStack = KeyHandler.getInstance().keyStack
|
||||
mappingStack.feedSomeStroke() ?: TestInputModel.getInstance(editor).nextKeyStroke()?.also {
|
||||
if (editor.vim.vimStateMachine.isRecording) {
|
||||
@@ -151,11 +157,13 @@ public object VimExtensionFacade {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
LOG.trace("Getting char from the modal entry...")
|
||||
var ref: KeyStroke? = null
|
||||
ModalEntry.activate(editor.vim) { stroke: KeyStroke? ->
|
||||
ref = stroke
|
||||
false
|
||||
}
|
||||
LOG.trace("Got char $ref")
|
||||
ref
|
||||
}
|
||||
val result = key ?: KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE.toChar())
|
||||
|
@@ -53,6 +53,11 @@ internal object VimExtensionRegistrar : VimExtensionRegistrator {
|
||||
@Synchronized
|
||||
private fun registerExtension(extensionBean: ExtensionBeanClass) {
|
||||
val name = extensionBean.name ?: extensionBean.instance.name
|
||||
if (name == "sneak" && extensionBean.name == null) {
|
||||
// Filter out the old ideavim-sneak extension that used to be a separate plugin
|
||||
// https://github.com/Mishkun/ideavim-sneak
|
||||
return
|
||||
}
|
||||
if (name in registeredExtensions) return
|
||||
|
||||
registeredExtensions.add(name)
|
||||
@@ -82,6 +87,31 @@ internal object VimExtensionRegistrar : VimExtensionRegistrator {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* During vim initialization process, it firstly loads the .vimrc file, then executes scripts from the plugins folder.
|
||||
* This practically means that the .vimrc file is initialized first, then the plugins are loaded.
|
||||
* See `:h initialization`
|
||||
*
|
||||
* In IdeaVim we don't have a separate plugins folder to load it after .ideavimrc load. However, we can collect
|
||||
* the list of plugins mentioned in the .ideavimrc and load them after .ideavimrc execution is finished.
|
||||
*
|
||||
* Why this matters? Because this affects the order of commands are executed. For example:
|
||||
* ```
|
||||
* plug 'tommcdo/vim-exchange'
|
||||
* let g:exchange_no_mappings=1
|
||||
* ```
|
||||
* Here the user will expect that the exchange plugin won't have default mappings. However, if we load vim-exchange
|
||||
* immediately, this variable won't be initialized at the moment of plugin initialization.
|
||||
*
|
||||
* There is also a tricky case for mappings override:
|
||||
* ```
|
||||
* plug 'tommcdo/vim-exchange'
|
||||
* map X <Plug>(ExchangeLine)
|
||||
* ```
|
||||
* For this case, a plugin with a good implementation detects that there is already a defined mapping for
|
||||
* `<Plug>(ExchangeLine)` and doesn't register the default cxx mapping. However, such detection requires the mapping
|
||||
* to be defined before the plugin initialization.
|
||||
*/
|
||||
@JvmStatic
|
||||
fun enableDelayedExtensions() {
|
||||
delayedExtensionEnabling.forEach {
|
||||
|
@@ -11,6 +11,7 @@ import com.intellij.codeInsight.actions.AsyncActionExecutionService
|
||||
import com.intellij.openapi.actionSystem.IdeActions
|
||||
import com.intellij.openapi.application.runWriteAction
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.util.Ref
|
||||
import com.intellij.psi.PsiComment
|
||||
import com.intellij.psi.PsiElement
|
||||
@@ -74,19 +75,26 @@ internal class CommentaryExtension : VimExtension {
|
||||
listOf(IdeActions.ACTION_COMMENT_BLOCK, IdeActions.ACTION_COMMENT_LINE)
|
||||
}
|
||||
|
||||
val res = Ref.create<Boolean>(true)
|
||||
AsyncActionExecutionService.getInstance(editor.ij.project!!).withExecutionAfterAction(actions[0], {
|
||||
res.set(injector.actionExecutor.executeAction(actions[0], context))
|
||||
}, { afterCommenting(mode, editor, resetCaret, range) })
|
||||
if (!res.get()) {
|
||||
AsyncActionExecutionService.getInstance(editor.ij.project!!).withExecutionAfterAction(actions[1], {
|
||||
res.set(injector.actionExecutor.executeAction(actions[1], context))
|
||||
}, { afterCommenting(mode, editor, resetCaret, range) })
|
||||
}
|
||||
res.get()
|
||||
val project = editor.ij.project!!
|
||||
val callback = { afterCommenting(mode, editor, resetCaret, range) }
|
||||
actions.any { executeActionWithCallbackOnSuccess(it, project, context, callback) }
|
||||
}
|
||||
}
|
||||
|
||||
private fun executeActionWithCallbackOnSuccess(
|
||||
action: String,
|
||||
project: Project,
|
||||
context: ExecutionContext,
|
||||
callback: () -> Unit,
|
||||
): Boolean {
|
||||
val res = Ref.create<Boolean>(false)
|
||||
AsyncActionExecutionService.getInstance(project).withExecutionAfterAction(
|
||||
action,
|
||||
{ res.set(injector.actionExecutor.executeAction(action, context)) },
|
||||
{ if (res.get()) callback() })
|
||||
return res.get()
|
||||
}
|
||||
|
||||
private fun afterCommenting(
|
||||
mode: Mode,
|
||||
editor: VimEditor,
|
||||
@@ -148,11 +156,6 @@ internal class CommentaryExtension : VimExtension {
|
||||
private class CommentaryOperatorHandler : OperatorFunction, ExtensionHandler {
|
||||
override val isRepeatable = true
|
||||
|
||||
// In this operator we process selection by ourselves. This is necessary for rider, VIM-1758
|
||||
override fun postProcessSelection(): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun execute(editor: VimEditor, context: ExecutionContext, operatorArguments: OperatorArguments) {
|
||||
setOperatorFunction(this)
|
||||
executeNormalWithoutMapping(injector.parser.parseKeys("g@"), editor.ij)
|
||||
|
@@ -217,6 +217,8 @@ private object FileTypePatterns {
|
||||
|
||||
return if (fileTypeName in htmlLikeFileTypes) {
|
||||
this.htmlPatterns
|
||||
} else if (fileTypeName == "JAVA" || fileExtension == "java") {
|
||||
this.javaPatterns
|
||||
} else if (fileTypeName == "Ruby" || fileExtension == "rb") {
|
||||
this.rubyPatterns
|
||||
} else if (fileTypeName == "RHTML" || fileExtension == "erb") {
|
||||
@@ -242,6 +244,7 @@ private object FileTypePatterns {
|
||||
)
|
||||
|
||||
private val htmlPatterns = createHtmlPatterns()
|
||||
private val javaPatterns = createJavaPatterns()
|
||||
private val rubyPatterns = createRubyPatterns()
|
||||
private val rubyAndHtmlPatterns = rubyPatterns + htmlPatterns
|
||||
private val phpPatterns = createPhpPatterns()
|
||||
@@ -270,6 +273,14 @@ private object FileTypePatterns {
|
||||
LanguagePatterns(linkedMapOf(openingTagPattern to htmlSearchPair), linkedMapOf(closingTagPattern to htmlSearchPair))
|
||||
)
|
||||
}
|
||||
|
||||
private fun createJavaPatterns(): LanguagePatterns {
|
||||
return (
|
||||
LanguagePatterns("\\b(?<!else\\s+)if\\b", "\\belse\\s+if\\b", "\\belse(?!\\s+if)\\b") +
|
||||
LanguagePatterns("\\bdo\\b", "\\bwhile\\b") +
|
||||
LanguagePatterns("\\btry\\b", "\\bcatch\\b", "\\bfinally\\b")
|
||||
)
|
||||
}
|
||||
|
||||
private fun createRubyPatterns(): LanguagePatterns {
|
||||
// Original patterns: https://github.com/vim/vim/blob/master/runtime/ftplugin/ruby.vim
|
||||
|
@@ -246,7 +246,7 @@ internal class VimMultipleCursorsExtension : VimExtension {
|
||||
|
||||
// Note that ignoreCase is not overridden by the `\C` in the pattern
|
||||
val pattern = makePattern(text, whole)
|
||||
val matches = SearchHelper.findAll(editor, pattern, 0, -1, false)
|
||||
val matches = injector.searchHelper.findAll(IjVimEditor(editor), pattern, 0, -1, false)
|
||||
for (match in matches) {
|
||||
if (match.contains(primaryCaret.offset)) {
|
||||
primaryCaret.vim.moveToOffset(match.startOffset)
|
||||
@@ -322,7 +322,7 @@ internal class VimMultipleCursorsExtension : VimExtension {
|
||||
searchOptions.add(SearchOptions.WRAP)
|
||||
}
|
||||
|
||||
return SearchHelper.findPattern(editor, makePattern(text, whole), startOffset, 1, searchOptions)?.startOffset ?: -1
|
||||
return injector.searchHelper.findPattern(IjVimEditor(editor), makePattern(text, whole), startOffset, 1, searchOptions)?.startOffset ?: -1
|
||||
}
|
||||
|
||||
private fun makePattern(text: String, whole: Boolean): String {
|
||||
|
@@ -502,6 +502,13 @@ internal class NerdTree : VimExtension {
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
for (c in ('a'..'z') + ('A'..'Z')) {
|
||||
val ks = KeyStroke.getKeyStroke(c)
|
||||
if (ks !in actionsRoot) {
|
||||
registerCommand(c.toString(), NerdAction.Code { _, _, _ -> })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
@@ -11,8 +11,8 @@ package com.maddyhome.idea.vim.extension.paragraphmotion
|
||||
import com.intellij.openapi.editor.Caret
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.api.getLineEndForOffset
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
import com.maddyhome.idea.vim.api.normalizeOffset
|
||||
import com.maddyhome.idea.vim.command.MappingMode
|
||||
import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.extension.ExtensionHandler
|
||||
@@ -45,8 +45,7 @@ internal class ParagraphMotion : VimExtension {
|
||||
}
|
||||
|
||||
fun moveCaretToNextParagraph(editor: VimEditor, caret: Caret, count: Int): Int? {
|
||||
return injector.searchHelper.findNextParagraph(editor, caret.vim, count, true)
|
||||
?.let { editor.normalizeOffset(it, true) }
|
||||
return injector.searchHelper.findNextParagraph(editor, caret.vim, count, true)?.let(editor::getLineEndForOffset)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,321 @@
|
||||
/*
|
||||
* Copyright 2003-2024 The IdeaVim authors
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE.txt file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
|
||||
package com.maddyhome.idea.vim.extension.sneak
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.openapi.editor.ScrollType
|
||||
import com.intellij.openapi.editor.colors.EditorColors
|
||||
import com.intellij.openapi.editor.markup.EffectType
|
||||
import com.intellij.openapi.editor.markup.HighlighterLayer
|
||||
import com.intellij.openapi.editor.markup.HighlighterTargetArea
|
||||
import com.intellij.openapi.editor.markup.RangeHighlighter
|
||||
import com.intellij.openapi.editor.markup.TextAttributes
|
||||
import com.intellij.openapi.util.Disposer
|
||||
import com.maddyhome.idea.vim.VimPlugin
|
||||
import com.maddyhome.idea.vim.VimProjectService
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
import com.maddyhome.idea.vim.api.options
|
||||
import com.maddyhome.idea.vim.command.MappingMode
|
||||
import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.common.TextRange
|
||||
import com.maddyhome.idea.vim.extension.ExtensionHandler
|
||||
import com.maddyhome.idea.vim.extension.VimExtension
|
||||
import com.maddyhome.idea.vim.extension.VimExtensionFacade
|
||||
import com.maddyhome.idea.vim.extension.VimExtensionFacade.putKeyMapping
|
||||
import com.maddyhome.idea.vim.extension.VimExtensionHandler
|
||||
import com.maddyhome.idea.vim.helper.StrictMode
|
||||
import com.maddyhome.idea.vim.newapi.ij
|
||||
import java.awt.Font
|
||||
import java.awt.event.KeyEvent
|
||||
import javax.swing.Timer
|
||||
|
||||
|
||||
private const val DEFAULT_HIGHLIGHT_DURATION_SNEAK = 300
|
||||
|
||||
// By [Mikhail Levchenko](https://github.com/Mishkun)
|
||||
// Original repository with the plugin: https://github.com/Mishkun/ideavim-sneak
|
||||
internal class IdeaVimSneakExtension : VimExtension {
|
||||
override fun getName(): String = "sneak"
|
||||
|
||||
override fun init() {
|
||||
val highlightHandler = HighlightHandler()
|
||||
mapToFunctionAndProvideKeys("s", SneakHandler(highlightHandler, Direction.FORWARD))
|
||||
mapToFunctionAndProvideKeys("S", SneakHandler(highlightHandler, Direction.BACKWARD))
|
||||
|
||||
// workaround to support ; and , commands
|
||||
mapToFunctionAndProvideKeys("f", SneakMemoryHandler("f"))
|
||||
mapToFunctionAndProvideKeys("F", SneakMemoryHandler("F"))
|
||||
mapToFunctionAndProvideKeys("t", SneakMemoryHandler("t"))
|
||||
mapToFunctionAndProvideKeys("T", SneakMemoryHandler("T"))
|
||||
|
||||
mapToFunctionAndProvideKeys(";", SneakRepeatHandler(highlightHandler, RepeatDirection.IDENTICAL))
|
||||
mapToFunctionAndProvideKeys(",", SneakRepeatHandler(highlightHandler, RepeatDirection.REVERSE))
|
||||
}
|
||||
|
||||
private class SneakHandler(
|
||||
private val highlightHandler: HighlightHandler,
|
||||
private val direction: Direction,
|
||||
) : ExtensionHandler {
|
||||
override fun execute(editor: VimEditor, context: ExecutionContext, operatorArguments: OperatorArguments) {
|
||||
val charone = getChar(editor) ?: return
|
||||
val chartwo = getChar(editor) ?: return
|
||||
val range = Util.jumpTo(editor, charone, chartwo, direction)
|
||||
range?.let { highlightHandler.highlightSneakRange(editor.ij, range) }
|
||||
Util.lastSymbols = "${charone}${chartwo}"
|
||||
Util.lastSDirection = direction
|
||||
}
|
||||
|
||||
private fun getChar(editor: VimEditor): Char? {
|
||||
val key = VimExtensionFacade.inputKeyStroke(editor.ij)
|
||||
return when {
|
||||
key.keyChar == KeyEvent.CHAR_UNDEFINED || key.keyCode == KeyEvent.VK_ESCAPE -> null
|
||||
else -> key.keyChar
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This class acts as proxy for normal find commands because we need to update [Util.lastSDirection]
|
||||
*/
|
||||
private class SneakMemoryHandler(private val char: String) : VimExtensionHandler {
|
||||
override fun execute(editor: Editor, context: DataContext) {
|
||||
Util.lastSDirection = null
|
||||
VimExtensionFacade.executeNormalWithoutMapping(injector.parser.parseKeys(char), editor)
|
||||
}
|
||||
}
|
||||
|
||||
private class SneakRepeatHandler(
|
||||
private val highlightHandler: HighlightHandler,
|
||||
private val direction: RepeatDirection,
|
||||
) : ExtensionHandler {
|
||||
override fun execute(editor: VimEditor, context: ExecutionContext, operatorArguments: OperatorArguments) {
|
||||
val lastSDirection = Util.lastSDirection
|
||||
if (lastSDirection != null) {
|
||||
val (charone, chartwo) = Util.lastSymbols.toList()
|
||||
val jumpRange = Util.jumpTo(editor, charone, chartwo, direction.map(lastSDirection))
|
||||
jumpRange?.let { highlightHandler.highlightSneakRange(editor.ij, jumpRange) }
|
||||
} else {
|
||||
VimExtensionFacade.executeNormalWithoutMapping(injector.parser.parseKeys(direction.symb), editor.ij)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private object Util {
|
||||
var lastSDirection: Direction? = null
|
||||
var lastSymbols: String = ""
|
||||
fun jumpTo(editor: VimEditor, charone: Char, chartwo: Char, sneakDirection: Direction): TextRange? {
|
||||
val caret = editor.primaryCaret()
|
||||
val position = caret.offset.point
|
||||
val chars = editor.text()
|
||||
val foundPosition = sneakDirection.findBiChar(editor, chars, position, charone, chartwo)
|
||||
if (foundPosition != null) {
|
||||
editor.primaryCaret().moveToOffset(foundPosition)
|
||||
}
|
||||
editor.ij.scrollingModel.scrollToCaret(ScrollType.MAKE_VISIBLE)
|
||||
return foundPosition?.let { TextRange(foundPosition, foundPosition + 2) }
|
||||
}
|
||||
}
|
||||
|
||||
private enum class Direction(val offset: Int) {
|
||||
FORWARD(1) {
|
||||
override fun findBiChar(
|
||||
editor: VimEditor,
|
||||
charSequence: CharSequence,
|
||||
position: Int,
|
||||
charone: Char,
|
||||
chartwo: Char
|
||||
): Int? {
|
||||
for (i in (position + offset) until charSequence.length - 1) {
|
||||
if (matches(editor, charSequence, i, charone, chartwo)) {
|
||||
return i
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
},
|
||||
BACKWARD(-1) {
|
||||
override fun findBiChar(
|
||||
editor: VimEditor,
|
||||
charSequence: CharSequence,
|
||||
position: Int,
|
||||
charone: Char,
|
||||
chartwo: Char
|
||||
): Int? {
|
||||
for (i in (position + offset) downTo 0) {
|
||||
if (matches(editor, charSequence, i, charone, chartwo)) {
|
||||
return i
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
abstract fun findBiChar(
|
||||
editor: VimEditor,
|
||||
charSequence: CharSequence,
|
||||
position: Int,
|
||||
charone: Char,
|
||||
chartwo: Char,
|
||||
): Int?
|
||||
|
||||
fun matches(
|
||||
editor: VimEditor,
|
||||
charSequence: CharSequence,
|
||||
charPosition: Int,
|
||||
charOne: Char,
|
||||
charTwo: Char,
|
||||
): Boolean {
|
||||
var match = charSequence[charPosition].equals(charOne, ignoreCase = injector.options(editor).ignorecase) &&
|
||||
charSequence[charPosition + 1].equals(charTwo, ignoreCase = injector.options(editor).ignorecase)
|
||||
|
||||
if (injector.options(editor).ignorecase && injector.options(editor).smartcase) {
|
||||
if (charOne.isUpperCase() || charTwo.isUpperCase()) {
|
||||
match = charSequence[charPosition].equals(charOne, ignoreCase = false) &&
|
||||
charSequence[charPosition + 1].equals(charTwo, ignoreCase = false)
|
||||
}
|
||||
}
|
||||
return match
|
||||
}
|
||||
}
|
||||
|
||||
private enum class RepeatDirection(val symb: String) {
|
||||
IDENTICAL(";") {
|
||||
override fun map(direction: Direction): Direction = direction
|
||||
},
|
||||
REVERSE(",") {
|
||||
override fun map(direction: Direction): Direction = when (direction) {
|
||||
Direction.FORWARD -> Direction.BACKWARD
|
||||
Direction.BACKWARD -> Direction.FORWARD
|
||||
}
|
||||
};
|
||||
|
||||
abstract fun map(direction: Direction): Direction
|
||||
}
|
||||
|
||||
private class HighlightHandler {
|
||||
private var editor: Editor? = null
|
||||
private val sneakHighlighters: MutableSet<RangeHighlighter> = mutableSetOf()
|
||||
|
||||
fun highlightSneakRange(editor: Editor, range: TextRange) {
|
||||
clearAllSneakHighlighters()
|
||||
|
||||
this.editor = editor
|
||||
val project = editor.project
|
||||
if (project != null) {
|
||||
Disposer.register(VimProjectService.getInstance(project)) {
|
||||
this.editor = null
|
||||
sneakHighlighters.clear()
|
||||
}
|
||||
}
|
||||
|
||||
if (range.isMultiple) {
|
||||
for (i in 0 until range.size()) {
|
||||
highlightSingleRange(editor, range.startOffsets[i]..range.endOffsets[i])
|
||||
}
|
||||
} else {
|
||||
highlightSingleRange(editor, range.startOffset..range.endOffset)
|
||||
}
|
||||
}
|
||||
|
||||
fun clearAllSneakHighlighters() {
|
||||
sneakHighlighters.forEach { highlighter ->
|
||||
editor?.markupModel?.removeHighlighter(highlighter) ?: StrictMode.fail("Highlighters without an editor")
|
||||
}
|
||||
|
||||
sneakHighlighters.clear()
|
||||
}
|
||||
|
||||
private fun highlightSingleRange(editor: Editor, range: ClosedRange<Int>) {
|
||||
val highlighter = editor.markupModel.addRangeHighlighter(
|
||||
range.start,
|
||||
range.endInclusive,
|
||||
HighlighterLayer.SELECTION,
|
||||
getHighlightTextAttributes(),
|
||||
HighlighterTargetArea.EXACT_RANGE
|
||||
)
|
||||
|
||||
sneakHighlighters.add(highlighter)
|
||||
|
||||
setClearHighlightRangeTimer(highlighter)
|
||||
}
|
||||
|
||||
private fun setClearHighlightRangeTimer(highlighter: RangeHighlighter) {
|
||||
val timer = Timer(DEFAULT_HIGHLIGHT_DURATION_SNEAK) {
|
||||
if (editor?.isDisposed != true) {
|
||||
editor?.markupModel?.removeHighlighter(highlighter)
|
||||
}
|
||||
}
|
||||
timer.isRepeats = false
|
||||
timer.start()
|
||||
}
|
||||
|
||||
private fun getHighlightTextAttributes() = TextAttributes(
|
||||
null,
|
||||
EditorColors.TEXT_SEARCH_RESULT_ATTRIBUTES.defaultAttributes.backgroundColor,
|
||||
editor?.colorsScheme?.getColor(EditorColors.CARET_COLOR),
|
||||
EffectType.SEARCH_MATCH,
|
||||
Font.PLAIN
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Map some <Plug>(keys) command to given handler
|
||||
* and create mapping to <Plug>(prefix)[keys]
|
||||
*/
|
||||
private fun VimExtension.mapToFunctionAndProvideKeys(keys: String, handler: ExtensionHandler) {
|
||||
VimExtensionFacade.putExtensionHandlerMapping(
|
||||
MappingMode.NXO,
|
||||
injector.parser.parseKeys(command(keys)),
|
||||
owner,
|
||||
handler,
|
||||
false
|
||||
)
|
||||
VimExtensionFacade.putExtensionHandlerMapping(
|
||||
MappingMode.NXO,
|
||||
injector.parser.parseKeys(commandFromOriginalPlugin(keys)),
|
||||
owner,
|
||||
handler,
|
||||
false
|
||||
)
|
||||
|
||||
// This is a combination to meet the following requirements:
|
||||
// - Now we should support mappings from sneak `Sneak_s` and mappings from the previous version of the plugin `(sneak-s)`
|
||||
// - The shortcut should not be registered if any of these mappings is overridden in .ideavimrc
|
||||
// - The shortcut should not be registered if some other shortcut for this key exists
|
||||
val fromKeys = injector.parser.parseKeys(keys)
|
||||
val filteredModes = MappingMode.NXO.filterNotTo(HashSet()) {
|
||||
VimPlugin.getKey().hasmapto(it, injector.parser.parseKeys(command(keys)))
|
||||
}
|
||||
val filteredModes2 = MappingMode.NXO.filterNotTo(HashSet()) {
|
||||
VimPlugin.getKey().hasmapto(it, injector.parser.parseKeys(commandFromOriginalPlugin(keys)))
|
||||
}
|
||||
val filteredFromModes = MappingMode.NXO.filterNotTo(HashSet()) {
|
||||
injector.keyGroup.hasmapfrom(it, fromKeys)
|
||||
}
|
||||
|
||||
val doubleFiltered = MappingMode.NXO
|
||||
.filter { it in filteredModes2 && it in filteredModes && it in filteredFromModes }
|
||||
.toSet()
|
||||
putKeyMapping(doubleFiltered, fromKeys, owner, injector.parser.parseKeys(command(keys)), true)
|
||||
putKeyMapping(
|
||||
doubleFiltered,
|
||||
fromKeys,
|
||||
owner,
|
||||
injector.parser.parseKeys(commandFromOriginalPlugin(keys)),
|
||||
true
|
||||
)
|
||||
}
|
||||
|
||||
private fun command(keys: String) = "<Plug>(sneak-$keys)"
|
||||
private fun commandFromOriginalPlugin(keys: String) = "<Plug>Sneak_$keys"
|
@@ -8,6 +8,7 @@
|
||||
package com.maddyhome.idea.vim.extension.surround
|
||||
|
||||
import com.intellij.openapi.application.runWriteAction
|
||||
import com.intellij.openapi.diagnostic.logger
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.maddyhome.idea.vim.VimPlugin
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
@@ -255,6 +256,7 @@ internal class VimSurroundExtension : VimExtension {
|
||||
override fun execute(editor: VimEditor, context: ExecutionContext, operatorArguments: OperatorArguments) {
|
||||
// Deleting surround is just changing the surrounding to "nothing"
|
||||
val charFrom = getChar(editor.ij)
|
||||
LOG.debug("DSurroundHandler: charFrom = $charFrom")
|
||||
if (charFrom.code == 0) return
|
||||
|
||||
runWriteAction { CSurroundHandler.change(editor, context, charFrom, null) }
|
||||
@@ -307,96 +309,101 @@ internal class VimSurroundExtension : VimExtension {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val REGISTER = '"'
|
||||
private val LOG = logger<VimSurroundExtension>()
|
||||
|
||||
private val tagNameAndAttributesCapturePattern = "(\\S+)([^>]*)>".toPattern()
|
||||
private const val REGISTER = '"'
|
||||
|
||||
private val SURROUND_PAIRS = mapOf(
|
||||
'b' to ("(" to ")"),
|
||||
'(' to ("( " to " )"),
|
||||
')' to ("(" to ")"),
|
||||
'B' to ("{" to "}"),
|
||||
'{' to ("{ " to " }"),
|
||||
'}' to ("{" to "}"),
|
||||
'r' to ("[" to "]"),
|
||||
'[' to ("[ " to " ]"),
|
||||
']' to ("[" to "]"),
|
||||
'a' to ("<" to ">"),
|
||||
'>' to ("<" to ">"),
|
||||
's' to (" " to ""),
|
||||
)
|
||||
private val tagNameAndAttributesCapturePattern = "(\\S+)([^>]*)>".toPattern()
|
||||
|
||||
private fun getSurroundPair(c: Char): Pair<String, String>? = if (c in SURROUND_PAIRS) {
|
||||
SURROUND_PAIRS[c]
|
||||
} else if (!c.isLetter()) {
|
||||
val s = c.toString()
|
||||
s to s
|
||||
} else {
|
||||
null
|
||||
}
|
||||
private val SURROUND_PAIRS = mapOf(
|
||||
'b' to ("(" to ")"),
|
||||
'(' to ("( " to " )"),
|
||||
')' to ("(" to ")"),
|
||||
'B' to ("{" to "}"),
|
||||
'{' to ("{ " to " }"),
|
||||
'}' to ("{" to "}"),
|
||||
'r' to ("[" to "]"),
|
||||
'[' to ("[ " to " ]"),
|
||||
']' to ("[" to "]"),
|
||||
'a' to ("<" to ">"),
|
||||
'>' to ("<" to ">"),
|
||||
's' to (" " to ""),
|
||||
)
|
||||
|
||||
private fun inputTagPair(editor: Editor): Pair<String, String>? {
|
||||
val tagInput = inputString(editor, "<", '>')
|
||||
val matcher = tagNameAndAttributesCapturePattern.matcher(tagInput)
|
||||
return if (matcher.find()) {
|
||||
val tagName = matcher.group(1)
|
||||
val tagAttributes = matcher.group(2)
|
||||
"<$tagName$tagAttributes>" to "</$tagName>"
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
private fun getSurroundPair(c: Char): Pair<String, String>? = if (c in SURROUND_PAIRS) {
|
||||
SURROUND_PAIRS[c]
|
||||
} else if (!c.isLetter()) {
|
||||
val s = c.toString()
|
||||
s to s
|
||||
} else {
|
||||
null
|
||||
}
|
||||
|
||||
private fun inputFunctionName(
|
||||
editor: Editor,
|
||||
withInternalSpaces: Boolean,
|
||||
): Pair<String, String>? {
|
||||
val functionNameInput = inputString(editor, "function: ", null)
|
||||
if (functionNameInput.isEmpty()) return null
|
||||
return if (withInternalSpaces) "$functionNameInput( " to " )" else "$functionNameInput(" to ")"
|
||||
}
|
||||
|
||||
private fun getOrInputPair(c: Char, editor: Editor): Pair<String, String>? = when (c) {
|
||||
'<', 't' -> inputTagPair(editor)
|
||||
'f' -> inputFunctionName(editor, false)
|
||||
'F' -> inputFunctionName(editor, true)
|
||||
else -> getSurroundPair(c)
|
||||
}
|
||||
|
||||
private fun getChar(editor: Editor): Char {
|
||||
val key = inputKeyStroke(editor)
|
||||
val keyChar = key.keyChar
|
||||
return if (keyChar == KeyEvent.CHAR_UNDEFINED || keyChar.code == KeyEvent.VK_ESCAPE) {
|
||||
0.toChar()
|
||||
} else {
|
||||
keyChar
|
||||
}
|
||||
}
|
||||
|
||||
private fun performSurround(pair: Pair<String, String>, range: TextRange, caret: VimCaret, count: Int, tagsOnNewLines: Boolean = false) {
|
||||
runWriteAction {
|
||||
val editor = caret.editor
|
||||
val change = VimPlugin.getChange()
|
||||
val leftSurround = RepeatedCharSequence.of(pair.first + if (tagsOnNewLines) "\n" else "", count)
|
||||
|
||||
val isEOF = range.endOffset == editor.text().length
|
||||
val hasNewLine = editor.endsWithNewLine()
|
||||
val rightSurround = (if (tagsOnNewLines) {
|
||||
if (isEOF && !hasNewLine) {
|
||||
"\n" + pair.second
|
||||
} else {
|
||||
pair.second + "\n"
|
||||
}
|
||||
} else {
|
||||
pair.second
|
||||
}).let { RepeatedCharSequence.of(it, count) }
|
||||
|
||||
change.insertText(editor, caret, range.startOffset, leftSurround)
|
||||
change.insertText(editor, caret, range.endOffset + leftSurround.length, rightSurround)
|
||||
injector.markService.setChangeMarks(caret, TextRange(range.startOffset, range.endOffset + leftSurround.length + rightSurround.length))
|
||||
}
|
||||
}
|
||||
private fun inputTagPair(editor: Editor): Pair<String, String>? {
|
||||
val tagInput = inputString(editor, "<", '>')
|
||||
val matcher = tagNameAndAttributesCapturePattern.matcher(tagInput)
|
||||
return if (matcher.find()) {
|
||||
val tagName = matcher.group(1)
|
||||
val tagAttributes = matcher.group(2)
|
||||
"<$tagName$tagAttributes>" to "</$tagName>"
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
private fun inputFunctionName(
|
||||
editor: Editor,
|
||||
withInternalSpaces: Boolean,
|
||||
): Pair<String, String>? {
|
||||
val functionNameInput = inputString(editor, "function: ", null)
|
||||
if (functionNameInput.isEmpty()) return null
|
||||
return if (withInternalSpaces) "$functionNameInput( " to " )" else "$functionNameInput(" to ")"
|
||||
}
|
||||
|
||||
private fun getOrInputPair(c: Char, editor: Editor): Pair<String, String>? = when (c) {
|
||||
'<', 't' -> inputTagPair(editor)
|
||||
'f' -> inputFunctionName(editor, false)
|
||||
'F' -> inputFunctionName(editor, true)
|
||||
else -> getSurroundPair(c)
|
||||
}
|
||||
|
||||
private fun getChar(editor: Editor): Char {
|
||||
val key = inputKeyStroke(editor)
|
||||
val keyChar = key.keyChar
|
||||
val res = if (keyChar == KeyEvent.CHAR_UNDEFINED || keyChar.code == KeyEvent.VK_ESCAPE) {
|
||||
0.toChar()
|
||||
} else {
|
||||
keyChar
|
||||
}
|
||||
LOG.trace("getChar: $res")
|
||||
return res
|
||||
}
|
||||
|
||||
private fun performSurround(pair: Pair<String, String>, range: TextRange, caret: VimCaret, count: Int, tagsOnNewLines: Boolean = false) {
|
||||
runWriteAction {
|
||||
val editor = caret.editor
|
||||
val change = VimPlugin.getChange()
|
||||
val leftSurround = RepeatedCharSequence.of(pair.first + if (tagsOnNewLines) "\n" else "", count)
|
||||
|
||||
val isEOF = range.endOffset == editor.text().length
|
||||
val hasNewLine = editor.endsWithNewLine()
|
||||
val rightSurround = (if (tagsOnNewLines) {
|
||||
if (isEOF && !hasNewLine) {
|
||||
"\n" + pair.second
|
||||
} else {
|
||||
pair.second + "\n"
|
||||
}
|
||||
} else {
|
||||
pair.second
|
||||
}).let { RepeatedCharSequence.of(it, count) }
|
||||
|
||||
change.insertText(editor, caret, range.startOffset, leftSurround)
|
||||
change.insertText(editor, caret, range.endOffset + leftSurround.length, rightSurround)
|
||||
injector.markService.setChangeMarks(
|
||||
caret,
|
||||
TextRange(range.startOffset, range.endOffset + leftSurround.length + rightSurround.length)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@@ -16,12 +16,11 @@ import com.intellij.openapi.command.UndoConfirmationPolicy
|
||||
import com.intellij.openapi.diagnostic.logger
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.openapi.editor.LogicalPosition
|
||||
import com.intellij.openapi.editor.actions.EnterAction
|
||||
import com.intellij.openapi.editor.event.EditorMouseEvent
|
||||
import com.intellij.openapi.editor.event.EditorMouseListener
|
||||
import com.intellij.openapi.editor.impl.TextRangeInterval
|
||||
import com.intellij.openapi.ui.MessageType
|
||||
import com.intellij.openapi.ui.popup.Balloon
|
||||
import com.intellij.openapi.ui.popup.JBPopupFactory
|
||||
import com.intellij.openapi.util.UserDataHolder
|
||||
import com.intellij.openapi.util.text.StringUtil
|
||||
import com.intellij.psi.codeStyle.CodeStyleManager
|
||||
import com.intellij.psi.util.PsiUtilBase
|
||||
@@ -52,6 +51,7 @@ import com.maddyhome.idea.vim.group.visual.VimSelection
|
||||
import com.maddyhome.idea.vim.group.visual.vimSetSystemSelectionSilently
|
||||
import com.maddyhome.idea.vim.handler.Motion
|
||||
import com.maddyhome.idea.vim.handler.Motion.AbsoluteOffset
|
||||
import com.maddyhome.idea.vim.handler.commandContinuation
|
||||
import com.maddyhome.idea.vim.helper.CharacterHelper
|
||||
import com.maddyhome.idea.vim.helper.CharacterHelper.changeCase
|
||||
import com.maddyhome.idea.vim.helper.CharacterHelper.charType
|
||||
@@ -62,29 +62,28 @@ import com.maddyhome.idea.vim.helper.endOffsetInclusive
|
||||
import com.maddyhome.idea.vim.helper.inInsertMode
|
||||
import com.maddyhome.idea.vim.helper.moveToInlayAwareLogicalPosition
|
||||
import com.maddyhome.idea.vim.helper.moveToInlayAwareOffset
|
||||
import com.maddyhome.idea.vim.icons.VimIcons
|
||||
import com.maddyhome.idea.vim.key.KeyHandlerKeeper.Companion.getInstance
|
||||
import com.maddyhome.idea.vim.listener.VimInsertListener
|
||||
import com.maddyhome.idea.vim.newapi.IjEditorExecutionContext
|
||||
import com.maddyhome.idea.vim.newapi.IjVimCaret
|
||||
import com.maddyhome.idea.vim.newapi.IjVimEditor
|
||||
import com.maddyhome.idea.vim.newapi.ij
|
||||
import com.maddyhome.idea.vim.state.mode.Mode
|
||||
import com.maddyhome.idea.vim.state.mode.Mode.VISUAL
|
||||
import com.maddyhome.idea.vim.state.mode.SelectionType
|
||||
import com.maddyhome.idea.vim.state.mode.mode
|
||||
import com.maddyhome.idea.vim.vimscript.model.commands.SortOption
|
||||
import org.jetbrains.annotations.TestOnly
|
||||
import java.math.BigInteger
|
||||
import java.util.*
|
||||
import java.util.function.Consumer
|
||||
import kotlin.math.max
|
||||
import kotlin.math.min
|
||||
|
||||
/**
|
||||
* Provides all the insert/replace related functionality
|
||||
*/
|
||||
public class ChangeGroup : VimChangeGroupBase() {
|
||||
private val insertListeners = ContainerUtil.createLockFreeCopyOnWriteList<VimInsertListener>()
|
||||
private var lastShownTime = 0L
|
||||
private val listener: EditorMouseListener = object : EditorMouseListener {
|
||||
override fun mouseClicked(event: EditorMouseEvent) {
|
||||
val editor = event.editor
|
||||
@@ -98,10 +97,6 @@ public class ChangeGroup : VimChangeGroupBase() {
|
||||
EventFacade.getInstance().addEditorMouseListener(editor!!, listener, disposable)
|
||||
}
|
||||
|
||||
public fun editorReleased(editor: Editor?) {
|
||||
EventFacade.getInstance().removeEditorMouseListener(editor!!, listener)
|
||||
}
|
||||
|
||||
override fun type(vimEditor: VimEditor, context: ExecutionContext, key: Char) {
|
||||
val editor = (vimEditor as IjVimEditor).editor
|
||||
val ijContext = context.ij
|
||||
@@ -116,6 +111,35 @@ public class ChangeGroup : VimChangeGroupBase() {
|
||||
injector.scroll.scrollCaretIntoView(vimEditor)
|
||||
}
|
||||
|
||||
/**
|
||||
* If this is REPLACE mode we need to turn off OVERWRITE before and then turn OVERWRITE back on after sending the
|
||||
* "ENTER" key.
|
||||
*/
|
||||
override fun processEnter(
|
||||
editor: VimEditor,
|
||||
caret: VimCaret,
|
||||
context: ExecutionContext,
|
||||
) {
|
||||
if (editor.mode is Mode.REPLACE) {
|
||||
editor.insertMode = true
|
||||
}
|
||||
try {
|
||||
val continuation = (context.context as UserDataHolder).getUserData(commandContinuation)
|
||||
val ijEditor = editor.ij
|
||||
val ij = context.ij
|
||||
val ijCaret = caret.ij
|
||||
if (continuation != null) {
|
||||
continuation.execute(ijEditor, ijCaret, ij)
|
||||
} else {
|
||||
EnterAction().handler.execute(ijEditor, ijCaret, ij)
|
||||
}
|
||||
} finally {
|
||||
if (editor.mode is Mode.REPLACE) {
|
||||
editor.insertMode = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getDeleteRangeAndType2(
|
||||
editor: VimEditor,
|
||||
caret: VimCaret,
|
||||
@@ -370,6 +394,7 @@ public class ChangeGroup : VimChangeGroupBase() {
|
||||
context: ExecutionContext,
|
||||
range: TextRange,
|
||||
) {
|
||||
val startPos = editor.offsetToBufferPosition(caret.offset.point)
|
||||
val startOffset = editor.getLineStartForOffset(range.startOffset)
|
||||
val endOffset = editor.getLineEndForOffset(range.endOffset)
|
||||
val ijEditor = (editor as IjVimEditor).editor
|
||||
@@ -394,11 +419,7 @@ public class ChangeGroup : VimChangeGroupBase() {
|
||||
}
|
||||
}
|
||||
val afterAction = {
|
||||
val firstLine = editor.offsetToBufferPosition(
|
||||
min(startOffset.toDouble(), endOffset.toDouble()).toInt()
|
||||
).line
|
||||
val newOffset = injector.motion.moveCaretToLineStartSkipLeading(editor, firstLine)
|
||||
caret.moveToOffset(newOffset)
|
||||
caret.moveToOffset(injector.motion.moveCaretToLineStartSkipLeading(editor, startPos.line))
|
||||
restoreCursor(editor, caret, (caret as IjVimCaret).caret.logicalPosition.line)
|
||||
}
|
||||
if (project != null) {
|
||||
@@ -611,25 +632,6 @@ public class ChangeGroup : VimChangeGroupBase() {
|
||||
avalanche: Boolean,
|
||||
): Boolean {
|
||||
|
||||
// Just an easter egg
|
||||
if (avalanche) {
|
||||
val currentTime = System.currentTimeMillis()
|
||||
if (currentTime - lastShownTime > 60000) {
|
||||
lastShownTime = currentTime
|
||||
ApplicationManager.getApplication().invokeLater {
|
||||
val balloon = JBPopupFactory.getInstance()
|
||||
.createHtmlTextBalloonBuilder(
|
||||
"Wow, nice vim skills!", VimIcons.IDEAVIM,
|
||||
MessageType.INFO.titleForeground, MessageType.INFO.popupBackground,
|
||||
null
|
||||
).createBalloon()
|
||||
balloon.show(
|
||||
JBPopupFactory.getInstance().guessBestPopupLocation((editor as IjVimEditor).editor),
|
||||
Balloon.Position.below
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
val nf: List<String> = injector.options(editor).nrformats
|
||||
val alpha = nf.contains("alpha")
|
||||
val hex = nf.contains("hex")
|
||||
|
@@ -89,14 +89,17 @@ public class FileGroup extends VimFileBase {
|
||||
|
||||
@Nullable VirtualFile findFile(@NotNull String filename, @NotNull Project project) {
|
||||
VirtualFile found;
|
||||
if (filename.length() > 2 && filename.charAt(0) == '~' && filename.charAt(1) == File.separatorChar) {
|
||||
String homefile = filename.substring(2);
|
||||
// Vim supports both ~/ and ~\ (tested on Mac and Windows). On Windows, it supports forward- and back-slashes, but
|
||||
// it only supports forward slash on Unix (tested on Mac)
|
||||
// VFS works with both directory separators (tested on Mac and Windows)
|
||||
if (filename.startsWith("~/") || filename.startsWith("~\\")) {
|
||||
String relativePath = filename.substring(2);
|
||||
String dir = System.getProperty("user.home");
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("home dir file");
|
||||
logger.debug("looking for " + homefile + " in " + dir);
|
||||
logger.debug("looking for " + relativePath + " in " + dir);
|
||||
}
|
||||
found = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(dir, homefile));
|
||||
found = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(dir, relativePath));
|
||||
}
|
||||
else {
|
||||
found = LocalFileSystem.getInstance().findFileByIoFile(new File(filename));
|
||||
|
@@ -29,13 +29,15 @@ public open class GlobalIjOptions(scope: OptionAccessScope) : OptionsPropertiesB
|
||||
public val lookupkeys: StringListOptionValue by optionProperty(IjOptions.lookupkeys)
|
||||
public var trackactionids: Boolean by optionProperty(IjOptions.trackactionids)
|
||||
public var visualdelay: Int by optionProperty(IjOptions.visualdelay)
|
||||
public var showmodewidget: Boolean by optionProperty(IjOptions.showmodewidget)
|
||||
|
||||
// Temporary options to control work-in-progress behaviour
|
||||
public var octopushandler: Boolean by optionProperty(IjOptions.octopushandler)
|
||||
public var oldundo: Boolean by optionProperty(IjOptions.oldundo)
|
||||
public var unifyjumps: Boolean by optionProperty(IjOptions.unifyjumps)
|
||||
public var exCommandAnnotation: Boolean by optionProperty(IjOptions.exCommandAnnotation)
|
||||
public var vimscriptFunctionAnnotation: Boolean by optionProperty(IjOptions.vimscriptFunctionAnnotation)
|
||||
public var commandOrMotionAnnotation: Boolean by optionProperty(IjOptions.commandOrMotionAnnotation)
|
||||
public var useNewRegex: Boolean by optionProperty(IjOptions.useNewRegex)
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -80,14 +80,16 @@ public object IjOptions {
|
||||
"lookupkeys",
|
||||
"<Tab>,<Down>,<Up>,<Enter>,<Left>,<Right>,<C-Down>,<C-Up>,<PageUp>,<PageDown>,<C-J>,<C-Q>")
|
||||
)
|
||||
public val octopushandler: ToggleOption = addOption(ToggleOption("octopushandler", GLOBAL, "octopushandler", false))
|
||||
public val oldundo: ToggleOption = addOption(ToggleOption("oldundo", GLOBAL, "oldundo", true))
|
||||
public val trackactionids: ToggleOption = addOption(ToggleOption("trackactionids", GLOBAL, "tai", false))
|
||||
public val unifyjumps: ToggleOption = addOption(ToggleOption("unifyjumps", GLOBAL, "unifyjumps", true))
|
||||
public val vimscriptFunctionAnnotation: ToggleOption = addOption(ToggleOption("vimscriptfunctionannotation", GLOBAL, "vimscriptfunctionannotation", true))
|
||||
public val visualdelay: UnsignedNumberOption = addOption(UnsignedNumberOption("visualdelay", GLOBAL, "visualdelay", 100))
|
||||
public val oldundo: ToggleOption = addOption(ToggleOption("oldundo", GLOBAL, "oldundo", true, isTemporary = true))
|
||||
public val vimscriptFunctionAnnotation: ToggleOption = addOption(ToggleOption("vimscriptfunctionannotation", GLOBAL, "vimscriptfunctionannotation", true, isTemporary = true))
|
||||
public val commandOrMotionAnnotation: ToggleOption = addOption(ToggleOption("commandormotionannotation", GLOBAL, "commandormotionannotation", true, isTemporary = true))
|
||||
public val showmodewidget: ToggleOption = addOption(ToggleOption("showmodewidget", GLOBAL, "showmodewidget", false, isTemporary = true))
|
||||
public val useNewRegex: ToggleOption = addOption(ToggleOption("usenewregex", GLOBAL, "usenewregex", true, isTemporary = true))
|
||||
|
||||
// This needs to be Option<out VimDataType> so that it can work with derived option types, such as NumberOption, which
|
||||
// derives from Option<VimInt>
|
||||
private fun <T : Option<out VimDataType>> addOption(option: T) = option.also { Options.addOption(option) }
|
||||
}
|
||||
}
|
||||
|
@@ -24,16 +24,14 @@ import com.intellij.openapi.keymap.KeymapManager;
|
||||
import com.intellij.openapi.keymap.ex.KeymapManagerEx;
|
||||
import com.maddyhome.idea.vim.EventFacade;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.action.ComplicatedKeysAction;
|
||||
import com.maddyhome.idea.vim.action.VimShortcutKeyAction;
|
||||
import com.maddyhome.idea.vim.action.change.LazyVimCommand;
|
||||
import com.maddyhome.idea.vim.api.*;
|
||||
import com.maddyhome.idea.vim.command.MappingMode;
|
||||
import com.maddyhome.idea.vim.ex.ExOutputModel;
|
||||
import com.maddyhome.idea.vim.handler.EditorActionHandlerBase;
|
||||
import com.maddyhome.idea.vim.helper.HelperKt;
|
||||
import com.maddyhome.idea.vim.key.*;
|
||||
import com.maddyhome.idea.vim.newapi.IjNativeAction;
|
||||
import com.maddyhome.idea.vim.newapi.IjVimActionsInitiator;
|
||||
import com.maddyhome.idea.vim.newapi.IjVimEditor;
|
||||
import kotlin.Pair;
|
||||
import kotlin.text.StringsKt;
|
||||
@@ -48,6 +46,7 @@ import java.awt.event.KeyEvent;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
import static com.maddyhome.idea.vim.api.VimInjectorKt.injector;
|
||||
import static java.util.stream.Collectors.toList;
|
||||
|
||||
/**
|
||||
@@ -208,46 +207,20 @@ public class KeyGroup extends VimKeyGroupBase implements PersistentStateComponen
|
||||
registerRequiredShortcut(Collections.singletonList(keyStroke), owner);
|
||||
}
|
||||
|
||||
public void registerCommandAction(@NotNull VimActionsInitiator actionHolder) {
|
||||
IjVimActionsInitiator holder = (IjVimActionsInitiator)actionHolder;
|
||||
|
||||
if (!VimPlugin.getPluginId().equals(holder.getBean().getPluginDescriptor().getPluginId())) {
|
||||
logger.error("IdeaVim doesn't accept contributions to `vimActions` extension points. " +
|
||||
"Please create a plugin using `VimExtension`. " +
|
||||
"Plugin to blame: " +
|
||||
holder.getBean().getPluginDescriptor().getPluginId());
|
||||
return;
|
||||
}
|
||||
|
||||
Set<List<KeyStroke>> actionKeys = holder.getBean().getParsedKeys();
|
||||
if (actionKeys == null) {
|
||||
final EditorActionHandlerBase action = actionHolder.getInstance();
|
||||
if (action instanceof ComplicatedKeysAction) {
|
||||
actionKeys = ((ComplicatedKeysAction)action).getKeyStrokesSet();
|
||||
}
|
||||
else {
|
||||
throw new RuntimeException("Cannot register action: " + action.getClass().getName());
|
||||
}
|
||||
}
|
||||
|
||||
Set<MappingMode> actionModes = holder.getBean().getParsedModes();
|
||||
if (actionModes == null) {
|
||||
throw new RuntimeException("Cannot register action: " + holder.getBean().getImplementation());
|
||||
}
|
||||
|
||||
public void registerCommandAction(@NotNull LazyVimCommand command) {
|
||||
if (ApplicationManager.getApplication().isUnitTestMode()) {
|
||||
initIdentityChecker();
|
||||
for (List<KeyStroke> keys : actionKeys) {
|
||||
checkCommand(actionModes, actionHolder.getInstance(), keys);
|
||||
for (List<KeyStroke> keys : command.getKeys()) {
|
||||
checkCommand(command.getModes(), command, keys);
|
||||
}
|
||||
}
|
||||
|
||||
for (List<KeyStroke> keyStrokes : actionKeys) {
|
||||
for (List<KeyStroke> keyStrokes : command.getKeys()) {
|
||||
registerRequiredShortcut(keyStrokes, MappingOwner.IdeaVim.System.INSTANCE);
|
||||
|
||||
for (MappingMode mappingMode : actionModes) {
|
||||
Node<VimActionsInitiator> node = getKeyRoot(mappingMode);
|
||||
NodesKt.addLeafs(node, keyStrokes, actionHolder);
|
||||
for (MappingMode mappingMode : command.getModes()) {
|
||||
Node<LazyVimCommand> node = getKeyRoot(mappingMode);
|
||||
NodesKt.addLeafs(node, keyStrokes, command);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -255,7 +228,11 @@ public class KeyGroup extends VimKeyGroupBase implements PersistentStateComponen
|
||||
private void registerRequiredShortcut(@NotNull List<KeyStroke> keys, MappingOwner owner) {
|
||||
for (KeyStroke key : keys) {
|
||||
if (key.getKeyChar() == KeyEvent.CHAR_UNDEFINED) {
|
||||
getRequiredShortcutKeys().add(new RequiredShortcut(key, owner));
|
||||
if (!injector.getOptionGroup().getGlobalOptions().getOctopushandler() ||
|
||||
!(key.getKeyCode() == KeyEvent.VK_ESCAPE && key.getModifiers() == 0) &&
|
||||
!(key.getKeyCode() == KeyEvent.VK_ENTER && key.getModifiers() == 0)) {
|
||||
getRequiredShortcutKeys().add(new RequiredShortcut(key, owner));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,68 @@
|
||||
package com.maddyhome.idea.vim.group
|
||||
|
||||
import com.intellij.codeInsight.daemon.ReferenceImporter
|
||||
import com.intellij.openapi.actionSystem.CommonDataKeys
|
||||
import com.intellij.openapi.actionSystem.DataContext
|
||||
import com.intellij.openapi.application.ApplicationManager
|
||||
import com.intellij.openapi.application.ReadAction
|
||||
import com.intellij.openapi.command.WriteCommandAction
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.openapi.fileEditor.FileDocumentManager
|
||||
import com.intellij.openapi.progress.ProgressIndicator
|
||||
import com.intellij.openapi.progress.ProgressManager
|
||||
import com.intellij.openapi.progress.Task
|
||||
import com.intellij.psi.PsiDocumentManager
|
||||
import com.intellij.psi.PsiElement
|
||||
import com.intellij.psi.PsiRecursiveElementWalkingVisitor
|
||||
import java.util.function.BooleanSupplier
|
||||
|
||||
internal object MacroAutoImport {
|
||||
fun run(editor: Editor, dataContext: DataContext) {
|
||||
val project = CommonDataKeys.PROJECT.getData(dataContext) ?: return
|
||||
val file = PsiDocumentManager.getInstance(project).getPsiFile(editor.document) ?: return
|
||||
|
||||
if (!FileDocumentManager.getInstance().requestWriting(editor.document, project)) {
|
||||
return
|
||||
}
|
||||
|
||||
val importers = ReferenceImporter.EP_NAME.extensionList
|
||||
if (importers.isEmpty()) {
|
||||
return
|
||||
}
|
||||
|
||||
ProgressManager.getInstance().run(object : Task.Backgroundable(project, "Auto import", true) {
|
||||
override fun run(indicator: ProgressIndicator) {
|
||||
val fixes = ReadAction.nonBlocking<List<BooleanSupplier>> {
|
||||
val fixes = mutableListOf<BooleanSupplier>()
|
||||
|
||||
file.accept(object : PsiRecursiveElementWalkingVisitor() {
|
||||
override fun visitElement(element: PsiElement) {
|
||||
for (reference in element.references) {
|
||||
if (reference.resolve() != null) {
|
||||
continue
|
||||
}
|
||||
for (importer in importers) {
|
||||
importer.computeAutoImportAtOffset(editor, file, element.textRange.startOffset, true)
|
||||
?.let(fixes::add)
|
||||
}
|
||||
}
|
||||
super.visitElement(element)
|
||||
}
|
||||
})
|
||||
|
||||
return@nonBlocking fixes
|
||||
}.executeSynchronously()
|
||||
|
||||
ApplicationManager.getApplication().invokeAndWait {
|
||||
WriteCommandAction.writeCommandAction(project)
|
||||
.withName("Auto Import")
|
||||
.withGroupId("IdeaVimAutoImportAfterMacro")
|
||||
.shouldRecordActionForActiveDocument(true)
|
||||
.run<RuntimeException> {
|
||||
fixes.forEach { it.asBoolean }
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
@@ -19,6 +19,7 @@ import com.maddyhome.idea.vim.api.injector
|
||||
import com.maddyhome.idea.vim.helper.MessageHelper.message
|
||||
import com.maddyhome.idea.vim.macro.VimMacroBase
|
||||
import com.maddyhome.idea.vim.newapi.IjVimEditor
|
||||
import com.maddyhome.idea.vim.newapi.ij
|
||||
|
||||
/**
|
||||
* Used to handle playback of macros
|
||||
@@ -61,22 +62,36 @@ internal class MacroGroup : VimMacroBase() {
|
||||
try {
|
||||
myPotemkinProgress.text2 = if (isInternalMacro) "Executing internal macro" else ""
|
||||
val runnable = runnable@{
|
||||
// Handle one keystroke then queue up the next key
|
||||
for (i in 0 until total) {
|
||||
myPotemkinProgress.fraction = (i + 1).toDouble() / total
|
||||
while (keyStack.hasStroke()) {
|
||||
val key = keyStack.feedStroke()
|
||||
try {
|
||||
// Handle one keystroke then queue up the next key
|
||||
for (i in 0 until total) {
|
||||
try {
|
||||
myPotemkinProgress.checkCanceled()
|
||||
} catch (e: ProcessCanceledException) {
|
||||
return@runnable
|
||||
myPotemkinProgress.fraction = (i + 1).toDouble() / total
|
||||
while (keyStack.hasStroke()) {
|
||||
val key = keyStack.feedStroke()
|
||||
try {
|
||||
myPotemkinProgress.checkCanceled()
|
||||
} catch (e: ProcessCanceledException) {
|
||||
return@runnable
|
||||
}
|
||||
ProgressManager.getInstance().executeNonCancelableSection {
|
||||
// Prevent autocompletion during macros.
|
||||
// See https://github.com/JetBrains/ideavim/pull/772 for details
|
||||
// CompletionServiceImpl.setCompletionPhase(CompletionPhase.NoCompletion)
|
||||
getInstance().handleKey(editor, key, context)
|
||||
}
|
||||
if (injector.messages.isError()) return@runnable
|
||||
}
|
||||
} finally {
|
||||
keyStack.resetFirst()
|
||||
}
|
||||
ProgressManager.getInstance().executeNonCancelableSection { getInstance().handleKey(editor, key, context) }
|
||||
if (injector.messages.isError()) return@runnable
|
||||
}
|
||||
keyStack.resetFirst()
|
||||
} finally {
|
||||
keyStack.removeFirst()
|
||||
}
|
||||
if (!isInternalMacro) {
|
||||
MacroAutoImport.run(editor.ij, context.ij)
|
||||
}
|
||||
keyStack.removeFirst()
|
||||
}
|
||||
|
||||
if (isInternalMacro) {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user