mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2025-08-17 16:31:45 +02:00
Compare commits
662 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
33499fe945 | ||
![]() |
2882b638e5 | ||
![]() |
81c92cda79 | ||
![]() |
6506935d03 | ||
![]() |
b6be26231f | ||
![]() |
a96ba9f717 | ||
![]() |
173f570230 | ||
![]() |
57dcaba367 | ||
![]() |
d9f7955356 | ||
![]() |
9cf264998f | ||
![]() |
0dc67ae467 | ||
![]() |
75c1c0b839 | ||
![]() |
1feac95069 | ||
![]() |
ed3f87e6a8 | ||
![]() |
43662318be | ||
![]() |
785d1a04da | ||
![]() |
cc76c7f0f3 | ||
![]() |
57741cd5ce | ||
![]() |
69bd71148c | ||
![]() |
528e363d64 | ||
![]() |
bd772daee0 | ||
![]() |
23fa55ea11 | ||
![]() |
0a052e7bb3 | ||
![]() |
60a96e9542 | ||
![]() |
f3f9abef0c | ||
![]() |
58fc34d9f7 | ||
![]() |
6fdd769d0f | ||
![]() |
b54384bb33 | ||
![]() |
c57f98591a | ||
![]() |
7dcacd3b01 | ||
![]() |
2225033b7c | ||
![]() |
7c5194fbaa | ||
![]() |
cded76d1a2 | ||
![]() |
361284fe06 | ||
![]() |
aa3e55cacc | ||
![]() |
73987eaf23 | ||
![]() |
06058a45c0 | ||
![]() |
d46cab6fc8 | ||
![]() |
77bd800d95 | ||
![]() |
831373c292 | ||
![]() |
9c5e5e117a | ||
![]() |
346ada2eff | ||
![]() |
485ff37b22 | ||
![]() |
47ef6f4844 | ||
![]() |
cd288ec125 | ||
![]() |
bde2eb786d | ||
![]() |
b6896e28c8 | ||
![]() |
15dc233a86 | ||
![]() |
b070549eca | ||
![]() |
71a3df028b | ||
![]() |
73ef8c821b | ||
![]() |
bbd314b6df | ||
![]() |
5764fe7555 | ||
![]() |
44cc17cb84 | ||
![]() |
dba8879576 | ||
![]() |
1deb48bf60 | ||
![]() |
11174b8581 | ||
![]() |
bd35f71c6a | ||
![]() |
d29ae6a64d | ||
![]() |
5b69b9beae | ||
![]() |
0c78741642 | ||
![]() |
a9440f41a7 | ||
![]() |
8fc4306d76 | ||
![]() |
371d7385ed | ||
![]() |
2cacdbaf00 | ||
![]() |
3041fe7c3b | ||
![]() |
436e96f734 | ||
![]() |
67a9e1f8c5 | ||
![]() |
fc0a950af1 | ||
![]() |
e1872387d4 | ||
![]() |
ac10b96280 | ||
![]() |
d5313ebbda | ||
![]() |
c3d1e5c58c | ||
![]() |
478c0cd443 | ||
![]() |
2be2d861c9 | ||
![]() |
9731980fe6 | ||
![]() |
392f8e5e60 | ||
![]() |
a7e1275b5f | ||
![]() |
29a6d47cca | ||
![]() |
65483dd34a | ||
![]() |
3b290fe356 | ||
![]() |
2648913b61 | ||
![]() |
d386e49bd5 | ||
![]() |
f3c66d131e | ||
![]() |
c1b4671435 | ||
![]() |
cbeb0d229b | ||
![]() |
7f8db50017 | ||
![]() |
0c5ca37412 | ||
![]() |
602071a440 | ||
![]() |
7061b58940 | ||
![]() |
76c2c54e5a | ||
![]() |
f256da8a16 | ||
![]() |
ffcf7d0630 | ||
![]() |
b80205200c | ||
![]() |
40d0f6c1e2 | ||
![]() |
bddd4db2b2 | ||
![]() |
7ee18e81c7 | ||
![]() |
700240d441 | ||
![]() |
539d38259c | ||
![]() |
2efb0dfb17 | ||
![]() |
f38bf65656 | ||
![]() |
947d32d905 | ||
![]() |
56569966a6 | ||
![]() |
6092535041 | ||
![]() |
d965eb0d7e | ||
![]() |
44a53ce28e | ||
![]() |
a228f32f34 | ||
![]() |
2082981bd6 | ||
![]() |
994ad0b06c | ||
![]() |
3c59ee79f6 | ||
![]() |
b3ebd7c29d | ||
![]() |
fcc2355037 | ||
![]() |
76a5c39fdc | ||
![]() |
f4ec448d75 | ||
![]() |
e38390f8a1 | ||
![]() |
2990389ea5 | ||
![]() |
249dfb166d | ||
![]() |
4c06d21396 | ||
![]() |
a046f2975f | ||
![]() |
0bf217ef36 | ||
![]() |
f2712d8cfb | ||
![]() |
bb32e7adb4 | ||
![]() |
cadaec585b | ||
![]() |
11c2f5014f | ||
![]() |
2326489658 | ||
![]() |
01ec08e20b | ||
![]() |
69ebcc17e9 | ||
![]() |
b86bdd7847 | ||
![]() |
fbd7409851 | ||
![]() |
0773c886ee | ||
![]() |
d05c7268d9 | ||
![]() |
80d0748edd | ||
![]() |
fcbf228d35 | ||
![]() |
34feb27bef | ||
![]() |
86f707bc51 | ||
![]() |
07f74f82b5 | ||
![]() |
60917433d2 | ||
![]() |
dd59e0704a | ||
![]() |
d4bf472291 | ||
![]() |
039b650953 | ||
![]() |
0148860b2d | ||
![]() |
49590c831f | ||
![]() |
9aed0ce621 | ||
![]() |
9b653a7c63 | ||
![]() |
8d919d6ec8 | ||
![]() |
bb0094038a | ||
![]() |
c29764b164 | ||
![]() |
ae55f5d605 | ||
![]() |
81ca21517a | ||
![]() |
24a4167296 | ||
![]() |
3ffd967b00 | ||
![]() |
a2a1f4806a | ||
![]() |
6b56d7d1cd | ||
![]() |
b5a802bf30 | ||
![]() |
b4586779b3 | ||
![]() |
d92d5a1b33 | ||
![]() |
52ec080343 | ||
![]() |
5bff61c2ee | ||
![]() |
c12b713543 | ||
![]() |
7bafa0f8c8 | ||
![]() |
a47cdb9f35 | ||
![]() |
bd9ac3b031 | ||
![]() |
22ad45cd58 | ||
![]() |
58e0b7704b | ||
![]() |
b78854b8de | ||
![]() |
ae61ed456f | ||
![]() |
bdc1103641 | ||
![]() |
689d19759d | ||
![]() |
7f34b826b2 | ||
![]() |
064d3765c0 | ||
![]() |
752814a5fb | ||
![]() |
861028ef5c | ||
![]() |
dad0d8e559 | ||
![]() |
75f88c539c | ||
![]() |
1109650fde | ||
![]() |
704f8d7e9d | ||
![]() |
4a2c3d9098 | ||
![]() |
d21b04acb5 | ||
![]() |
5403336c78 | ||
![]() |
def6d2bd5b | ||
![]() |
04db2764c1 | ||
![]() |
0e9b2250bd | ||
![]() |
654d345d78 | ||
![]() |
99e379392b | ||
![]() |
1debd99701 | ||
![]() |
a099070c79 | ||
![]() |
0a09b8bd5a | ||
![]() |
b3750dd24d | ||
![]() |
db1b0c2516 | ||
![]() |
fc6208b95d | ||
![]() |
e68d3eac7d | ||
![]() |
d093b446c2 | ||
![]() |
be839051d5 | ||
![]() |
8937068b5f | ||
![]() |
3f82020100 | ||
![]() |
63ee6bbc56 | ||
![]() |
7046680765 | ||
![]() |
c17334f17f | ||
![]() |
ecd40231a5 | ||
![]() |
c3935aafc9 | ||
![]() |
9b751da31c | ||
![]() |
b464d99bd5 | ||
![]() |
f3d168f19f | ||
![]() |
bb8fa94668 | ||
![]() |
4f4d9fda0b | ||
![]() |
24994fa387 | ||
![]() |
f4bb745519 | ||
![]() |
a03258999a | ||
![]() |
3f45200cb9 | ||
![]() |
4703e75003 | ||
![]() |
39b166b87f | ||
![]() |
ded21efe5f | ||
![]() |
4952ddc494 | ||
![]() |
8ffc9b6581 | ||
![]() |
f0be6581b2 | ||
![]() |
356217a6af | ||
![]() |
9b5c86211b | ||
![]() |
ef470bd890 | ||
![]() |
428d75968c | ||
![]() |
dca4b0a399 | ||
![]() |
2380e1b013 | ||
![]() |
9718445b44 | ||
![]() |
7f897440b7 | ||
![]() |
5b21074b9d | ||
![]() |
b0714075eb | ||
![]() |
956b56a772 | ||
![]() |
50b2093548 | ||
![]() |
bc5ca28b13 | ||
![]() |
653a62b5e4 | ||
![]() |
08780e1a5c | ||
![]() |
ce39355025 | ||
![]() |
3eed987488 | ||
![]() |
6f633700ae | ||
![]() |
a7670829d5 | ||
![]() |
6fb8817391 | ||
![]() |
e90b7276cb | ||
![]() |
a1ba5fec2b | ||
![]() |
6606211233 | ||
![]() |
b1daacc9fb | ||
![]() |
03fe7d9ea2 | ||
![]() |
2d3da163a8 | ||
![]() |
49c59764ac | ||
![]() |
06cc59b7a3 | ||
![]() |
7754080323 | ||
![]() |
ebf081e273 | ||
![]() |
258467467b | ||
![]() |
bbea7e787f | ||
![]() |
4f468cace7 | ||
![]() |
b2f736adf5 | ||
![]() |
9ddedbe752 | ||
![]() |
63b237114a | ||
![]() |
29c789dcf3 | ||
![]() |
59e2ae552e | ||
![]() |
9d396a5cfa | ||
![]() |
422557d4ce | ||
![]() |
04ebbcc3a9 | ||
![]() |
0919e9d560 | ||
![]() |
8af14edf21 | ||
![]() |
13c475d73c | ||
![]() |
1373af6f66 | ||
![]() |
291ad2906d | ||
![]() |
be5532b35d | ||
![]() |
b2402aad2e | ||
![]() |
3b46e44e4f | ||
![]() |
537ec30936 | ||
![]() |
a75db02d05 | ||
![]() |
4698f1be5c | ||
![]() |
1db103e352 | ||
![]() |
5037a1182f | ||
![]() |
6b476fa75f | ||
![]() |
4d46000ec6 | ||
![]() |
56ad6b4c0d | ||
![]() |
ab750b6e75 | ||
![]() |
44a4a858fe | ||
![]() |
74fb59640d | ||
![]() |
797bfaaf3d | ||
![]() |
0015a4357e | ||
![]() |
dbdc15f21f | ||
![]() |
c9236527e4 | ||
![]() |
1a8c72d721 | ||
![]() |
739ef487fa | ||
![]() |
b7273bc4f2 | ||
![]() |
c3e9452fdc | ||
![]() |
a4e34caa5d | ||
![]() |
fea2f0ba1e | ||
![]() |
b98427472f | ||
![]() |
bf42822626 | ||
![]() |
b71eb465cb | ||
![]() |
f072638c8c | ||
![]() |
79afcd4b65 | ||
![]() |
595482048c | ||
![]() |
2c99da538e | ||
![]() |
1393e60ca8 | ||
![]() |
2e67c704f7 | ||
![]() |
c0410131bf | ||
![]() |
473a305e5f | ||
![]() |
d53ca6cd90 | ||
![]() |
bd84babecd | ||
![]() |
1b83231b1c | ||
![]() |
f39ad34057 | ||
![]() |
942b64052d | ||
![]() |
559aabd6b8 | ||
![]() |
52d26f9fb6 | ||
![]() |
b7d124ce8d | ||
![]() |
6a5c70ee6a | ||
![]() |
a76b41b737 | ||
![]() |
2fc6553203 | ||
![]() |
98b003e601 | ||
![]() |
0dda443cc8 | ||
![]() |
9322283cb1 | ||
![]() |
95d412c78d | ||
![]() |
6245b15d8f | ||
![]() |
ab1d7ba6cb | ||
![]() |
ef05491991 | ||
![]() |
113642c8f5 | ||
![]() |
088dd98e0d | ||
![]() |
7e0046a715 | ||
![]() |
1a11d5df35 | ||
![]() |
57b5b319a7 | ||
![]() |
0a4672c050 | ||
![]() |
8808b651e2 | ||
![]() |
e9fca757b7 | ||
![]() |
98a3801f6a | ||
![]() |
e97c49a032 | ||
![]() |
0335b344a1 | ||
![]() |
63b7bed61a | ||
![]() |
49ecfd6879 | ||
![]() |
4d4b5967da | ||
![]() |
a882e37d04 | ||
![]() |
4734d23e29 | ||
![]() |
b7416da26d | ||
![]() |
36e768ab37 | ||
![]() |
ede0bd8623 | ||
![]() |
b4072eb62d | ||
![]() |
120b69c439 | ||
![]() |
b68daf3f3e | ||
![]() |
c32a1a5e5b | ||
![]() |
a5e303d1ca | ||
![]() |
c4d8cef44d | ||
![]() |
72fbe758b4 | ||
![]() |
3344bb3254 | ||
![]() |
6b9ab7163a | ||
![]() |
563092cffb | ||
![]() |
9a2a0c3b0e | ||
![]() |
f3b4726b34 | ||
![]() |
30d7c6edf1 | ||
![]() |
f33f73d2f5 | ||
![]() |
b595dfd443 | ||
![]() |
a3e15b5c76 | ||
![]() |
31d85c0221 | ||
![]() |
124bd55e18 | ||
![]() |
bb9b5b5bde | ||
![]() |
f586e6dd29 | ||
![]() |
c2b1b67b6b | ||
![]() |
2cb29233c8 | ||
![]() |
b0e0bebb7e | ||
![]() |
364b3567fc | ||
![]() |
9522a51dc7 | ||
![]() |
75335a8a01 | ||
![]() |
0bf561e326 | ||
![]() |
7e6c2c2a7c | ||
![]() |
b132d490f0 | ||
![]() |
3fde0fc209 | ||
![]() |
24bc09796f | ||
![]() |
758bff79d6 | ||
![]() |
3b0660799b | ||
![]() |
6880afa73c | ||
![]() |
01aae065ff | ||
![]() |
8ee49edef0 | ||
![]() |
e09f6c7886 | ||
![]() |
dd0a7207d5 | ||
![]() |
17700a6537 | ||
![]() |
949444f6dd | ||
![]() |
31832ac230 | ||
![]() |
33200f8208 | ||
![]() |
893cd17c1a | ||
![]() |
c471ddd12f | ||
![]() |
b0ac8f89c5 | ||
![]() |
a47338d8b7 | ||
![]() |
76d00ab47f | ||
![]() |
22b8552939 | ||
![]() |
1d25a04377 | ||
![]() |
52148f69c1 | ||
![]() |
f280f8138d | ||
![]() |
530846bc7a | ||
![]() |
27adde7af0 | ||
![]() |
e3869a201f | ||
![]() |
745a356c87 | ||
![]() |
b16a4a1343 | ||
![]() |
36e41555ea | ||
![]() |
3f824cf205 | ||
![]() |
c61b3c2f29 | ||
![]() |
fd97cfbd15 | ||
![]() |
4b4c293008 | ||
![]() |
69a573a279 | ||
![]() |
c33d4d989e | ||
![]() |
3cd1134973 | ||
![]() |
4f42d4dc4f | ||
![]() |
a3b4aecded | ||
![]() |
534ae6aa81 | ||
![]() |
7e1e50ffde | ||
![]() |
ab3cbb113e | ||
![]() |
1c7e6af1fc | ||
![]() |
84f7e25c5e | ||
![]() |
458fe97b75 | ||
![]() |
31364607f5 | ||
![]() |
56ec2c7ebc | ||
![]() |
f944d91d62 | ||
![]() |
2cf7d89581 | ||
![]() |
91546700d4 | ||
![]() |
a972aec9b0 | ||
![]() |
6328575639 | ||
![]() |
af534c9209 | ||
![]() |
82a1e920e0 | ||
![]() |
d46d292865 | ||
![]() |
1a96533a3c | ||
![]() |
2d86054fe8 | ||
![]() |
50e3af7b82 | ||
![]() |
27af4b926b | ||
![]() |
1d035acb6d | ||
![]() |
3704c321fa | ||
![]() |
9c6f35f3bd | ||
![]() |
47b49c3e03 | ||
![]() |
7a99261979 | ||
![]() |
8eda58825f | ||
![]() |
6ee43c0014 | ||
![]() |
bea3d58ddb | ||
![]() |
71b121c15c | ||
![]() |
7c8b6d2fe6 | ||
![]() |
5d33c46e6b | ||
![]() |
8aac0ebdb6 | ||
![]() |
6072aae338 | ||
![]() |
872b916d46 | ||
![]() |
86303b58df | ||
![]() |
78b1ad6df6 | ||
![]() |
e5ac7ee607 | ||
![]() |
480b32b5af | ||
![]() |
8c9cf09bd8 | ||
![]() |
7ceea17050 | ||
![]() |
76333c5a24 | ||
![]() |
85857a3319 | ||
![]() |
5ad2bb4bea | ||
![]() |
cb9d205336 | ||
![]() |
e1a292ba33 | ||
![]() |
fa4e54b32e | ||
![]() |
3ba41ac458 | ||
![]() |
2fbe85e60f | ||
![]() |
676a518fa8 | ||
![]() |
992c1923f6 | ||
![]() |
a22afdd0f6 | ||
![]() |
0da8625f30 | ||
![]() |
4cc784eb95 | ||
![]() |
ee3bec9eed | ||
![]() |
24788ac86f | ||
![]() |
9af3c732b5 | ||
![]() |
e5873fe5f9 | ||
![]() |
39f088cdcd | ||
![]() |
e805852721 | ||
![]() |
e136ecc1f8 | ||
![]() |
efa4001440 | ||
![]() |
52a0af1636 | ||
![]() |
5fc66b5896 | ||
![]() |
80dec29832 | ||
![]() |
2c7d3c9971 | ||
![]() |
30a16e9496 | ||
![]() |
0d6526ea31 | ||
![]() |
4428340fd9 | ||
![]() |
900ce21445 | ||
![]() |
68c20ed48d | ||
![]() |
c5760ceaab | ||
![]() |
8c7c9a67a6 | ||
![]() |
efad5545de | ||
![]() |
afb411dd35 | ||
![]() |
85231b314f | ||
![]() |
210b2efd47 | ||
![]() |
ae5b1385ea | ||
![]() |
011ce28251 | ||
![]() |
efb58b45df | ||
![]() |
7d033787eb | ||
![]() |
3a47583cf9 | ||
![]() |
565b4b3f2f | ||
![]() |
574f32a6dd | ||
![]() |
0e67c8ff69 | ||
![]() |
b886073c11 | ||
![]() |
57c35b9a74 | ||
![]() |
f5100694d6 | ||
![]() |
3ff9bfcc13 | ||
![]() |
6c8d2bfd9e | ||
![]() |
637f7f48ad | ||
![]() |
8eae80d30f | ||
![]() |
9a103276e3 | ||
![]() |
6386f011f7 | ||
![]() |
742d6e63d9 | ||
![]() |
f6141603ef | ||
![]() |
7a5b4e565a | ||
![]() |
373e1527c1 | ||
![]() |
9cb05b6a7d | ||
![]() |
74bf5ff044 | ||
![]() |
0f7e9d11b6 | ||
![]() |
5fadc2fb9f | ||
![]() |
96bbcf623f | ||
![]() |
89e853158c | ||
![]() |
5c31fcc03e | ||
![]() |
3fee4a803b | ||
![]() |
8b61f559d7 | ||
![]() |
4bd058f5dc | ||
![]() |
999ccf87fc | ||
![]() |
4e45e885b9 | ||
![]() |
6aee9ccaf1 | ||
![]() |
af3c6ff012 | ||
![]() |
0c9bdf5168 | ||
![]() |
82a9587b4f | ||
![]() |
850f4d7ec5 | ||
![]() |
8d1dcc4568 | ||
![]() |
3650ab85df | ||
![]() |
e1e1cc2666 | ||
![]() |
79fd32088b | ||
![]() |
458e0fc76d | ||
![]() |
5090c81632 | ||
![]() |
dcd035353b | ||
![]() |
8606ce21bd | ||
![]() |
72537c6ffb | ||
![]() |
30f9888f51 | ||
![]() |
d5a2b92121 | ||
![]() |
fd3eee6870 | ||
![]() |
2d6d1003b7 | ||
![]() |
499c590f5a | ||
![]() |
787b78ef36 | ||
![]() |
88a0b0fa23 | ||
![]() |
1519f04930 | ||
![]() |
e0a1291de0 | ||
![]() |
8a2d881002 | ||
![]() |
4802b6f460 | ||
![]() |
8c0e116a1c | ||
![]() |
8862878011 | ||
![]() |
bdf3361243 | ||
![]() |
6b5216077b | ||
![]() |
7e119f7963 | ||
![]() |
933cbc7e51 | ||
![]() |
65f30d4480 | ||
![]() |
1f8d3f119e | ||
![]() |
45fe858503 | ||
![]() |
0cc06ad186 | ||
![]() |
18cd7547ad | ||
![]() |
7746a26062 | ||
![]() |
a47fc9d3be | ||
![]() |
8fdf75330c | ||
![]() |
d6ebaa26b0 | ||
![]() |
27bd7ec836 | ||
![]() |
6752058922 | ||
![]() |
b965108dad | ||
![]() |
6bf0f36567 | ||
![]() |
69f1a70968 | ||
![]() |
47edfcac5e | ||
![]() |
c34599b954 | ||
![]() |
48b371c985 | ||
![]() |
47165e7b9d | ||
![]() |
69f4611552 | ||
![]() |
31a25449a8 | ||
![]() |
26a247c0bf | ||
![]() |
1c7cd23475 | ||
![]() |
296ef1bdf9 | ||
![]() |
f2a0408801 | ||
![]() |
642659bc9b | ||
![]() |
f0e8d065b7 | ||
![]() |
520d852c04 | ||
![]() |
8d4d7a421a | ||
![]() |
802b83b0fe | ||
![]() |
7ccb6c8411 | ||
![]() |
1518831f37 | ||
![]() |
3bdfaa02e1 | ||
![]() |
e8de9f915c | ||
![]() |
31f598d1e1 | ||
![]() |
46e6fd0847 | ||
![]() |
1441a60f4b | ||
![]() |
ebdf107946 | ||
![]() |
38d672c9f9 | ||
![]() |
75d34abd45 | ||
![]() |
1d98738e4d | ||
![]() |
3cfa0e1844 | ||
![]() |
82211a4373 | ||
![]() |
e324b04a94 | ||
![]() |
49d0c51d97 | ||
![]() |
fe4bc3b4a9 | ||
![]() |
58d964063c | ||
![]() |
17d3e37e1d | ||
![]() |
54f6a16bd6 | ||
![]() |
f4ffc5d198 | ||
![]() |
3d8010bf88 | ||
![]() |
ec2cc3a7f9 | ||
![]() |
52b7b9bcd8 | ||
![]() |
8ad0fcf42d | ||
![]() |
aa6cc45988 | ||
![]() |
da22b8297b | ||
![]() |
798d82e941 | ||
![]() |
ac8ac302ca | ||
![]() |
22c3a73102 | ||
![]() |
1222fdb043 | ||
![]() |
78a50c2f53 | ||
![]() |
6d261a7afa | ||
![]() |
2e37292478 | ||
![]() |
a4907ec9c8 | ||
![]() |
992bfe73b6 | ||
![]() |
c186254a7e | ||
![]() |
1dc739f32c | ||
![]() |
9804cd83a6 | ||
![]() |
aa5b99c47a | ||
![]() |
f95f5e8901 | ||
![]() |
206b303407 | ||
![]() |
751bff53ee | ||
![]() |
b6ef0c509d | ||
![]() |
30304d6836 | ||
![]() |
f5df49b139 | ||
![]() |
bf8ba1a49b | ||
![]() |
9f2697658b | ||
![]() |
36fd59b92c | ||
![]() |
88d946546a | ||
![]() |
6036c0c262 | ||
![]() |
20e831b56a | ||
![]() |
72b74e075c | ||
![]() |
3c6ede2f8f | ||
![]() |
5434edbd54 | ||
![]() |
6a8c7e4b17 | ||
![]() |
0ac659f2d1 | ||
![]() |
7eae40ca9a | ||
![]() |
b3d12c8b58 | ||
![]() |
3f92dba1b7 | ||
![]() |
0aedc08cfa | ||
![]() |
8312f5cffd | ||
![]() |
9f6338441e | ||
![]() |
27efe0c9d6 | ||
![]() |
b5bf6c08d8 | ||
![]() |
e3fce51ea1 | ||
![]() |
13b4e93bf4 | ||
![]() |
4ec0ab281f | ||
![]() |
39c96019b6 | ||
![]() |
21f2f60355 | ||
![]() |
0de654dcaf | ||
![]() |
d59e472814 | ||
![]() |
cc2ed452f0 | ||
![]() |
d4d3843725 | ||
![]() |
dee16da1c2 | ||
![]() |
e09b85870f | ||
![]() |
8596911a0e | ||
![]() |
6c2de9f151 | ||
![]() |
d3a6b1e39e | ||
![]() |
3cb9b19aea | ||
![]() |
86aa59bb29 | ||
![]() |
c6eeaed7da | ||
![]() |
edba90f188 | ||
![]() |
26b49b1a0c | ||
![]() |
ef32648ddc | ||
![]() |
c873524cb1 | ||
![]() |
7943e34bde | ||
![]() |
74970c74b4 | ||
![]() |
2d11561041 | ||
![]() |
f7643b6bb3 | ||
![]() |
d3afd83e8e | ||
![]() |
722431f5b2 | ||
![]() |
df8e455a6d | ||
![]() |
b35bec2839 | ||
![]() |
19365effa9 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,5 +1,6 @@
|
||||
*.swp
|
||||
/.gradle/
|
||||
/.idea/
|
||||
/idea/
|
||||
/build/
|
||||
/out/
|
||||
/tmp/
|
13
.idea/codeStyleSettings.xml
generated
13
.idea/codeStyleSettings.xml
generated
@@ -141,11 +141,8 @@
|
||||
</indentOptions>
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="Groovy">
|
||||
<option name="LINE_COMMENT_AT_FIRST_COLUMN" value="false" />
|
||||
<option name="BLOCK_COMMENT_AT_FIRST_COLUMN" value="false" />
|
||||
<option name="KEEP_LINE_BREAKS" value="false" />
|
||||
<option name="ELSE_ON_NEW_LINE" value="true" />
|
||||
<option name="WHILE_ON_NEW_LINE" value="true" />
|
||||
<option name="CATCH_ON_NEW_LINE" value="true" />
|
||||
<option name="FINALLY_ON_NEW_LINE" value="true" />
|
||||
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
|
||||
@@ -154,7 +151,6 @@
|
||||
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
|
||||
<option name="ALIGN_MULTILINE_THROWS_LIST" value="true" />
|
||||
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
|
||||
<option name="ALIGN_MULTILINE_PARENTHESIZED_EXPRESSION" value="true" />
|
||||
<option name="SPACE_AFTER_TYPE_CAST" value="false" />
|
||||
<option name="CALL_PARAMETERS_WRAP" value="1" />
|
||||
<option name="METHOD_PARAMETERS_WRAP" value="5" />
|
||||
@@ -165,12 +161,9 @@
|
||||
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
|
||||
<option name="BINARY_OPERATION_WRAP" value="5" />
|
||||
<option name="TERNARY_OPERATION_WRAP" value="5" />
|
||||
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
|
||||
<option name="FOR_STATEMENT_WRAP" value="5" />
|
||||
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
|
||||
<option name="ASSIGNMENT_WRAP" value="1" />
|
||||
<option name="IF_BRACE_FORCE" value="1" />
|
||||
<option name="DOWHILE_BRACE_FORCE" value="1" />
|
||||
<option name="WHILE_BRACE_FORCE" value="1" />
|
||||
<option name="FOR_BRACE_FORCE" value="1" />
|
||||
<option name="FIELD_ANNOTATION_WRAP" value="0" />
|
||||
@@ -227,6 +220,10 @@
|
||||
<option name="TAB_SIZE" value="8" />
|
||||
</indentOptions>
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="JSON">
|
||||
<option name="KEEP_LINE_BREAKS" value="false" />
|
||||
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="JSP">
|
||||
<indentOptions>
|
||||
<option name="INDENT_SIZE" value="2" />
|
||||
@@ -259,7 +256,6 @@
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="Python">
|
||||
<option name="KEEP_LINE_BREAKS" value="false" />
|
||||
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
|
||||
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="SQL">
|
||||
@@ -277,4 +273,3 @@
|
||||
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
|
||||
</component>
|
||||
</project>
|
||||
|
||||
|
5
.idea/codeStyles/codeStyleConfig.xml
generated
Normal file
5
.idea/codeStyles/codeStyleConfig.xml
generated
Normal file
@@ -0,0 +1,5 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<state>
|
||||
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
|
||||
</state>
|
||||
</component>
|
10
.idea/misc.xml
generated
10
.idea/misc.xml
generated
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="EntryPointsManager">
|
||||
<entry_points version="2.0" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="IntelliJ Plugin SDK" project-jdk-type="IDEA JDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
|
9
.idea/modules.xml
generated
9
.idea/modules.xml
generated
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/ideavim.iml" filepath="$PROJECT_DIR$/ideavim.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
|
36
.idea/runConfigurations/All_tests.xml
generated
36
.idea/runConfigurations/All_tests.xml
generated
@@ -1,36 +0,0 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="All tests" type="JUnit" factoryName="JUnit">
|
||||
<extension name="coverage" enabled="false" merge="false" runner="idea">
|
||||
<pattern>
|
||||
<option name="PATTERN" value="com.maddyhome.idea.vim.*" />
|
||||
<option name="ENABLED" value="true" />
|
||||
</pattern>
|
||||
<pattern>
|
||||
<option name="PATTERN" value="org.jetbrains.plugins.ideavim.*" />
|
||||
<option name="ENABLED" value="true" />
|
||||
</pattern>
|
||||
</extension>
|
||||
<module name="ideavim" />
|
||||
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
|
||||
<option name="ALTERNATIVE_JRE_PATH" value="" />
|
||||
<option name="PACKAGE_NAME" value="org.jetbrains.plugins.ideavim" />
|
||||
<option name="MAIN_CLASS_NAME" value="" />
|
||||
<option name="METHOD_NAME" value="" />
|
||||
<option name="TEST_OBJECT" value="package" />
|
||||
<option name="VM_PARAMETERS" value="-ea" />
|
||||
<option name="PARAMETERS" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
|
||||
<option name="ENV_VARIABLES" />
|
||||
<option name="PASS_PARENT_ENVS" value="true" />
|
||||
<option name="TEST_SEARCH_SCOPE">
|
||||
<value defaultName="moduleWithDependencies" />
|
||||
</option>
|
||||
<envs />
|
||||
<patterns />
|
||||
<RunnerSettings RunnerId="Cover" />
|
||||
<RunnerSettings RunnerId="Run" />
|
||||
<ConfigurationWrapper RunnerId="Cover" />
|
||||
<ConfigurationWrapper RunnerId="Run" />
|
||||
<method />
|
||||
</configuration>
|
||||
</component>
|
10
.idea/runConfigurations/IdeaVim.xml
generated
10
.idea/runConfigurations/IdeaVim.xml
generated
@@ -1,10 +0,0 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="IdeaVim" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
|
||||
<module name="ideavim" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -Didea.is.internal=true" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<RunnerSettings RunnerId="Run" />
|
||||
<ConfigurationWrapper RunnerId="Run" />
|
||||
<method />
|
||||
</configuration>
|
||||
</component>
|
7
.idea/vcs.xml
generated
7
.idea/vcs.xml
generated
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
|
25
AUTHORS.md
25
AUTHORS.md
@@ -27,6 +27,31 @@ Contributors:
|
||||
* [Dathan Bennett](mailto:dbennett@palantir.com)
|
||||
* [salaam](mailto:kphayen@gmail.com)
|
||||
* [Alexey Shmalko](mailto:rasen.dubi@gmail.com)
|
||||
* [Andrew Brookins](mailto:a.m.brookins@gmail.com)
|
||||
* [Chang Wang](mailto:changwang83@gmail.com)
|
||||
* [Jaime Sanchez](mailto:josejaime.sanchez@gmail.com)
|
||||
* [Thomas B Homburg](mailto:thomas@homburg.dk)
|
||||
* [smartbomb](mailto:smartbomb@server.fake)
|
||||
* [Tuomas Tynkkynen](mailto:tuomas.tynkkynen@iki.fi)
|
||||
* [Jackson Popkin](mailto:jackson@donorschoose.org)
|
||||
* [Teruo Kunihiro](mailto:yuyuyu1999@gmail.com)
|
||||
* [Liubov Paina](mailto:lubashka.994@mail.ru)
|
||||
* [Daniel Leong](mailto:falcone88@gmail.com)
|
||||
* [Aleksey Lagoshin](mailto:aleksey@pri-num.com)
|
||||
* [Paulo Bu](mailto:pbu_98@yahoo.com)
|
||||
* [Giorgos Gaganis](mailto:gaganis@yahoo.com)
|
||||
* [Pavel Fatin](mailto:pavel.fatin@jetbrains.com)
|
||||
* [tieTYT](mailto:tietyt@gmail.com)
|
||||
* [Nick Gieschen](mailto:nickgieschen@gmail.com)
|
||||
* [Naoto Ikeno](mailto:ikenox@gmail.com)
|
||||
* [Maximilian Luz](mailto:qzed@users.noreply.github.com)
|
||||
* [Vladimir Parfinenko](mailto:vparfinenko@excelsior-usa.com)
|
||||
* [Florian Hassmann](mailto:hassmann@hwdev.de)
|
||||
* [Jan Palus](mailto:jpalus@fastmail.com)
|
||||
* [Konstantin Petrov](mailto:kpetrov@ripe.net)
|
||||
* [Vasily Alferov](mailto:ya-ikmik2012@yandex.ru)
|
||||
* [Vitalii Karavaev](mailto:fkve97@gmail.com)
|
||||
* [John Lin](mailto:johnlinp@gmail.com)
|
||||
|
||||
If you are a contributor and your name is not listed here, feel free to
|
||||
contact the maintainer.
|
||||
|
232
CHANGES.md
232
CHANGES.md
@@ -4,6 +4,238 @@ The Changelog
|
||||
History of changes in IdeaVim for the IntelliJ platform.
|
||||
|
||||
|
||||
Get an Early Access
|
||||
-------------------
|
||||
|
||||
Would you like to try new features and fixes? Join the Early Access Program and
|
||||
receive EAP builds as updates! Add this URL to "Settings | Plugins |
|
||||
Browse Repositories | Manage Repositories":
|
||||
[https://plugins.jetbrains.com/plugins/eap/ideavim](https://plugins.jetbrains.com/plugins/eap/ideavim)
|
||||
|
||||
It is important to distinguish EAP from traditional pre-release software.
|
||||
Please note that the quality of EAP versions may at times be way below even
|
||||
usual beta standards.
|
||||
|
||||
|
||||
To Be Released
|
||||
--------------
|
||||
|
||||
...
|
||||
|
||||
|
||||
0.50, 2018-10-18
|
||||
----------------
|
||||
|
||||
Moved "Vim Emulation" settings into "File | Settings | Vim Emulation". Support
|
||||
for vim-multiple-cursors commands `<A-n>`, `<A-x>`, `<A-p>`, `g<A-n>` (put `set
|
||||
multiple-cursors` into your ~/.ideavimrc to enable it). Support for running
|
||||
Vim commands for multiple cursors. Various bug fixes.
|
||||
|
||||
* [VIM-634](https://youtrack.jetbrains.com/issue/VIM-634) Support for vim-multiple-cursors commands `<A-n>`, `<A-x>`, `<A-p>`, `g<A-n>`
|
||||
* [VIM-780](https://youtrack.jetbrains.com/issue/VIM-780) Support for running Vim commands for multiple cursors
|
||||
* [VIM-176](https://youtrack.jetbrains.com/issue/VIM-176) Fixed arrow key navigation in Run/Debug tool windows
|
||||
* [VIM-339](https://youtrack.jetbrains.com/issue/VIM-339) Fixed `<Esc>` in diff windows
|
||||
* [VIM-862](https://youtrack.jetbrains.com/issue/VIM-862) Allow `:action` to work in visual mode
|
||||
* [VIM-1110](https://youtrack.jetbrains.com/issue/VIM-1110) Put the caret in correct place after `I` in visual block mode
|
||||
* [VIM-1329](https://youtrack.jetbrains.com/issue/VIM-1329) Request focus reliably for Ex entry and output panels
|
||||
* [VIM-1368](https://youtrack.jetbrains.com/issue/VIM-1368) Wait for focus reliably before running an `:action`
|
||||
* [VIM-1379](https://youtrack.jetbrains.com/issue/VIM-1379) Fixed `I` for short lines in visual block mode
|
||||
* [VIM-1380](https://youtrack.jetbrains.com/issue/VIM-1380) Fixed `cw` with count at the end of a word
|
||||
* [VIM-1404](https://youtrack.jetbrains.com/issue/VIM-1404) Fixed the ability to use `:e#` when editor tabs are hidden
|
||||
* [VIM-1431](https://youtrack.jetbrains.com/issue/VIM-1431) Fixed pasting text into the empty document
|
||||
* [VIM-1427](https://youtrack.jetbrains.com/issue/VIM-1427) Added the support for count to the `it` and `at` motions
|
||||
* [VIM-1287](https://youtrack.jetbrains.com/issue/VIM-1287) Fixed `i(` actions inside string literals
|
||||
* [VIM-1317](https://youtrack.jetbrains.com/issue/VIM-1317) Don't run Undo/Redo inside write actions
|
||||
* [VIM-1366](https://youtrack.jetbrains.com/issue/VIM-1366) Don't wrap a secondary event loop for `input()` into a write action
|
||||
* [VIM-1274](https://youtrack.jetbrains.com/issue/VIM-1274) Correctly process escaping when `smartcase` is on
|
||||
|
||||
|
||||
0.49, 2017-12-12
|
||||
----------------
|
||||
|
||||
Enabled zero-latency typing for Vim emulation. Added support for `iskeyword` option. Various bug fixes.
|
||||
|
||||
* [VIM-1254](https://youtrack.jetbrains.com/issue/VIM-1254) Enable zero-latency typing for Vim emulation
|
||||
* [VIM-1367](https://youtrack.jetbrains.com/issue/VIM-1367) Support `iskeyword` option
|
||||
* [VIM-523](https://youtrack.jetbrains.com/issue/VIM-523) Fixed global mark remembering only the line number
|
||||
|
||||
0.48, 2017-01-15
|
||||
----------------
|
||||
|
||||
A bugfix release.
|
||||
|
||||
Bug fixes:
|
||||
|
||||
* [VIM-1205](https://youtrack.jetbrains.com/issue/VIM-1205) Don't move key handling into separate event for raw handlers
|
||||
* [VIM-1216](https://youtrack.jetbrains.com/issue/VIM-1216) Fixed `.` resetting the last find movement while repeating change that also uses movement
|
||||
|
||||
Features:
|
||||
|
||||
* Support for zero-latency rendering
|
||||
|
||||
|
||||
0.47, 2016-10-19
|
||||
----------------
|
||||
|
||||
A bugfix release.
|
||||
|
||||
Bug fixes:
|
||||
|
||||
* VIM-1098 Don't start visual selection when mouse click was actually drag over single character
|
||||
* VIM-1190 Fixed exception "Write access is allowed from write-safe contexts only"
|
||||
|
||||
|
||||
0.46, 2016-07-07
|
||||
----------------
|
||||
|
||||
Added `incsearch` option for incremental search. Added support for `it` and
|
||||
`at` tag block selection. Added `vim-surround` commands `ys`, `cs`, `ds`,
|
||||
`S`. Various bug fixes.
|
||||
|
||||
Features:
|
||||
|
||||
* VIM-769 Added `vim-surround` commands `ys`, `cs`, `ds`, `S`
|
||||
* VIM-264 Added tag block selection
|
||||
* VIM-271 Added `incsearch` option for showing search results while typing
|
||||
* VIM-217 Added support for `={motion}` formatting command
|
||||
|
||||
Bug fixes:
|
||||
|
||||
* VIM-796 Fixed focus issues with `:action` command
|
||||
* VIM-581 Fixed use of special registers `0`-`9` and `-` in delete commands
|
||||
* VIM-965 Fixed exception in `[m` in some file types
|
||||
* VIM-564 Fixed `g_` move to go to the current line
|
||||
* VIM-964 Fixed marks behavior when the whole line got deleted
|
||||
* VIM-259 Move caret to the line beginning after `==`
|
||||
* VIM-246 Fixed `{count}==` formatting
|
||||
* VIM-287 Fixed insert new line before and after folds
|
||||
* VIM-139 Focus on current search and use modal confirmation for `:s///gc`
|
||||
* VIM-843 Don't highlight search results after restart
|
||||
* VIM-1126 Fixed warning about modifying shortcuts of global actions for 2016.2
|
||||
|
||||
|
||||
0.44, 2015-11-02
|
||||
----------------
|
||||
|
||||
A bugfix release.
|
||||
|
||||
|
||||
* VIM-1040 Fixed typing keys in completion menus and typing with the
|
||||
plugin disabled
|
||||
|
||||
|
||||
0.43, 2015-11-02
|
||||
----------------
|
||||
|
||||
A bugfix release.
|
||||
|
||||
* VIM-1039 Fixed running the plugin with Java 6
|
||||
|
||||
|
||||
0.42, 2015-11-01
|
||||
----------------
|
||||
|
||||
This release is compatible with IntelliJ 15+ and other IDEs based on the
|
||||
IntelliJ platform branch 143+.
|
||||
|
||||
* VIM-970 Fixed move commands in read-only files
|
||||
|
||||
|
||||
0.41, 2015-06-10
|
||||
----------------
|
||||
|
||||
A bugfix release.
|
||||
|
||||
* VIM-957 Fixed plugin version 0.40 is not compatible with IDEs other than
|
||||
IntelliJ
|
||||
|
||||
|
||||
0.40, 2015-06-09
|
||||
----------------
|
||||
|
||||
Added support for `mapleader`. Support comments in `%` brace matching. Various
|
||||
bug fixes.
|
||||
|
||||
Features:
|
||||
|
||||
* VIM-650 Added support for `mapleader`
|
||||
* VIM-932 Support comments in `%` brace matching
|
||||
|
||||
Bug fixes:
|
||||
|
||||
* VIM-586 Invoke Vim shortcuts handler later to restore the sequence of input
|
||||
events
|
||||
* VIM-838 `J` shouldn't add whitespace if there is a trailing space
|
||||
* VIM-855 Fixed regexp character class problem
|
||||
* VIM-210 Fix focus issues with the Ex panel and splits
|
||||
* VIM-575 Don't change cursor position of other splits in visual mode
|
||||
* VIM-864 Fixed visual marks getting changed during visual substitute
|
||||
* VIM-856 Fixed regex look-behind problem
|
||||
* VIM-868 Allow count on `gt` and `gT`
|
||||
* VIM-700 Remapping `0` should still allow it to be entered in command count
|
||||
* VIM-781 Fixed expanding visual block selection past empty lines
|
||||
* VIM-845 Fixed `c` and `x` functionality for visual block selections
|
||||
* VIM-930 Fixed editor focus issues after closing Ex entry box on Oracle Java 6
|
||||
|
||||
|
||||
0.39, 2014-12-03
|
||||
----------------
|
||||
|
||||
A bugfix release.
|
||||
|
||||
Bug fixes:
|
||||
|
||||
* VIM-848 Show line numbers if they are enabled in the settings and there is
|
||||
no `set number`
|
||||
* VIM-702 Fix infinite loop on `s/$/\r/g`
|
||||
* EA-63022 Don't update line numbers in the caret movement event listener
|
||||
|
||||
|
||||
0.38, 2014-12-01
|
||||
----------------
|
||||
|
||||
Added support for `number` and `relativenumber` options, `clipboard=unnamed`
|
||||
option. Added `:action` and `:actionlist` commands for executing arbitrary
|
||||
IDE actions. Various bug fixes.
|
||||
|
||||
Features:
|
||||
|
||||
* VIM-476 Added support for `clipboard=unnamed` option
|
||||
* VIM-410 Added support for `relativenumber` option
|
||||
* VIM-483 Added support for `number` option
|
||||
* VIM-652 Added `:action` and `:actionlist` commands for executing arbitrary
|
||||
IDE actions
|
||||
|
||||
Bug fixes:
|
||||
|
||||
* VIM-818 Enable key repeat on Mac OS X every time it gets reset by the OS
|
||||
* VIM-624 Deselect visual selection range on opening the Ex entry field
|
||||
* VIM-511 Fixed editing offset after `<BS>` for `.` command
|
||||
* VIM-792 Fixed line-wise and block-wise paste commands for `*` and `+`
|
||||
registers
|
||||
* VIM-501 Fixed off-by-1 error in visual block-wise selection
|
||||
* VIM-613 Fixed repeat after `d$`
|
||||
* VIM-705 Fixed repeated multiline indent
|
||||
* VIM-567 Fixed `:!` to allow running non-filter commands
|
||||
* VIM-536 Fixed `cc` on the second-to-last line
|
||||
* VIM-515 Fixed `cW` command detecting end-of-word incorrectly
|
||||
* VIM-794 Fixed NCDFE related to 'number' in IDEs other than IntelliJ
|
||||
* VIM-771 Fix semicolon repeat for 'till char' motion
|
||||
* VIM-723 Fix pasting to an empty line
|
||||
|
||||
|
||||
0.37, 2014-10-15
|
||||
----------------
|
||||
|
||||
A bugfix release.
|
||||
|
||||
Bug fixes:
|
||||
|
||||
* VIM-784 Fixed visual line selection where the start of the selection range
|
||||
was greater than its end
|
||||
* VIM-407 Fixed `>>` to work if a line contains only one character
|
||||
|
||||
|
||||
0.36, 2014-10-14
|
||||
----------------
|
||||
|
||||
|
142
README.md
142
README.md
@@ -2,27 +2,33 @@ IdeaVim
|
||||
=======
|
||||
|
||||
<div>
|
||||
<a href="http://teamcity.jetbrains.com/viewType.html?buildTypeId=bt299&guest=1">
|
||||
<img src="http://teamcity.jetbrains.com/app/rest/builds/buildType:(id:bt299)/statusIcon"/>
|
||||
<a href="https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub">
|
||||
<img src="http://jb.gg/badges/official.svg" alt="official JetBrains project"/>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<a href="http://teamcity.jetbrains.com/viewType.html?buildTypeId=IdeaVim_Build&guest=1">
|
||||
<img src="http://teamcity.jetbrains.com/app/rest/builds/buildType:(id:IdeaVim_Build)/statusIcon.svg?guest=1"/>
|
||||
</a>
|
||||
<span>Build<span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<a href="http://teamcity.jetbrains.com/viewType.html?buildTypeId=bt453&guest=1">
|
||||
<img src="http://teamcity.jetbrains.com/app/rest/builds/buildType:(id:bt453)/statusIcon"/>
|
||||
<a href="http://teamcity.jetbrains.com/viewType.html?buildTypeId=IdeaVim_TestsForIntelliJ20182&guest=1">
|
||||
<img src="http://teamcity.jetbrains.com/app/rest/builds/buildType:(id:IdeaVim_TestsForIntelliJ20182)/statusIcon.svg?guest=1"/>
|
||||
</a>
|
||||
<span>Tests</span>
|
||||
</div>
|
||||
|
||||
IdeaVim is a Vim emulation plug-in for IDEs based on the IntelliJ platform.
|
||||
IdeaVim can be used with IntelliJ IDEA, RubyMine, PyCharm, PhpStorm, WebStorm,
|
||||
AppCode, CLion and Android Studio.
|
||||
IdeaVim is a Vim emulation plugin for IDEs based on the IntelliJ platform.
|
||||
IdeaVim can be used with IntelliJ IDEA, PyCharm, CLion, PhpStorm, WebStorm,
|
||||
RubyMine, AppCode, DataGrip, GoLand, Cursive, and Android Studio.
|
||||
|
||||
Resources:
|
||||
|
||||
* [Plugin homepage](http://plugins.jetbrains.com/plugin/164)
|
||||
* [Changelog](https://github.com/JetBrains/ideavim/blob/master/CHANGES.md)
|
||||
* [Changelog](CHANGES.md)
|
||||
* [Bug tracker](http://youtrack.jetbrains.com/issues/VIM)
|
||||
* [Continuous integration builds](http://teamcity.jetbrains.com/project.html?projectId=IdeaVim&guest=1)
|
||||
* [@IdeaVim](http://twitter.com/ideavim) in Twitter
|
||||
@@ -36,12 +42,29 @@ Start the IDE normally and enable the Vim emulation using "Tools | Vim
|
||||
Emulator" menu item. At this point you must use Vim keystrokes in all editors.
|
||||
|
||||
If you wish to disable the plugin, select the "Tools | Vim Emulator" menu so
|
||||
it is unchecked. At this point IDE will work with it's regular keyboard
|
||||
it is unchecked. At this point your IDE will work with its regular keyboard
|
||||
shortcuts.
|
||||
|
||||
Keyboard shortcut conflicts between the Vim emulation and the IDE can be
|
||||
resolved via "File | Settings | Vim Emulation", "File | Settings | Keymap"
|
||||
and key mapping commands in your ~/.ideavimrc file.
|
||||
resolved via "File | Settings | Editor | Vim Emulation", "File | Settings |
|
||||
Keymap" on Linux & Windows, and by "Preferences | Editor | Vim Emulation",
|
||||
"Preferences | Keymap" on macOS. They can also be resolved by key mapping
|
||||
commands in your ~/.ideavimrc file.
|
||||
|
||||
|
||||
Get an Early Access
|
||||
-------------------
|
||||
|
||||
Would you like to try new features and fixes? Join the Early Access Program and
|
||||
receive EAP builds as updates! Add this URL to "Settings | Plugins |
|
||||
Browse Repositories | Manage Repositories":
|
||||
[https://plugins.jetbrains.com/plugins/eap/ideavim](https://plugins.jetbrains.com/plugins/eap/ideavim)
|
||||
|
||||
See [the changelog](CHANGES.md) for the list of hot unreleased features.
|
||||
|
||||
It is important to distinguish EAP from traditional pre-release software.
|
||||
Please note that the quality of EAP versions may at times be way below even
|
||||
usual beta standards.
|
||||
|
||||
|
||||
Summary of Supported Vim Features
|
||||
@@ -57,7 +80,7 @@ Supported:
|
||||
* Undo/redo
|
||||
* Visual mode commands
|
||||
* Some Ex commands
|
||||
* Some [:set options](https://github.com/JetBrains/ideavim/blob/master/doc/set-commands.md)
|
||||
* Some [:set options](doc/set-commands.md)
|
||||
* Full Vim regexps for search and search/replace
|
||||
* Key mappings
|
||||
* Macros
|
||||
@@ -66,6 +89,11 @@ Supported:
|
||||
* Window commands
|
||||
* Vim web help
|
||||
|
||||
Emulated Vim plugins:
|
||||
|
||||
* vim-surround
|
||||
* vim-multiple-cursors
|
||||
|
||||
Not supported (yet):
|
||||
|
||||
* Jump lists
|
||||
@@ -73,7 +101,7 @@ Not supported (yet):
|
||||
|
||||
See also:
|
||||
|
||||
* [List of recently added commands](https://github.com/JetBrains/ideavim/blob/master/src/com/maddyhome/idea/vim/package-info.java)
|
||||
* [The list of all supported commands](src/com/maddyhome/idea/vim/package-info.java)
|
||||
* [Top features and bugs](http://youtrack.jetbrains.com/issues/VIM?q=%23Unresolved+sort+by%3A+votes)
|
||||
|
||||
|
||||
@@ -91,6 +119,29 @@ Note, that IdeaVim currently parses ~/.ideavimrc file via simple pattern matchin
|
||||
see [VIM-669](http://youtrack.jetbrains.com/issue/VIM-669) for proper parsing
|
||||
of VimL files.
|
||||
|
||||
Also note that if you have overridden the `user.home` JVM option, this
|
||||
will affect where IdeaVim looks for your .ideavimrc file. For example, if you
|
||||
have `-Duser.home=/my/alternate/home` then IdeaVim will source
|
||||
`/my/alternate/home/.ideavimrc` instead of `~/.ideavimrc`.
|
||||
|
||||
|
||||
Emulated Vim Plugins
|
||||
--------------------
|
||||
|
||||
IdeaVim extensions emulate some plugins of the original Vim. In order to use
|
||||
IdeaVim extensions, you have to enable them via this command in your ~/.ideavimrc:
|
||||
|
||||
set <extension-name>
|
||||
|
||||
Available extensions:
|
||||
|
||||
* surround
|
||||
* Emulates [vim-surround](https://github.com/tpope/vim-surround)
|
||||
* Commands: `ys`, `cs`, `ds`, `S`
|
||||
* multiple-cursors
|
||||
* Emulates [vim-multiple-cursors](https://github.com/terryma/vim-multiple-cursors)
|
||||
* Commands: `<A-n>`, `<A-x>`, `<A-p>`, `g<A-n>`
|
||||
|
||||
|
||||
Changes to the IDE
|
||||
------------------
|
||||
@@ -99,19 +150,34 @@ Changes to the IDE
|
||||
|
||||
The IdeaVim plugin uses the undo/redo functionality of the IntelliJ platform,
|
||||
so the behaviour of the `u` and `<C-R>` commands may differ from the original
|
||||
Vim. Vim compatibility of undo/redo may be improved in the future releases.
|
||||
Vim. Vim compatibility of undo/redo may be improved in future releases.
|
||||
|
||||
See also [unresolved undo issues](http://youtrack.jetbrains.com/issues/VIM?q=%23Unresolved+Help+topic%3A+u).
|
||||
|
||||
### Escape
|
||||
|
||||
Using `<Esc>` in dialog windows remains problematic. For most dialog windows
|
||||
the Vim emulator is put into the insert mode without the possibility to switch to
|
||||
the normal mode. In some dialog windows the normal mode is on by default. The
|
||||
usage of the Vim emulator in dialog windows is an area for improvements.
|
||||
the Vim emulator is put into the insert mode with `<Esc>` not working. You
|
||||
should use `<C-c>` or `<C-[>` instead. In some dialog windows the normal mode is
|
||||
on by default. The usage of the Vim emulator in dialog windows is an area for
|
||||
improvements.
|
||||
|
||||
See also [unresolved escape issues](http://youtrack.jetbrains.com/issues/VIM?q=%23Unresolved+Help+topic%3A+i_Esc).
|
||||
|
||||
### Executing IDE Actions
|
||||
|
||||
IdeaVim adds two commands for listing and executing arbitrary IDE actions as
|
||||
Ex commands or via `:map` command mappings:
|
||||
|
||||
* `:actionlist [pattern]`
|
||||
* Find IDE actions by name pattern
|
||||
* `:action {name}`
|
||||
* Execute an action named `NAME`
|
||||
|
||||
For example, here `\r` is mapped to the Reformat Code action:
|
||||
|
||||
:map \r :action ReformatCode<CR>
|
||||
|
||||
|
||||
Contributing
|
||||
------------
|
||||
@@ -134,34 +200,39 @@ in the issue tracker.
|
||||
|
||||
1. Fork IdeaVim on GitHub and clone the repository on your local machine.
|
||||
|
||||
2. Open the project in IntelliJ IDEA 13.1+ (Community or Ultimate) using "File |
|
||||
Open... | /path/to/ideavim".
|
||||
2. Import the project from existing sources in IntelliJ IDEA 2018.1 or newer (Community or
|
||||
Ultimate) using "File | New | Project from Existing Sources..." or "Import
|
||||
Project" from the start window.
|
||||
|
||||
3. Set up a JDK if you haven't got it yet. Use "File | Project Structure | SDKs
|
||||
| Add new JDK".
|
||||
* In the project wizard select "Import project from external model | Gradle"
|
||||
|
||||
4. Set up an IntelliJ plugin SDK using "File | Project Structure | SDKs | Add
|
||||
new IntelliJ IDEA Plugin SDK". The correct path to your current installation
|
||||
of IntelliJ will be suggested automatically. You will be prompted to select a
|
||||
JDK for your plugin SDK. Select the JDK from the previous step. You
|
||||
**should** name your plugin SDK `IntelliJ Plugin SDK` in order to match the
|
||||
name in the project settings stored in the Git repository.
|
||||
* Select your Java 8+ JDK as the Gradle JVM, leave other parameters unchanged
|
||||
|
||||
5. Select a project SDK for your project using "File | Project Structure |
|
||||
Project | Project SDK". Choose the plugin SDK you have created at the
|
||||
previous step.
|
||||
3. Run your IdeaVim plugin within IntelliJ via a Gradle task
|
||||
|
||||
6. Build IdeaVim and run IntelliJ with IdeaVim enabled using the "IdeaVim" run
|
||||
configuration (use "Run | Run... | IdeaVim").
|
||||
* Select "View | Tool Windows | Gradle" tool window
|
||||
|
||||
7. In order to be able to run tests in your IntelliJ edition uncomment the
|
||||
appropriate lines in the constructor of the `VimTestCase` class.
|
||||
* Launch "ideavim | intellij | runIde" from the tool window
|
||||
|
||||
4. Run IdeaVim tests via a Gradle task
|
||||
|
||||
* Select "View | Tool Windows | Gradle" tool window
|
||||
|
||||
* Launch "ideavim | verification | test" from the tool window
|
||||
|
||||
5. Build the plugin distribution by running `./gradlew clean buildPlugin` in the
|
||||
terminal in your project root.
|
||||
|
||||
* The resulting distribution file is build/distributions/IdeaVim-VERSION.zip
|
||||
|
||||
* You can install this file using "Settings | Plugins | Install plugin
|
||||
from disk"
|
||||
|
||||
|
||||
Authors
|
||||
-------
|
||||
|
||||
See [AUTHORS.md](https://github.com/JetBrains/ideavim/blob/master/AUTHORS.md)
|
||||
See [AUTHORS.md](AUTHORS.md)
|
||||
for a list of authors and contributors.
|
||||
|
||||
|
||||
@@ -169,4 +240,3 @@ License
|
||||
-------
|
||||
|
||||
IdeaVim is licensed under the terms of the GNU Public license version 2.
|
||||
|
||||
|
54
build.gradle
Normal file
54
build.gradle
Normal file
@@ -0,0 +1,54 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'org.jetbrains.intellij' version '0.3.12'
|
||||
}
|
||||
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'kotlin'
|
||||
|
||||
sourceCompatibility = javaVersion
|
||||
targetCompatibility = javaVersion
|
||||
|
||||
tasks.withType(JavaCompile) { options.encoding = 'UTF-8' }
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
java.srcDir 'src'
|
||||
resources.srcDir 'resources'
|
||||
}
|
||||
test {
|
||||
java.srcDir 'test'
|
||||
}
|
||||
}
|
||||
|
||||
intellij {
|
||||
version ideaVersion
|
||||
pluginName 'IdeaVim'
|
||||
updateSinceUntilBuild false
|
||||
downloadSources Boolean.valueOf(downloadIdeaSources)
|
||||
instrumentCode Boolean.valueOf(instrumentPluginCode)
|
||||
|
||||
publishPlugin {
|
||||
channels publishChannels.split(',')
|
||||
username publishUsername
|
||||
password publishPassword
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
|
||||
compile "org.jetbrains.kotlin:kotlin-runtime:$kotlinVersion"
|
||||
}
|
@@ -1,4 +0,0 @@
|
||||
version-id:0.36
|
||||
platform-version:135.0
|
||||
idea.download.url=http://download.jetbrains.com/idea/ideaIU-13.1.zip
|
||||
build.number=dev
|
180
build.xml
180
build.xml
@@ -1,180 +0,0 @@
|
||||
<project name="IdeaVim">
|
||||
<!--
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003-2009 Rick Maddy, Oleg Shpynov
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
-->
|
||||
<property file="build.properties"/>
|
||||
|
||||
<property name="idea" value="${basedir}/idea"/>
|
||||
<property name="src" value="${basedir}/src"/>
|
||||
<property name="resources" value="${basedir}/resources"/>
|
||||
<property name="test" value="${basedir}/test"/>
|
||||
<property name="idea.home" value="${idea}/unzip"/>
|
||||
<property environment="env"/>
|
||||
<property name="tools.jar" value="${env.JAVA_HOME}/lib/tools.jar"/>
|
||||
<property name="version" value="${version-id}"/>
|
||||
<property name="filename" value="ideavim-${version}"/>
|
||||
|
||||
<!--Output-->
|
||||
<property name="out" value="${basedir}/out"/>
|
||||
<property name="classes" value="${out}/classes"/>
|
||||
<property name="build" value="${out}/build"/>
|
||||
<property name="dist" value="${out}/dist"/>
|
||||
<property name="test-reports" value="${out}/test-reports"/>
|
||||
|
||||
<path id="build.classpath">
|
||||
<fileset dir="${idea.home}/lib">
|
||||
<include name="*.jar"/>
|
||||
</fileset>
|
||||
<fileset dir="${java.home}/lib">
|
||||
<include name="*.jar"/>
|
||||
</fileset>
|
||||
<pathelement path="${classes}"/>
|
||||
</path>
|
||||
|
||||
<path id="test.classpath">
|
||||
<path refid="build.classpath"/>
|
||||
<pathelement path="${tools.jar}"/>
|
||||
</path>
|
||||
|
||||
<!-- Clean all the generated stuff -->
|
||||
<target name="clean" description="Removes all generated files">
|
||||
<delete dir="${out}"/>
|
||||
</target>
|
||||
|
||||
<!-- Compile all the sources to the ${classes} folder -->
|
||||
<target name="compile">
|
||||
<mkdir dir="${classes}"/>
|
||||
<taskdef name="javac2" classname="com.intellij.ant.Javac2">
|
||||
<classpath refid="build.classpath"/>
|
||||
</taskdef>
|
||||
<!-- The task requires the following libraries from IntelliJ IDEA distribution: -->
|
||||
<!-- javac2.jar; jdom.jar; asm.jar; asm-commons.jar -->
|
||||
<javac2 destdir="${classes}" debug="on" fork="true" encoding="UTF-8" includeantruntime="false">
|
||||
<classpath refid="build.classpath"/>
|
||||
<src path="${src}"/>
|
||||
<include name="com/maddyhome/idea/**"/>
|
||||
</javac2>
|
||||
</target>
|
||||
|
||||
<!-- Create ideavim.jar for packing inside zip plugin package -->
|
||||
<target name="jar">
|
||||
<mkdir dir="${classes}"/>
|
||||
<mkdir dir="${classes}/META-INF"/>
|
||||
<copy file="resources/META-INF/plugin.xml" todir="${classes}/META-INF">
|
||||
<filterset>
|
||||
<filter token="VERSION" value="${version}"/>
|
||||
<filter token="SINCE-VERSION" value="${platform-version}"/>
|
||||
<filter token="BUILD-NUMBER" value="${build.number}"/>
|
||||
</filterset>
|
||||
</copy>
|
||||
<copy todir="${classes}">
|
||||
<fileset dir="${src}" excludes="**/*.java"/>
|
||||
</copy>
|
||||
<copy todir="${classes}">
|
||||
<fileset dir="${resources}"/>
|
||||
</copy>
|
||||
<mkdir dir="${build}"/>
|
||||
<jar basedir="${classes}" jarfile="${build}/IdeaVim.jar" compress="yes"/>
|
||||
</target>
|
||||
|
||||
<target name="build" depends="unzip, clean, compile, jar" description="Compiles all source code and created plugin jar file"/>
|
||||
|
||||
<!-- Download IntelliJ IDEA distribution -->
|
||||
<target name="download" description="Downloads IntelliJ IDEA artifacts">
|
||||
<mkdir dir="${idea}"/>
|
||||
<get src="${idea.download.url}" dest="${idea}" skipexisting="true"/>
|
||||
</target>
|
||||
|
||||
<!-- Unpack idea-*.zip file for ideavim compilation -->
|
||||
<target name="unzip" depends="download" description="Unzip downloaded artifacts and set up idea.home">
|
||||
<delete dir="${idea}/unzip"/>
|
||||
<mkdir dir="${idea}/unzip"/>
|
||||
<basename property="idea.filename" file="${idea.download.url}"/>
|
||||
<unzip dest="${idea}/unzip">
|
||||
<fileset dir="${idea}" includes="${idea.filename}"/>
|
||||
</unzip>
|
||||
</target>
|
||||
|
||||
<target name="dist" depends="dist-src, dist-bin" description="Creates the src and bin distribution files"/>
|
||||
|
||||
<!-- Prepare layout for plugin distribution and creates zip file which can be published -->
|
||||
<target name="dist-bin" depends="clean, build" description="Creates a zip file containing the plugin sources">
|
||||
<delete dir="${build}/IdeaVim"/>
|
||||
<mkdir dir="${build}/IdeaVim"/>
|
||||
<copy file="${basedir}/LICENSE.txt" tofile="${build}/IdeaVim/LICENSE"/>
|
||||
<copy todir="${build}/IdeaVim/lib">
|
||||
<fileset dir="${build}" includes="*.jar"/>
|
||||
</copy>
|
||||
<copy file="${basedir}/README.md" tofile="${build}/IdeaVim/README"/>
|
||||
<copy file="${basedir}/CHANGES.md" tofile="${build}/IdeaVim/CHANGES"/>
|
||||
<zip basedir="${build}" zipfile="${dist}/${filename}-${build.number}.zip" compress="true" includes="IdeaVim/**"/>
|
||||
</target>
|
||||
|
||||
<!-- Packs all the sources -->
|
||||
<target name="dist-src" depends="clean" description="Creates the source tar file">
|
||||
<mkdir dir="${dist}"/>
|
||||
<tar basedir="." destfile="${dist}/${filename}-src.tar.gz" excludes=".git/**,.idea/**,idea/**,out/**,*.iws,*.iml" compression="gzip"/>
|
||||
</target>
|
||||
|
||||
<target name="compile-tests" depends="compile">
|
||||
<mkdir dir="${classes}"/>
|
||||
<taskdef name="javac2" classname="com.intellij.ant.Javac2">
|
||||
<classpath refid="build.classpath"/>
|
||||
</taskdef>
|
||||
<javac2 destdir="${classes}" debug="on" fork="true" encoding="UTF-8" includeantruntime="false">
|
||||
<classpath refid="build.classpath"/>
|
||||
<src path="${test}"/>
|
||||
<include name="org/jetbrains/plugins/ideavim/**"/>
|
||||
</javac2>
|
||||
</target>
|
||||
|
||||
<target name="prepare-tests" depends="compile-tests">
|
||||
<mkdir dir="${classes}/META-INF"/>
|
||||
<copy file="resources/META-INF/plugin.xml" todir="${classes}/META-INF">
|
||||
<filterset>
|
||||
<filter token="VERSION" value="${version}"/>
|
||||
<filter token="SINCE-VERSION" value="${platform-version}"/>
|
||||
</filterset>
|
||||
</copy>
|
||||
<copy todir="${classes}">
|
||||
<fileset dir="${resources}"/>
|
||||
</copy>
|
||||
<mkdir dir="${out}/IdeaVim"/>
|
||||
</target>
|
||||
|
||||
<target name="test" depends="unzip, clean, prepare-tests">
|
||||
<mkdir dir="${test-reports}"/>
|
||||
<junit fork="true" logfailedtests="false" printsummary="true">
|
||||
<classpath refid="test.classpath"/>
|
||||
|
||||
<jvmarg value="-Xmx256M"/>
|
||||
<jvmarg value="-ea"/>
|
||||
<jvmarg value="-Djava.awt.headless=true"/>
|
||||
<jvmarg value="-Didea.plugins.path=${out}"/>
|
||||
<jvmarg value="-Didea.load.plugins.id=IdeaVIM"/>
|
||||
|
||||
<formatter type="plain"/>
|
||||
|
||||
<batchtest todir="${test-reports}">
|
||||
<fileset dir="${test}">
|
||||
<include name="**/*Test.java"/>
|
||||
</fileset>
|
||||
</batchtest>
|
||||
</junit>
|
||||
</target>
|
||||
</project>
|
@@ -3,13 +3,19 @@ List of Supported Set Commands
|
||||
|
||||
The following `:set` commands can appear in `~/.ideavimrc` or set manually in the command mode:
|
||||
|
||||
'clipboard' 'cb' clipboard options
|
||||
'digraph' 'dg' enable the entering of digraphs in Insert mode
|
||||
'gdefault' 'gd' the ":substitute" flag 'g' is default on
|
||||
'history' 'hi' number of command-lines that are remembered
|
||||
'hlsearch' 'hls' highlight matches with last search pattern
|
||||
'ignorecase' 'ic' ignore case in search patterns
|
||||
'iskeyword' 'isk' defines keywords for commands like 'w', '*', etc.
|
||||
'incsearch' 'is' show where search pattern typed so far matches
|
||||
'matchpairs' 'mps' pairs of characters that "%" can match
|
||||
'nrformats' 'nf' number formats recognized for CTRL-A command
|
||||
'number' 'nu' print the line number in front of each line
|
||||
'relativenumber' 'rnu' show the line number relative to the line with
|
||||
the cursor
|
||||
'scroll' 'scr' lines to scroll with CTRL-U and CTRL-D
|
||||
'scrolljump' 'sj' minimum number of lines to scroll
|
||||
'scrolloff' 'so' minimum nr. of lines above and below cursor
|
||||
@@ -18,7 +24,9 @@ The following `:set` commands can appear in `~/.ideavimrc` or set manually in th
|
||||
'sidescroll' 'ss' minimum number of columns to scroll horizontal
|
||||
'sidescrolloff' 'siso' min. nr. of columns to left and right of cursor
|
||||
'smartcase' 'scs' no ignore case when pattern has uppercase
|
||||
'timeout' 'to' use timeout for mapped key sequences
|
||||
'timeoutlen' 'tm' time that is waited for a mapped key sequence
|
||||
'undolevels' 'ul' maximum number of changes that can be undone
|
||||
'viminfo' 'vi' information to remember after restart
|
||||
'visualbell' 'vb' use visual bell instead of beeping
|
||||
'wrapscan' 'ws' searches wrap around the end of the file
|
||||
|
9
gradle.properties
Normal file
9
gradle.properties
Normal file
@@ -0,0 +1,9 @@
|
||||
ideaVersion IC-2018.2.5
|
||||
downloadIdeaSources true
|
||||
instrumentPluginCode true
|
||||
version SNAPSHOT
|
||||
javaVersion 1.8
|
||||
kotlinVersion 1.2.71
|
||||
publishUsername username
|
||||
publishPassword password
|
||||
publishChannels eap
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
Binary file not shown.
6
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
6
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
#Fri Dec 29 11:00:46 MSK 2017
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-all.zip
|
172
gradlew
vendored
Executable file
172
gradlew
vendored
Executable file
@@ -0,0 +1,172 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
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.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=$((i+1))
|
||||
done
|
||||
case $i in
|
||||
(0) set -- ;;
|
||||
(1) set -- "$args0" ;;
|
||||
(2) set -- "$args0" "$args1" ;;
|
||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=$(save "$@")
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
|
||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
||||
cd "$(dirname "$0")"
|
||||
fi
|
||||
|
||||
exec "$JAVACMD" "$@"
|
84
gradlew.bat
vendored
Normal file
84
gradlew.bat
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windows variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
15
ideavim.iml
15
ideavim.iml
@@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PLUGIN_MODULE" version="4">
|
||||
<component name="DevKit.ModuleBuildProperties" url="file://$MODULE_DIR$/resources/META-INF/plugin.xml" />
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/resources" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
|
@@ -1,79 +1,52 @@
|
||||
<idea-plugin url="http://plugins.jetbrains.com/plugin/164">
|
||||
<name>IdeaVim</name>
|
||||
<id>IdeaVIM</id>
|
||||
<change-notes>
|
||||
<![CDATA[
|
||||
<p>0.36:</p>
|
||||
<change-notes><![CDATA[
|
||||
<p>0.50:</p>
|
||||
<ul>
|
||||
<li>Window commands from the <code><C-W></code> family</li>
|
||||
<li>Support for <code>:split</code>/<code>:vsplit</code> commands</li>
|
||||
<li>Fixed visual block selection mode</li>
|
||||
<li>Moved "Vim Emulation" settings into "File | Settings | Editor"</li>
|
||||
<li>Support for vim-multiple-cursors commands <code><A-n></code>, <code><A-x></code>, <code><A-p></code>, <code>g<A-n></code> (put <code>set multiple-cursors</code> into your ~/.ideavimrc to enable it)</li>
|
||||
<li>Support for running Vim commands for multiple cursors</li>
|
||||
<li>The <a href="https://github.com/JetBrains/ideavim/blob/master/src/com/maddyhome/idea/vim/package-info.java">index of supported commands</a> on the GitHub page</li>
|
||||
<li>Various bug fixes</li>
|
||||
</ul>
|
||||
<p>0.35:</p>
|
||||
<p>0.49:</p>
|
||||
<ul>
|
||||
<li><code>~/.vimrc</code> is no longer read by default, use <code>~/.ideavimrc</code> instead</li>
|
||||
<li>Enabled zero-latency typing for Vim emulation</li>
|
||||
<li>Support for <code>iskeyword</code> option</li>
|
||||
<li>Various bug fixes</li>
|
||||
</ul>
|
||||
<p>0.34:</p>
|
||||
<p>0.48:</p>
|
||||
<ul>
|
||||
<li>Various bug fixes</li>
|
||||
</ul>
|
||||
<p>0.33:</p>
|
||||
<ul>
|
||||
<li>Support for <code>:map</code> key mapping commands</li>
|
||||
<li>New keyboard shortcuts handler that doesn't require a separate keymap for Vim emulation</li>
|
||||
<li>Support for <code>:source</code> command</li>
|
||||
<li>Support for <code>:sort</code> command</li>
|
||||
<li>Various bug fixes</li>
|
||||
</ul>
|
||||
<p>0.32:</p>
|
||||
<ul>
|
||||
<li>Fixed API compatibility with IntelliJ platform builds 132.1052+</li>
|
||||
</ul>
|
||||
<p>0.31:</p>
|
||||
<p>0.47:</p>
|
||||
<ul>
|
||||
<li>Various bug fixes</li>
|
||||
</ul>
|
||||
<p>0.30:</p>
|
||||
<p>0.46:</p>
|
||||
<ul>
|
||||
<li>Support for a separate <code>.ideavimrc</code> config file</li>
|
||||
<li>Fixed long-standing issues with merged undo/redo commands and <code><Esc></code> during completion</li>
|
||||
<li>Support for <code>incsearch</code> option for showing search results while typing</li>
|
||||
<li>Support for <code>it</code> and <code>at</code> tag block selection</li>
|
||||
<li>Support for vim-surround commands <code>ys</code>, <code>cs</code>, <code>ds</code>, <code>S</code>, enable it with <code>set surround</code> in your ~/.ideavimrc</li>
|
||||
<li>Support for <code>={motion}</code> formatting command</li>
|
||||
<li>Various bug fixes</li>
|
||||
</ul>
|
||||
<p>See also the complete <a href="https://github.com/JetBrains/ideavim/blob/master/CHANGES.md">changelog</a>.</p>
|
||||
]]>
|
||||
</change-notes>
|
||||
<description>
|
||||
<![CDATA[
|
||||
<p>Build @VERSION@-@BUILD-NUMBER@</p>
|
||||
<p>Vim emulation plug-in for IDEs based on the IntelliJ platform. IdeaVim can be used with IntelliJ IDEA, RubyMine, PyCharm, PhpStorm, WebStorm, AppCode, CLion and Android Studio.</p>
|
||||
<p>Supported functionality:</p>
|
||||
]]></change-notes>
|
||||
<description><![CDATA[
|
||||
<p>Vim emulation plug-in for IDEs based on the IntelliJ platform.</p>
|
||||
<p>IdeaVim supports many Vim features including normal/insert/visual modes, motion keys, deletion/changing, marks, registers, some Ex commands, Vim regexps, configuration via ~/.ideavimrc, macros, window commands, etc.</p>
|
||||
<p>See also:</p>
|
||||
<ul>
|
||||
<li>Motion keys</li>
|
||||
<li>Deletion/changing</li>
|
||||
<li>Insert mode commands</li>
|
||||
<li>Marks</li>
|
||||
<li>Registers</li>
|
||||
<li>Undo/redo</li>
|
||||
<li>Visual mode commands</li>
|
||||
<li>Some Ex commands</li>
|
||||
<li>Some :set options</li>
|
||||
<li>Full Vim regexps for search and search/replace</li>
|
||||
<li>Key mappings</li>
|
||||
<li>Configuration via ~/.ideavimrc</li>
|
||||
<li>Macros</li>
|
||||
<li>Digraphs</li>
|
||||
<li>Command line and search history</li>
|
||||
<li>Window commands</li>
|
||||
<li>Vim web help</li>
|
||||
<li><a href="https://github.com/JetBrains/ideavim">GitHub repository</a>: documentation and contributing</li>
|
||||
<li><a href="http://youtrack.jetbrains.com/issues/VIM">Issue tracker</a>: feature requests and bug reports</li>
|
||||
</ul>
|
||||
]]>
|
||||
</description>
|
||||
<version>@VERSION@</version>
|
||||
]]></description>
|
||||
<version>SNAPSHOT</version>
|
||||
<vendor>JetBrains</vendor>
|
||||
|
||||
<idea-version since-build="@SINCE-VERSION@"/>
|
||||
<idea-version since-build="181.0"/>
|
||||
|
||||
<!-- Mark the plugin as compatible with RubyMine and other products based on the IntelliJ platform -->
|
||||
<depends>com.intellij.modules.lang</depends>
|
||||
@@ -85,9 +58,17 @@
|
||||
</component>
|
||||
</application-components>
|
||||
|
||||
<extensionPoints>
|
||||
<extensionPoint qualifiedName="IdeaVIM.vimExtension" interface="com.maddyhome.idea.vim.extension.VimExtension"/>
|
||||
</extensionPoints>
|
||||
|
||||
<extensions defaultExtensionNs="com.intellij">
|
||||
<errorHandler implementation="com.intellij.diagnostic.ITNReporter"/>
|
||||
<applicationConfigurable instance="com.maddyhome.idea.vim.ui.VimEmulationConfigurable"/>
|
||||
<applicationConfigurable groupId="editor" instance="com.maddyhome.idea.vim.ui.VimEmulationConfigurable"/>
|
||||
</extensions>
|
||||
|
||||
<extensions defaultExtensionNs="IdeaVIM">
|
||||
<vimExtension implementation="com.maddyhome.idea.vim.extension.surround.VimSurroundExtension"/>
|
||||
<vimExtension implementation="com.maddyhome.idea.vim.extension.multiplecursors.VimMultipleCursorsExtension"/>
|
||||
</extensions>
|
||||
|
||||
<actions>
|
||||
@@ -173,6 +154,7 @@
|
||||
<action id="VimMotionInnerBlockDoubleQuote" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockDoubleQuoteAction" text="Select inner double quote block"/>
|
||||
<action id="VimMotionInnerBlockSingleQuote" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockSingleQuoteAction" text="Select inner single quote block"/>
|
||||
<action id="VimMotionInnerBlockBackQuote" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockBackQuoteAction" text="Select inner back quote block"/>
|
||||
<action id="VimMotionInnerBlockTag" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockTagAction" text="Select inner >< block >/<"/>
|
||||
<action id="VimMotionOuterBlockAngle" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockAngleAction" text="Select outer < block"/>
|
||||
<action id="VimMotionOuterBlockBrace" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockBraceAction" text="Select outer { block"/>
|
||||
<action id="VimMotionOuterBlockBracket" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockBracketAction" text="Select outer [ block"/>
|
||||
@@ -180,6 +162,7 @@
|
||||
<action id="VimMotionOuterBlockDoubleQuote" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockDoubleQuoteAction" text="Select outer double quote block"/>
|
||||
<action id="VimMotionOuterBlockSingleQuote" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockSingleQuoteAction" text="Select outer single quote block"/>
|
||||
<action id="VimMotionOuterBlockBackQuote" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockBackQuoteAction" text="Select outer back quote block"/>
|
||||
<action id="VimMotionOuterBlockTag" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockTagAction" text="Select outer >< block >/<"/>
|
||||
<action id="VimMotionInnerParagraph" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerParagraphAction" text="Select Inner Paragraph"/>
|
||||
<action id="VimMotionOuterParagraph" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterParagraphAction" text="Select Outer Paragraph"/>
|
||||
<action id="VimMotionInnerSentence" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerSentenceAction" text="Select Inner Sentence"/>
|
||||
@@ -293,6 +276,7 @@
|
||||
|
||||
<!-- Shift -->
|
||||
<action id="VimAutoIndentLines" class="com.maddyhome.idea.vim.action.change.shift.AutoIndentLinesAction" text="Auto Indent Lines"/>
|
||||
<action id="VimAutoIndentMotion" class="com.maddyhome.idea.vim.action.change.shift.AutoIndentMotionAction" text="Auto Indent Lines"/>
|
||||
<action id="VimShiftLeftLines" class="com.maddyhome.idea.vim.action.change.shift.ShiftLeftLinesAction" text="Shift Lines Left"/>
|
||||
<action id="VimShiftLeftMotion" class="com.maddyhome.idea.vim.action.change.shift.ShiftLeftMotionAction" text="Shift Motion Left"/>
|
||||
<action id="VimShiftLeftVisual" class="com.maddyhome.idea.vim.action.change.shift.ShiftLeftVisualAction" text="Shift Visual Left"/>
|
||||
@@ -369,6 +353,7 @@
|
||||
<action id="VimUndo" class="com.maddyhome.idea.vim.action.change.UndoAction" text="Undo"/>
|
||||
|
||||
<!-- Keys -->
|
||||
<action id="VimShortcutKeyAction" class="com.maddyhome.idea.vim.action.VimShortcutKeyAction" text="Vim Shortcuts"/>
|
||||
<action id="VimShortcutKeyAction" class="com.maddyhome.idea.vim.action.VimShortcutKeyAction" text="Shortcuts"/>
|
||||
<action id="VimOperatorAction" class="com.maddyhome.idea.vim.action.change.OperatorAction" text="Operator"/>
|
||||
</actions>
|
||||
</idea-plugin>
|
||||
|
@@ -48,3 +48,4 @@ E385=E385: search hit BOTTOM without match for: {0}
|
||||
e_patnotf2=Pattern not found: {0}
|
||||
unkopt=Unknown option: {0}
|
||||
e_invarg=Invalid argument: {0}
|
||||
E774=E774: 'operatorfunc' is empty
|
||||
|
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.maddyhome.idea.vim;
|
||||
|
||||
import com.intellij.openapi.Disposable;
|
||||
@@ -42,13 +60,13 @@ public class EventFacade {
|
||||
|
||||
public void setupTypedActionHandler(@NotNull TypedActionHandler handler) {
|
||||
final TypedAction typedAction = getTypedAction();
|
||||
myOriginalTypedActionHandler = typedAction.getHandler();
|
||||
typedAction.setupHandler(handler);
|
||||
myOriginalTypedActionHandler = typedAction.getRawHandler();
|
||||
typedAction.setupRawHandler(handler);
|
||||
}
|
||||
|
||||
public void restoreTypedActionHandler() {
|
||||
if (myOriginalTypedActionHandler != null) {
|
||||
getTypedAction().setupHandler(myOriginalTypedActionHandler);
|
||||
getTypedAction().setupRawHandler(myOriginalTypedActionHandler);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -24,8 +24,10 @@ import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.application.Application;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.ModalityState;
|
||||
import com.intellij.openapi.command.CommandProcessor;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actionSystem.ActionPlan;
|
||||
import com.intellij.openapi.editor.actionSystem.TypedActionHandler;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil;
|
||||
@@ -33,16 +35,18 @@ import com.maddyhome.idea.vim.command.Argument;
|
||||
import com.maddyhome.idea.vim.command.Command;
|
||||
import com.maddyhome.idea.vim.command.CommandState;
|
||||
import com.maddyhome.idea.vim.command.MappingMode;
|
||||
import com.maddyhome.idea.vim.extension.VimExtensionHandler;
|
||||
import com.maddyhome.idea.vim.group.RegisterGroup;
|
||||
import com.maddyhome.idea.vim.helper.*;
|
||||
import com.maddyhome.idea.vim.helper.DigraphSequence;
|
||||
import com.maddyhome.idea.vim.helper.EditorDataContext;
|
||||
import com.maddyhome.idea.vim.helper.RunnableHelper;
|
||||
import com.maddyhome.idea.vim.helper.StringHelper;
|
||||
import com.maddyhome.idea.vim.key.*;
|
||||
import com.maddyhome.idea.vim.option.Options;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -91,6 +95,26 @@ public class KeyHandler {
|
||||
return origHandler;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invoked before acquiring a write lock and actually handling the keystroke.
|
||||
*
|
||||
* Drafts an optional {@link ActionPlan} that will be used as a base for zero-latency rendering in editor.
|
||||
*
|
||||
* @param editor The editor the key was typed into
|
||||
* @param key The keystroke typed by the user
|
||||
* @param context The data context
|
||||
* @param plan The current action plan
|
||||
*/
|
||||
public void beforeHandleKey(@NotNull Editor editor, @NotNull KeyStroke key,
|
||||
@NotNull DataContext context, @NotNull ActionPlan plan) {
|
||||
|
||||
final CommandState.Mode mode = CommandState.getInstance(editor).getMode();
|
||||
|
||||
if (mode == CommandState.Mode.INSERT || mode == CommandState.Mode.REPLACE) {
|
||||
VimPlugin.getChange().beforeProcessKey(editor, context, key, plan);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the main key handler for the Vim plugin. Every keystroke not handled directly by Idea is sent here for
|
||||
* processing.
|
||||
@@ -111,29 +135,29 @@ public class KeyHandler {
|
||||
editor = InjectedLanguageUtil.getTopLevelEditor(editor);
|
||||
final CommandState editorState = CommandState.getInstance(editor);
|
||||
|
||||
if (allowKeyMappings && handleKeyMapping(editor, key, context)) {
|
||||
return;
|
||||
}
|
||||
|
||||
final boolean isRecording = editorState.isRecording();
|
||||
boolean shouldRecord = true;
|
||||
// If this is a "regular" character keystroke, get the character
|
||||
char chKey = key.getKeyChar() == KeyEvent.CHAR_UNDEFINED ? 0 : key.getKeyChar();
|
||||
|
||||
if (isEditorReset(key, editorState)) {
|
||||
handleEditorReset(editor, key, context);
|
||||
}
|
||||
// At this point the user must be typing in a command. Most commands can be preceded by a number. Let's
|
||||
// check if a number can be entered at this point, and if so, did the user send us a digit.
|
||||
else if (isCommandCount(editorState, chKey)) {
|
||||
final boolean isRecording = editorState.isRecording();
|
||||
boolean shouldRecord = true;
|
||||
|
||||
// Check for command count before key mappings - otherwise e.g. ':map 0 ^' breaks command counts that contain a zero
|
||||
if (isCommandCount(editorState, chKey)) {
|
||||
// Update the count
|
||||
count = count * 10 + (chKey - '0');
|
||||
}
|
||||
else if (allowKeyMappings && handleKeyMapping(editor, key, context)) {
|
||||
return;
|
||||
}
|
||||
// Pressing delete while entering a count "removes" the last digit entered
|
||||
// Unlike the digits, this must be checked *after* checking for key mappings
|
||||
else if (isDeleteCommandCount(key, editorState)) {
|
||||
// "Remove" the last digit sent to us
|
||||
count /= 10;
|
||||
}
|
||||
else if (isEditorReset(key, editorState)) {
|
||||
handleEditorReset(editor, key, context);
|
||||
}
|
||||
// If we got this far the user is entering a command or supplying an argument to an entered command.
|
||||
// First let's check to see if we are at the point of expecting a single character argument to a command.
|
||||
else if (currentArg == Argument.Type.CHARACTER) {
|
||||
@@ -216,7 +240,7 @@ public class KeyHandler {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean handleKeyMapping(@NotNull final Editor editor, @NotNull KeyStroke key,
|
||||
private boolean handleKeyMapping(@NotNull final Editor editor, @NotNull final KeyStroke key,
|
||||
@NotNull final DataContext context) {
|
||||
final CommandState commandState = CommandState.getInstance(editor);
|
||||
commandState.stopMappingTimer();
|
||||
@@ -231,35 +255,58 @@ public class KeyHandler {
|
||||
}
|
||||
|
||||
final KeyMapping mapping = VimPlugin.getKey().getKeyMapping(mappingMode);
|
||||
final MappingInfo mappingInfo = mapping.get(fromKeys);
|
||||
final MappingInfo currentMappingInfo = mapping.get(fromKeys);
|
||||
final MappingInfo prevMappingInfo = mapping.get(mappingKeys);
|
||||
final MappingInfo mappingInfo = currentMappingInfo != null ? currentMappingInfo : prevMappingInfo;
|
||||
|
||||
final Application application = ApplicationManager.getApplication();
|
||||
|
||||
if (mapping.isPrefix(fromKeys)) {
|
||||
mappingKeys.add(key);
|
||||
commandState.startMappingTimer(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent actionEvent) {
|
||||
if (!application.isUnitTestMode() && Options.getInstance().isSet(Options.TIMEOUT)) {
|
||||
commandState.startMappingTimer(actionEvent -> application.invokeLater(() -> {
|
||||
mappingKeys.clear();
|
||||
if (editor.isDisposed()) {
|
||||
return;
|
||||
}
|
||||
for (KeyStroke keyStroke : fromKeys) {
|
||||
handleKey(editor, keyStroke, new EditorDataContext(editor), false);
|
||||
}
|
||||
}, ModalityState.stateForComponent(editor.getComponent())));
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
else if (mappingInfo != null) {
|
||||
mappingKeys.clear();
|
||||
final Application application = ApplicationManager.getApplication();
|
||||
final Runnable handleMappedKeys = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
final boolean fromIsPrefix = isPrefix(mappingInfo.getFromKeys(), mappingInfo.getToKeys());
|
||||
if (editor.isDisposed()) {
|
||||
return;
|
||||
}
|
||||
final List<KeyStroke> toKeys = mappingInfo.getToKeys();
|
||||
final VimExtensionHandler extensionHandler = mappingInfo.getExtensionHandler();
|
||||
final EditorDataContext currentContext = new EditorDataContext(editor);
|
||||
if (toKeys != null) {
|
||||
final boolean fromIsPrefix = isPrefix(mappingInfo.getFromKeys(), toKeys);
|
||||
boolean first = true;
|
||||
for (KeyStroke keyStroke : mappingInfo.getToKeys()) {
|
||||
for (KeyStroke keyStroke : toKeys) {
|
||||
final boolean recursive = mappingInfo.isRecursive() && !(first && fromIsPrefix);
|
||||
handleKey(editor, keyStroke, new EditorDataContext(editor), recursive);
|
||||
handleKey(editor, keyStroke, currentContext, recursive);
|
||||
first = false;
|
||||
}
|
||||
}
|
||||
else if (extensionHandler != null) {
|
||||
final CommandProcessor processor = CommandProcessor.getInstance();
|
||||
processor.executeCommand(editor.getProject(),
|
||||
() -> extensionHandler.execute(editor, context),
|
||||
"Vim " + extensionHandler.getClass().getSimpleName(),
|
||||
null);
|
||||
}
|
||||
if (prevMappingInfo != null) {
|
||||
handleKey(editor, key, currentContext);
|
||||
}
|
||||
}
|
||||
};
|
||||
if (application.isUnitTestMode()) {
|
||||
handleMappedKeys.run();
|
||||
@@ -292,8 +339,9 @@ public class KeyHandler {
|
||||
}
|
||||
|
||||
private void handleEditorReset(@NotNull Editor editor, @NotNull KeyStroke key, @NotNull final DataContext context) {
|
||||
if (state != State.COMMAND && count == 0 && currentArg == Argument.Type.NONE && currentCmd.size() == 0 &&
|
||||
VimPlugin.getRegister().getCurrentRegister() == RegisterGroup.REGISTER_DEFAULT) {
|
||||
if (state != State.COMMAND && count == 0 && currentArg == Argument.Type.NONE && currentCmd.size() == 0) {
|
||||
RegisterGroup register = VimPlugin.getRegister();
|
||||
if (register.getCurrentRegister() == register.getDefaultRegister()) {
|
||||
if (key.getKeyCode() == KeyEvent.VK_ESCAPE) {
|
||||
CommandProcessor.getInstance().executeCommand(editor.getProject(), new Runnable() {
|
||||
@Override
|
||||
@@ -304,6 +352,7 @@ public class KeyHandler {
|
||||
}
|
||||
VimPlugin.indicateError();
|
||||
}
|
||||
}
|
||||
reset(editor);
|
||||
}
|
||||
|
||||
@@ -322,9 +371,7 @@ public class KeyHandler {
|
||||
|
||||
private boolean isEditorReset(@NotNull KeyStroke key, @NotNull CommandState editorState) {
|
||||
return (editorState.getMode() == CommandState.Mode.COMMAND || state == State.COMMAND) &&
|
||||
(key.getKeyCode() == KeyEvent.VK_ESCAPE ||
|
||||
(key.getKeyCode() == KeyEvent.VK_C && (key.getModifiers() & KeyEvent.CTRL_MASK) != 0) ||
|
||||
(key.getKeyCode() == '[' && (key.getModifiers() & KeyEvent.CTRL_MASK) != 0));
|
||||
StringHelper.isCloseKeyStroke(key);
|
||||
}
|
||||
|
||||
private void handleCharArgument(@NotNull KeyStroke key, char chKey) {
|
||||
@@ -422,22 +469,24 @@ public class KeyHandler {
|
||||
lastWasBS = ((cmd.getFlags() & Command.FLAG_IS_BACKSPACE) != 0);
|
||||
|
||||
Project project = editor.getProject();
|
||||
if (cmd.getType().isRead() || project == null || EditorHelper.canEdit(project, editor)) {
|
||||
final Command.Type type = cmd.getType();
|
||||
if (type.isWrite() && !editor.getDocument().isWritable()) {
|
||||
VimPlugin.indicateError();
|
||||
reset(editor);
|
||||
}
|
||||
if (ApplicationManager.getApplication().isDispatchThread()) {
|
||||
Runnable action = new ActionRunner(editor, context, cmd, key);
|
||||
String name = cmd.getAction().getTemplatePresentation().getText();
|
||||
name = name != null ? "Vim " + name : "";
|
||||
if (cmd.getType().isWrite()) {
|
||||
if (type.isWrite()) {
|
||||
RunnableHelper.runWriteCommand(project, action, name, action);
|
||||
}
|
||||
else {
|
||||
else if (type.isRead()) {
|
||||
RunnableHelper.runReadCommand(project, action, name, action);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
VimPlugin.indicateError();
|
||||
reset(editor);
|
||||
CommandProcessor.getInstance().executeCommand(project, action, name, action);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -560,12 +609,10 @@ public class KeyHandler {
|
||||
* @param name The name of the action to execute
|
||||
* @param context The context to run it in
|
||||
*/
|
||||
public static void executeAction(@NotNull String name, @NotNull DataContext context) {
|
||||
public static boolean executeAction(@NotNull String name, @NotNull DataContext context) {
|
||||
ActionManager aMgr = ActionManager.getInstance();
|
||||
AnAction action = aMgr.getAction(name);
|
||||
if (action != null) {
|
||||
executeAction(action, context);
|
||||
}
|
||||
return action != null && executeAction(action, context);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -574,16 +621,20 @@ public class KeyHandler {
|
||||
* @param action The action to execute
|
||||
* @param context The context to run it in
|
||||
*/
|
||||
public static void executeAction(@NotNull AnAction action, @NotNull DataContext context) {
|
||||
public static boolean executeAction(@NotNull AnAction action, @NotNull DataContext context) {
|
||||
// Hopefully all the arguments are sufficient. So far they all seem to work OK.
|
||||
// We don't have a specific InputEvent so that is null
|
||||
// What is "place"? Leave it the empty string for now.
|
||||
// Is the template presentation sufficient?
|
||||
// What are the modifiers? Is zero OK?
|
||||
action.actionPerformed(
|
||||
new AnActionEvent(null, context, "", action.getTemplatePresentation(), ActionManager.getInstance(),
|
||||
// API change - don't merge
|
||||
0));
|
||||
final AnActionEvent event = new AnActionEvent(null, context, "", action.getTemplatePresentation(),
|
||||
ActionManager.getInstance(), 0);
|
||||
action.update(event);
|
||||
if (event.getPresentation().isEnabled()) {
|
||||
action.actionPerformed(event);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -73,12 +73,12 @@ public class RegisterActions {
|
||||
new KeyStroke[]{KeyStroke.getKeyStroke('g'),
|
||||
KeyStroke.getKeyStroke(KeyEvent.VK_G, KeyEvent.CTRL_MASK)})
|
||||
);
|
||||
// TODO - add zC
|
||||
// TODO - add zO
|
||||
parser.registerAction(MappingMode.NV, "CollapseAllRegions", Command.Type.OTHER_READONLY, new Shortcut("zM"));
|
||||
parser.registerAction(MappingMode.NV, "CollapseRegion", Command.Type.OTHER_READONLY, new Shortcut("zc"));
|
||||
parser.registerAction(MappingMode.NV, "CollapseRegionRecursively", Command.Type.OTHER_READONLY, new Shortcut("zC"));
|
||||
parser.registerAction(MappingMode.NV, "ExpandAllRegions", Command.Type.OTHER_READONLY, new Shortcut("zR"));
|
||||
parser.registerAction(MappingMode.NV, "ExpandRegion", Command.Type.OTHER_READONLY, new Shortcut("zo"));
|
||||
parser.registerAction(MappingMode.NV, "ExpandRegionRecursively", Command.Type.OTHER_READONLY, new Shortcut("zO"));
|
||||
parser.registerAction(MappingMode.NV, "VimToggleRecording",
|
||||
Command.Type.OTHER_READONLY,
|
||||
Command.FLAG_NO_ARG_RECORDING,
|
||||
@@ -147,6 +147,10 @@ public class RegisterActions {
|
||||
new Shortcut("a<"),
|
||||
new Shortcut("a>")
|
||||
});
|
||||
parser.registerAction(MappingMode.VO, "VimMotionInnerBlockTag", Command.Type.MOTION,
|
||||
Command.FLAG_MOT_CHARACTERWISE | Command.FLAG_MOT_INCLUSIVE | Command.FLAG_TEXT_BLOCK,
|
||||
new Shortcut[]{new Shortcut("it")}
|
||||
);
|
||||
parser.registerAction(MappingMode.VO, "VimMotionOuterBlockBrace", Command.Type.MOTION,
|
||||
Command.FLAG_MOT_CHARACTERWISE | Command.FLAG_MOT_INCLUSIVE | Command.FLAG_TEXT_BLOCK,
|
||||
new Shortcut[]{new Shortcut("aB"), new Shortcut("a{"), new Shortcut("a}")}
|
||||
@@ -171,6 +175,10 @@ public class RegisterActions {
|
||||
Command.FLAG_MOT_CHARACTERWISE | Command.FLAG_MOT_INCLUSIVE | Command.FLAG_TEXT_BLOCK, new Shortcut[]{
|
||||
new Shortcut("a`"),
|
||||
});
|
||||
parser.registerAction(MappingMode.VO, "VimMotionOuterBlockTag", Command.Type.MOTION,
|
||||
Command.FLAG_MOT_CHARACTERWISE | Command.FLAG_MOT_INCLUSIVE | Command.FLAG_TEXT_BLOCK,
|
||||
new Shortcut[]{new Shortcut("at")}
|
||||
);
|
||||
parser.registerAction(MappingMode.NO, "VimResetMode", Command.Type.RESET, new Shortcut(new KeyStroke[]{
|
||||
KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SLASH, KeyEvent.CTRL_MASK),
|
||||
KeyStroke.getKeyStroke(KeyEvent.VK_N, KeyEvent.CTRL_MASK)
|
||||
@@ -507,10 +515,10 @@ public class RegisterActions {
|
||||
new Shortcut("gp"));
|
||||
parser.registerAction(MappingMode.N, "VimCopyPutTextBeforeCursorNoIndent", Command.Type.PASTE, new Shortcut[]{
|
||||
new Shortcut("[P"),
|
||||
new Shortcut("]P")
|
||||
new Shortcut("]P"),
|
||||
new Shortcut("[p")
|
||||
});
|
||||
parser.registerAction(MappingMode.N, "VimCopyPutTextAfterCursorNoIndent", Command.Type.PASTE, new Shortcut[]{
|
||||
new Shortcut("[p"),
|
||||
new Shortcut("]p")
|
||||
});
|
||||
parser.registerAction(MappingMode.N, "VimCopyYankLine", Command.Type.COPY,
|
||||
@@ -606,9 +614,9 @@ public class RegisterActions {
|
||||
new Shortcut("@:"));
|
||||
parser.registerAction(MappingMode.N, "QuickJavaDoc", Command.Type.OTHER_READONLY,
|
||||
new Shortcut('K'));
|
||||
parser.registerAction(MappingMode.N, "VimRedo", Command.Type.OTHER_WRITABLE,
|
||||
parser.registerAction(MappingMode.N, "VimRedo", Command.Type.OTHER_SELF_SYNCHRONIZED,
|
||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_R, KeyEvent.CTRL_MASK)));
|
||||
parser.registerAction(MappingMode.N, "VimUndo", Command.Type.OTHER_WRITABLE, new Shortcut[]{
|
||||
parser.registerAction(MappingMode.N, "VimUndo", Command.Type.OTHER_SELF_SYNCHRONIZED, new Shortcut[]{
|
||||
new Shortcut('u'),
|
||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_UNDO, 0))
|
||||
});
|
||||
@@ -624,17 +632,17 @@ public class RegisterActions {
|
||||
});
|
||||
|
||||
// Shift Actions
|
||||
// TODO - add =
|
||||
// TODO - == will ignore count and only auto-indent 1 lines
|
||||
parser.registerAction(MappingMode.N, "VimAutoIndentLines", Command.Type.CHANGE,
|
||||
new Shortcut("=="));
|
||||
parser.registerAction(MappingMode.N, "VimAutoIndentMotion", Command.Type.CHANGE, Command.FLAG_OP_PEND,
|
||||
new Shortcut('='), Argument.Type.MOTION);
|
||||
parser.registerAction(MappingMode.N, "VimShiftLeftLines", Command.Type.CHANGE,
|
||||
new Shortcut("<<"));
|
||||
parser.registerAction(MappingMode.N, "VimShiftLeftMotion", Command.Type.CHANGE,
|
||||
parser.registerAction(MappingMode.N, "VimShiftLeftMotion", Command.Type.CHANGE, Command.FLAG_OP_PEND,
|
||||
new Shortcut('<'), Argument.Type.MOTION);
|
||||
parser.registerAction(MappingMode.N, "VimShiftRightLines", Command.Type.CHANGE,
|
||||
new Shortcut(">>"));
|
||||
parser.registerAction(MappingMode.N, "VimShiftRightMotion", Command.Type.CHANGE,
|
||||
parser.registerAction(MappingMode.N, "VimShiftRightMotion", Command.Type.CHANGE, Command.FLAG_OP_PEND,
|
||||
new Shortcut('>'), Argument.Type.MOTION);
|
||||
|
||||
// Jump Actions
|
||||
@@ -722,11 +730,11 @@ public class RegisterActions {
|
||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_END, KeyEvent.CTRL_MASK)));
|
||||
parser.registerAction(MappingMode.I, "VimMotionLastColumn", Command.Type.INSERT, Command.FLAG_SAVE_STROKE,
|
||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_END, 0)));
|
||||
parser.registerAction(MappingMode.I, "VimMotionLeft", Command.Type.INSERT, Command.FLAG_SAVE_STROKE, new Shortcut[]{
|
||||
parser.registerAction(MappingMode.I, "VimMotionLeft", Command.Type.INSERT, new Shortcut[]{
|
||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0)),
|
||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_KP_LEFT, 0))
|
||||
});
|
||||
parser.registerAction(MappingMode.I, "VimMotionRight", Command.Type.INSERT, Command.FLAG_SAVE_STROKE, new Shortcut[]{
|
||||
parser.registerAction(MappingMode.I, "VimMotionRight", Command.Type.INSERT, new Shortcut[]{
|
||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0)),
|
||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_KP_RIGHT, 0))
|
||||
});
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -17,23 +17,22 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim;
|
||||
|
||||
import com.intellij.ide.plugins.IdeaPluginDescriptor;
|
||||
import com.intellij.ide.plugins.PluginManager;
|
||||
import com.intellij.ide.util.PropertiesComponent;
|
||||
import com.intellij.notification.*;
|
||||
import com.intellij.openapi.application.Application;
|
||||
import com.intellij.openapi.application.ApplicationInfo;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.ex.ApplicationEx;
|
||||
import com.intellij.openapi.application.ex.ApplicationManagerEx;
|
||||
import com.intellij.openapi.components.ApplicationComponent;
|
||||
import com.intellij.openapi.components.PersistentStateComponent;
|
||||
import com.intellij.openapi.components.State;
|
||||
import com.intellij.openapi.components.Storage;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.EditorFactory;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorActionManager;
|
||||
import com.intellij.openapi.editor.actionSystem.TypedAction;
|
||||
import com.intellij.openapi.editor.event.EditorFactoryAdapter;
|
||||
import com.intellij.openapi.editor.event.EditorFactoryEvent;
|
||||
import com.intellij.openapi.editor.ex.EditorEx;
|
||||
import com.intellij.openapi.extensions.PluginId;
|
||||
import com.intellij.openapi.keymap.Keymap;
|
||||
import com.intellij.openapi.keymap.ex.KeymapManagerEx;
|
||||
@@ -43,27 +42,31 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.project.ProjectManager;
|
||||
import com.intellij.openapi.project.ProjectManagerAdapter;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.updateSettings.impl.UpdateChecker;
|
||||
import com.intellij.openapi.util.JDOMUtil;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.vfs.CharsetToolkit;
|
||||
import com.intellij.openapi.wm.StatusBar;
|
||||
import com.intellij.openapi.wm.WindowManager;
|
||||
import com.maddyhome.idea.vim.command.CommandState;
|
||||
import com.intellij.util.io.HttpRequests;
|
||||
import com.maddyhome.idea.vim.ex.CommandParser;
|
||||
import com.maddyhome.idea.vim.ex.VimScriptParser;
|
||||
import com.maddyhome.idea.vim.ex.vimscript.VimScriptParser;
|
||||
import com.maddyhome.idea.vim.group.*;
|
||||
import com.maddyhome.idea.vim.helper.DocumentManager;
|
||||
import com.maddyhome.idea.vim.helper.EditorData;
|
||||
import com.maddyhome.idea.vim.helper.EditorDataContext;
|
||||
import com.maddyhome.idea.vim.helper.MacKeyRepeat;
|
||||
import com.maddyhome.idea.vim.option.Options;
|
||||
import com.maddyhome.idea.vim.ui.VimEmulationConfigurable;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.JDOMException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.HyperlinkEvent;
|
||||
import java.awt.*;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* This plugin attempts to emulate the key binding and general functionality of Vim and gVim. See the supplied
|
||||
@@ -77,24 +80,16 @@ import java.io.File;
|
||||
*/
|
||||
@State(
|
||||
name = "VimSettings",
|
||||
storages = {@Storage(
|
||||
id = "main",
|
||||
file = "$APP_CONFIG$/vim_settings.xml")})
|
||||
storages = {@Storage(file = "$APP_CONFIG$/vim_settings.xml")})
|
||||
public class VimPlugin implements ApplicationComponent, PersistentStateComponent<Element> {
|
||||
private static final String IDEAVIM_COMPONENT_NAME = "VimPlugin";
|
||||
private static final String IDEAVIM_PLUGIN_ID = "IdeaVIM";
|
||||
private static final String IDEAVIM_STATISTICS_TIMESTAMP_KEY = "ideavim.statistics.timestamp";
|
||||
public static final String IDEAVIM_NOTIFICATION_ID = "ideavim";
|
||||
public static final String IDEAVIM_STICKY_NOTIFICATION_ID = "ideavim-sticky";
|
||||
public static final String IDEAVIM_NOTIFICATION_TITLE = "IdeaVim";
|
||||
public static final int STATE_VERSION = 4;
|
||||
|
||||
private static final boolean BLOCK_CURSOR_VIM_VALUE = true;
|
||||
private static final boolean ANIMATED_SCROLLING_VIM_VALUE = false;
|
||||
private static final boolean REFRAIN_FROM_SCROLLING_VIM_VALUE = true;
|
||||
|
||||
private boolean isBlockCursor = false;
|
||||
private boolean isAnimatedScrolling = false;
|
||||
private boolean isRefrainFromScrolling = false;
|
||||
private boolean error = false;
|
||||
|
||||
private int previousStateVersion = 0;
|
||||
@@ -105,8 +100,6 @@ public class VimPlugin implements ApplicationComponent, PersistentStateComponent
|
||||
|
||||
private static final Logger LOG = Logger.getInstance(VimPlugin.class);
|
||||
|
||||
private final Application myApp;
|
||||
|
||||
@NotNull private final MotionGroup motion;
|
||||
@NotNull private final ChangeGroup change;
|
||||
@NotNull private final CopyGroup copy;
|
||||
@@ -119,11 +112,10 @@ public class VimPlugin implements ApplicationComponent, PersistentStateComponent
|
||||
@NotNull private final DigraphGroup digraph;
|
||||
@NotNull private final HistoryGroup history;
|
||||
@NotNull private final KeyGroup key;
|
||||
@NotNull private WindowGroup window;
|
||||
|
||||
public VimPlugin(final Application app) {
|
||||
myApp = app;
|
||||
@NotNull private final WindowGroup window;
|
||||
@NotNull private final EditorGroup editor;
|
||||
|
||||
public VimPlugin() {
|
||||
motion = new MotionGroup();
|
||||
change = new ChangeGroup();
|
||||
copy = new CopyGroup();
|
||||
@@ -137,6 +129,7 @@ public class VimPlugin implements ApplicationComponent, PersistentStateComponent
|
||||
history = new HistoryGroup();
|
||||
key = new KeyGroup();
|
||||
window = new WindowGroup();
|
||||
editor = new EditorGroup();
|
||||
|
||||
LOG.debug("VimPlugin ctr");
|
||||
}
|
||||
@@ -160,7 +153,7 @@ public class VimPlugin implements ApplicationComponent, PersistentStateComponent
|
||||
});
|
||||
|
||||
final TypedAction typedAction = EditorActionManager.getInstance().getTypedAction();
|
||||
EventFacade.getInstance().setupTypedActionHandler(new VimTypedActionHandler(typedAction.getHandler()));
|
||||
EventFacade.getInstance().setupTypedActionHandler(new VimTypedActionHandler(typedAction.getRawHandler()));
|
||||
|
||||
// Register vim actions in command mode
|
||||
RegisterActions.registerActions();
|
||||
@@ -205,6 +198,7 @@ public class VimPlugin implements ApplicationComponent, PersistentStateComponent
|
||||
search.saveData(element);
|
||||
history.saveData(element);
|
||||
key.saveData(element);
|
||||
editor.saveData(element);
|
||||
|
||||
return element;
|
||||
}
|
||||
@@ -230,6 +224,7 @@ public class VimPlugin implements ApplicationComponent, PersistentStateComponent
|
||||
search.readData(element);
|
||||
history.readData(element);
|
||||
key.readData(element);
|
||||
editor.readData(element);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -297,11 +292,27 @@ public class VimPlugin implements ApplicationComponent, PersistentStateComponent
|
||||
return getInstance().window;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static EditorGroup getEditor() {
|
||||
return getInstance().editor;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static PluginId getPluginId() {
|
||||
return PluginId.getId(IDEAVIM_PLUGIN_ID);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static String getVersion() {
|
||||
if (!ApplicationManager.getApplication().isInternal()) {
|
||||
final IdeaPluginDescriptor plugin = PluginManager.getPlugin(getPluginId());
|
||||
return plugin != null ? plugin.getVersion() : "SNAPSHOT";
|
||||
}
|
||||
else {
|
||||
return "INTERNAL";
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isEnabled() {
|
||||
return getInstance().enabled;
|
||||
}
|
||||
@@ -367,37 +378,34 @@ public class VimPlugin implements ApplicationComponent, PersistentStateComponent
|
||||
|
||||
private void turnOnPlugin() {
|
||||
KeyHandler.getInstance().fullReset(null);
|
||||
setCursors(BLOCK_CURSOR_VIM_VALUE);
|
||||
setAnimatedScrolling(ANIMATED_SCROLLING_VIM_VALUE);
|
||||
setRefrainFromScrolling(REFRAIN_FROM_SCROLLING_VIM_VALUE);
|
||||
|
||||
getEditor().turnOn();
|
||||
getMotion().turnOn();
|
||||
}
|
||||
|
||||
private void turnOffPlugin() {
|
||||
KeyHandler.getInstance().fullReset(null);
|
||||
setCursors(isBlockCursor);
|
||||
setAnimatedScrolling(isAnimatedScrolling);
|
||||
setRefrainFromScrolling(isRefrainFromScrolling);
|
||||
|
||||
getEditor().turnOff();
|
||||
getMotion().turnOff();
|
||||
}
|
||||
|
||||
private void updateState() {
|
||||
if (isEnabled() && !ApplicationManager.getApplication().isUnitTestMode()) {
|
||||
boolean requiresRestart = false;
|
||||
if (previousStateVersion < 2 && SystemInfo.isMac) {
|
||||
if (SystemInfo.isMac) {
|
||||
final MacKeyRepeat keyRepeat = MacKeyRepeat.getInstance();
|
||||
final Boolean enabled = keyRepeat.isEnabled();
|
||||
if (enabled == null || !enabled) {
|
||||
if (Messages.showYesNoDialog("Do you want to enable repeating keys in Mac OS X on press and hold " +
|
||||
"(requires restart)?\n\n" +
|
||||
final Boolean isKeyRepeat = editor.isKeyRepeat();
|
||||
if ((enabled == null || !enabled) && (isKeyRepeat == null || isKeyRepeat)) {
|
||||
if (Messages.showYesNoDialog("Do you want to enable repeating keys in Mac OS X on press and hold?\n\n" +
|
||||
"(You can do it manually by running 'defaults write -g " +
|
||||
"ApplePressAndHoldEnabled 0' in the console).", IDEAVIM_NOTIFICATION_TITLE,
|
||||
Messages.getQuestionIcon()
|
||||
) == Messages.YES) {
|
||||
Messages.getQuestionIcon()) == Messages.YES) {
|
||||
editor.setKeyRepeat(true);
|
||||
keyRepeat.setEnabled(true);
|
||||
requiresRestart = true;
|
||||
}
|
||||
else {
|
||||
editor.setKeyRepeat(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -440,10 +448,6 @@ public class VimPlugin implements ApplicationComponent, PersistentStateComponent
|
||||
"<code>source ~/.vimrc</code>",
|
||||
NotificationType.INFORMATION).notify(null);
|
||||
}
|
||||
if (requiresRestart) {
|
||||
final ApplicationEx app = ApplicationManagerEx.getApplicationEx();
|
||||
app.restart();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -453,43 +457,11 @@ public class VimPlugin implements ApplicationComponent, PersistentStateComponent
|
||||
private void setupListeners() {
|
||||
final EventFacade eventFacade = EventFacade.getInstance();
|
||||
|
||||
setupStatisticsReporter(eventFacade);
|
||||
|
||||
DocumentManager.getInstance().addDocumentListener(new MarkGroup.MarkUpdater());
|
||||
DocumentManager.getInstance().addDocumentListener(new SearchGroup.DocumentSearchListener());
|
||||
|
||||
eventFacade.addEditorFactoryListener(new EditorFactoryAdapter() {
|
||||
@Override
|
||||
public void editorCreated(@NotNull EditorFactoryEvent event) {
|
||||
final Editor editor = event.getEditor();
|
||||
isBlockCursor = editor.getSettings().isBlockCursor();
|
||||
isAnimatedScrolling = editor.getSettings().isAnimatedScrolling();
|
||||
isRefrainFromScrolling = editor.getSettings().isRefrainFromScrolling();
|
||||
EditorData.initializeEditor(editor);
|
||||
DocumentManager.getInstance().addListeners(editor.getDocument());
|
||||
key.registerRequiredShortcutKeys(editor);
|
||||
|
||||
if (VimPlugin.isEnabled()) {
|
||||
// Turn on insert mode if editor doesn't have any file
|
||||
if (!EditorData.isFileEditor(editor) && editor.getDocument().isWritable() &&
|
||||
!CommandState.inInsertMode(editor)) {
|
||||
KeyHandler.getInstance().handleKey(editor, KeyStroke.getKeyStroke('i'), new EditorDataContext(editor));
|
||||
}
|
||||
editor.getSettings().setBlockCursor(!CommandState.inInsertMode(editor));
|
||||
editor.getSettings().setAnimatedScrolling(ANIMATED_SCROLLING_VIM_VALUE);
|
||||
editor.getSettings().setRefrainFromScrolling(REFRAIN_FROM_SCROLLING_VIM_VALUE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editorReleased(@NotNull EditorFactoryEvent event) {
|
||||
final Editor editor = event.getEditor();
|
||||
EditorData.uninitializeEditor(editor);
|
||||
key.unregisterShortcutKeys(editor);
|
||||
editor.getSettings().setAnimatedScrolling(isAnimatedScrolling);
|
||||
editor.getSettings().setRefrainFromScrolling(isRefrainFromScrolling);
|
||||
DocumentManager.getInstance().removeListeners(editor.getDocument());
|
||||
}
|
||||
}, myApp);
|
||||
|
||||
eventFacade.addProjectManagerListener(new ProjectManagerAdapter() {
|
||||
@Override
|
||||
public void projectOpened(@NotNull final Project project) {
|
||||
@@ -500,26 +472,62 @@ public class VimPlugin implements ApplicationComponent, PersistentStateComponent
|
||||
});
|
||||
}
|
||||
|
||||
private void setCursors(boolean isBlock) {
|
||||
Editor[] editors = EditorFactory.getInstance().getAllEditors();
|
||||
for (Editor editor : editors) {
|
||||
// Vim plugin should be turned on in insert mode
|
||||
((EditorEx)editor).setInsertMode(true);
|
||||
editor.getSettings().setBlockCursor(isBlock);
|
||||
/**
|
||||
* Reports statistics about installed IdeaVim and enabled Vim emulation.
|
||||
*
|
||||
* See https://github.com/go-lang-plugin-org/go-lang-idea-plugin/commit/5182ab4a1d01ad37f6786268a2fe5e908575a217
|
||||
*/
|
||||
private void setupStatisticsReporter(@NotNull EventFacade eventFacade) {
|
||||
final Application application = ApplicationManager.getApplication();
|
||||
eventFacade.addEditorFactoryListener(new EditorFactoryAdapter() {
|
||||
@Override
|
||||
public void editorCreated(@NotNull EditorFactoryEvent event) {
|
||||
final PropertiesComponent propertiesComponent = PropertiesComponent.getInstance();
|
||||
final long lastUpdate = propertiesComponent.getOrInitLong(IDEAVIM_STATISTICS_TIMESTAMP_KEY, 0);
|
||||
final boolean outOfDate = lastUpdate == 0 ||
|
||||
System.currentTimeMillis() - lastUpdate > TimeUnit.DAYS.toMillis(1);
|
||||
if (outOfDate && isEnabled()) {
|
||||
application.executeOnPooledThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
final String buildNumber = ApplicationInfo.getInstance().getBuild().asString();
|
||||
final String pluginId = IDEAVIM_PLUGIN_ID;
|
||||
final String version = URLEncoder.encode(getVersion(), CharsetToolkit.UTF8);
|
||||
final String os = URLEncoder.encode(SystemInfo.OS_NAME + " " + SystemInfo.OS_VERSION,
|
||||
CharsetToolkit.UTF8);
|
||||
final String uid = UpdateChecker.getInstallationUID(PropertiesComponent.getInstance());
|
||||
final String url =
|
||||
"https://plugins.jetbrains.com/plugins/list" +
|
||||
"?pluginId=" + pluginId +
|
||||
"&build=" + buildNumber +
|
||||
"&pluginVersion=" + version +
|
||||
"&os=" + os +
|
||||
"&uuid=" + uid;
|
||||
PropertiesComponent.getInstance().setValue(IDEAVIM_STATISTICS_TIMESTAMP_KEY,
|
||||
String.valueOf(System.currentTimeMillis()));
|
||||
HttpRequests.request(url).connect(new HttpRequests.RequestProcessor<Object>() {
|
||||
@Override
|
||||
public Object process(@NotNull HttpRequests.Request request) throws IOException {
|
||||
LOG.info("Sending statistics: " + url);
|
||||
try {
|
||||
JDOMUtil.load(request.getInputStream());
|
||||
}
|
||||
catch (JDOMException e) {
|
||||
LOG.warn(e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private void setAnimatedScrolling(boolean isOn) {
|
||||
Editor[] editors = EditorFactory.getInstance().getAllEditors();
|
||||
for (Editor editor : editors) {
|
||||
editor.getSettings().setAnimatedScrolling(isOn);
|
||||
);
|
||||
}
|
||||
catch (IOException e) {
|
||||
LOG.warn(e);
|
||||
}
|
||||
}
|
||||
|
||||
private void setRefrainFromScrolling(boolean isOn) {
|
||||
Editor[] editors = EditorFactory.getInstance().getAllEditors();
|
||||
for (Editor editor : editors) {
|
||||
editor.getSettings().setRefrainFromScrolling(isOn);
|
||||
});
|
||||
}
|
||||
}
|
||||
}, application);
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -22,8 +22,11 @@ import com.intellij.codeInsight.lookup.Lookup;
|
||||
import com.intellij.codeInsight.lookup.LookupManager;
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.editor.actionSystem.ActionPlan;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actionSystem.TypedActionHandler;
|
||||
import com.intellij.openapi.editor.actionSystem.TypedActionHandlerEx;
|
||||
import com.maddyhome.idea.vim.helper.EditorDataContext;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -33,7 +36,7 @@ import javax.swing.*;
|
||||
*
|
||||
* IDE shortcut keys used by Vim commands are handled by {@link com.maddyhome.idea.vim.action.VimShortcutKeyAction}.
|
||||
*/
|
||||
public class VimTypedActionHandler implements TypedActionHandler {
|
||||
public class VimTypedActionHandler implements TypedActionHandlerEx {
|
||||
private static final Logger logger = Logger.getInstance(VimTypedActionHandler.class.getName());
|
||||
|
||||
private final TypedActionHandler origHandler;
|
||||
@@ -45,22 +48,29 @@ public class VimTypedActionHandler implements TypedActionHandler {
|
||||
handler.setOriginalHandler(origHandler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeExecute(@NotNull Editor editor, char charTyped, @NotNull DataContext context, @NotNull ActionPlan plan) {
|
||||
if (isEnabled(editor)) {
|
||||
handler.beforeHandleKey(editor, KeyStroke.getKeyStroke(charTyped), context, plan);
|
||||
}
|
||||
else {
|
||||
TypedActionHandler originalHandler = KeyHandler.getInstance().getOriginalHandler();
|
||||
if (originalHandler instanceof TypedActionHandlerEx) {
|
||||
((TypedActionHandlerEx)originalHandler).beforeExecute(editor, charTyped, context, plan);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(@NotNull final Editor editor, final char charTyped, @NotNull final DataContext context) {
|
||||
if (isEnabled(editor)) {
|
||||
// Run key handler outside of the key typed command for creating our own undoable commands
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
handler.handleKey(editor, KeyStroke.getKeyStroke(charTyped), context);
|
||||
handler.handleKey(editor, KeyStroke.getKeyStroke(charTyped), new EditorDataContext(editor));
|
||||
}
|
||||
catch (Throwable e) {
|
||||
logger.error(e);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
origHandler.execute(editor, charTyped, context);
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -29,6 +29,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
// TODO: Cannot find the corresponding Vim command. Remove it?
|
||||
public class ResetModeAction extends EditorAction {
|
||||
public ResetModeAction() {
|
||||
super(new EditorActionHandler() {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -63,7 +63,7 @@ public abstract class VimCommandAction extends EditorAction {
|
||||
*
|
||||
* These legacy flags will be refactored in future releases.
|
||||
*
|
||||
* @see {@link Command}.
|
||||
* @see com.maddyhome.idea.vim.command.Command
|
||||
*/
|
||||
public int getFlags() {
|
||||
return 0;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -24,7 +24,10 @@ import com.intellij.notification.Notification;
|
||||
import com.intellij.notification.NotificationListener;
|
||||
import com.intellij.notification.NotificationType;
|
||||
import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.ex.util.EditorUtil;
|
||||
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx;
|
||||
import com.intellij.openapi.keymap.KeymapUtil;
|
||||
import com.intellij.openapi.options.ShowSettingsUtil;
|
||||
import com.intellij.openapi.project.DumbAware;
|
||||
@@ -34,8 +37,10 @@ import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.action.change.insert.InsertExitModeAction;
|
||||
import com.maddyhome.idea.vim.command.CommandState;
|
||||
import com.maddyhome.idea.vim.helper.EditorData;
|
||||
import com.maddyhome.idea.vim.helper.EditorDataContext;
|
||||
import com.maddyhome.idea.vim.key.ShortcutOwner;
|
||||
import com.maddyhome.idea.vim.ui.VimEmulationConfigurable;
|
||||
import one.util.streamex.StreamEx;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -76,12 +81,16 @@ public class VimShortcutKeyAction extends AnAction implements DumbAware {
|
||||
.build();
|
||||
|
||||
@NotNull private static final Set<KeyStroke> NON_FILE_EDITOR_KEYS = ImmutableSet.<KeyStroke>builder()
|
||||
.addAll(getKeyStrokes(VK_ENTER, 0))
|
||||
.addAll(getKeyStrokes(VK_ESCAPE, 0))
|
||||
.addAll(getKeyStrokes(VK_TAB, 0))
|
||||
.addAll(getKeyStrokes(VK_UP, 0))
|
||||
.addAll(getKeyStrokes(VK_DOWN, 0))
|
||||
.build();
|
||||
|
||||
private static final Logger ourLogger = Logger.getInstance(VimShortcutKeyAction.class.getName());
|
||||
private static AnAction ourInstance = null;
|
||||
|
||||
@Override
|
||||
public void actionPerformed(@NotNull AnActionEvent e) {
|
||||
final Editor editor = getEditor(e);
|
||||
@@ -92,7 +101,12 @@ public class VimShortcutKeyAction extends AnAction implements DumbAware {
|
||||
notifyAboutShortcutConflict(keyStroke);
|
||||
}
|
||||
// Should we use InjectedLanguageUtil.getTopLevelEditor(editor) here, as we did in former EditorKeyHandler?
|
||||
KeyHandler.getInstance().handleKey(editor, keyStroke, e.getDataContext());
|
||||
try {
|
||||
KeyHandler.getInstance().handleKey(editor, keyStroke, new EditorDataContext(editor));
|
||||
}
|
||||
catch (Throwable throwable) {
|
||||
ourLogger.error(throwable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,7 +117,11 @@ public class VimShortcutKeyAction extends AnAction implements DumbAware {
|
||||
|
||||
@NotNull
|
||||
public static AnAction getInstance() {
|
||||
return ActionManager.getInstance().getAction(ACTION_ID);
|
||||
if (ourInstance == null) {
|
||||
final AnAction originalAction = ActionManager.getInstance().getAction(ACTION_ID);
|
||||
ourInstance = EmptyAction.wrap(originalAction);
|
||||
}
|
||||
return ourInstance;
|
||||
}
|
||||
|
||||
private void notifyAboutShortcutConflict(@NotNull final KeyStroke keyStroke) {
|
||||
@@ -143,9 +161,12 @@ public class VimShortcutKeyAction extends AnAction implements DumbAware {
|
||||
if (LookupManager.getActiveLookup(editor) != null) {
|
||||
return isExitInsertMode(keyStroke);
|
||||
}
|
||||
if (keyCode == VK_ESCAPE) {
|
||||
return isEnabledForEscape(editor);
|
||||
}
|
||||
if (CommandState.inInsertMode(editor)) {
|
||||
// XXX: <Enter> and <Tab> won't be recorded in macros
|
||||
if (keyCode == VK_ENTER || keyCode == VK_TAB) {
|
||||
// XXX: <Tab> won't be recorded in macros
|
||||
if (keyCode == VK_TAB) {
|
||||
return false;
|
||||
}
|
||||
// Debug watch, Python console, etc.
|
||||
@@ -175,6 +196,22 @@ public class VimShortcutKeyAction extends AnAction implements DumbAware {
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isEnabledForEscape(@NotNull Editor editor) {
|
||||
final CommandState.Mode mode = CommandState.getInstance(editor).getMode();
|
||||
return isPrimaryEditor(editor) || (EditorData.isFileEditor(editor) && mode != CommandState.Mode.COMMAND);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the editor is a primary editor in the main editing area.
|
||||
*/
|
||||
private boolean isPrimaryEditor(@NotNull Editor editor) {
|
||||
final Project project = editor.getProject();
|
||||
if (project == null) return false;
|
||||
final FileEditorManagerEx fileEditorManager = FileEditorManagerEx.getInstanceEx(project);
|
||||
return StreamEx.of(fileEditorManager.getAllEditors())
|
||||
.anyMatch(fileEditor -> editor.equals(EditorUtil.getEditorEx(fileEditor)));
|
||||
}
|
||||
|
||||
private boolean isExitInsertMode(@NotNull KeyStroke keyStroke) {
|
||||
for (List<KeyStroke> keys : InsertExitModeAction.getInstance().getKeyStrokesSet()) {
|
||||
// XXX: Currently we cannot handle <C-\><C-N> because of the importance of <C-N> for the IDE on Linux
|
||||
|
99
src/com/maddyhome/idea/vim/action/change/OperatorAction.java
Normal file
99
src/com/maddyhome/idea/vim/action/change/OperatorAction.java
Normal file
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.maddyhome.idea.vim.action.change;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.maddyhome.idea.vim.KeyHandler;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||
import com.maddyhome.idea.vim.command.*;
|
||||
import com.maddyhome.idea.vim.common.TextRange;
|
||||
import com.maddyhome.idea.vim.group.MotionGroup;
|
||||
import com.maddyhome.idea.vim.handler.EditorActionHandlerBase;
|
||||
import com.maddyhome.idea.vim.helper.MessageHelper;
|
||||
import com.maddyhome.idea.vim.key.OperatorFunction;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author vlan
|
||||
*/
|
||||
public class OperatorAction extends VimCommandAction {
|
||||
protected OperatorAction() {
|
||||
super(new EditorActionHandlerBase() {
|
||||
@Override
|
||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
||||
final OperatorFunction operatorFunction = VimPlugin.getKey().getOperatorFunction();
|
||||
if (operatorFunction != null) {
|
||||
final Argument argument = cmd.getArgument();
|
||||
if (argument != null) {
|
||||
final Command motion = argument.getMotion();
|
||||
if (motion != null) {
|
||||
final TextRange range = MotionGroup
|
||||
.getMotionRange(editor, editor.getCaretModel().getPrimaryCaret(), context, cmd.getCount(),
|
||||
cmd.getRawCount(), argument, true);
|
||||
if (range != null) {
|
||||
VimPlugin.getMark().setChangeMarks(editor, range);
|
||||
final SelectionType selectionType = SelectionType.fromCommandFlags(motion.getFlags());
|
||||
KeyHandler.getInstance().reset(editor);
|
||||
return operatorFunction.apply(editor, context, selectionType);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
VimPlugin.showMessage(MessageHelper.message("E774"));
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<MappingMode> getMappingModes() {
|
||||
return MappingMode.N;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||
return parseKeysSet("g@");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Command.Type getType() {
|
||||
return Command.Type.OTHER_SELF_SYNCHRONIZED;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Argument.Type getArgumentType() {
|
||||
return Argument.Type.MOTION;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFlags() {
|
||||
return Command.FLAG_OP_PEND;
|
||||
}
|
||||
}
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -41,6 +41,7 @@ public class RepeatChangeAction extends EditorAction {
|
||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command command) {
|
||||
CommandState state = CommandState.getInstance(editor);
|
||||
Command cmd = state.getLastChangeCommand();
|
||||
|
||||
if (cmd != null) {
|
||||
if (command.getRawCount() > 0) {
|
||||
cmd.setCount(command.getCount());
|
||||
@@ -53,6 +54,9 @@ public class RepeatChangeAction extends EditorAction {
|
||||
}
|
||||
}
|
||||
Command save = state.getCommand();
|
||||
int lastFTCmd = VimPlugin.getMotion().getLastFTCmd();
|
||||
char lastFTChar = VimPlugin.getMotion().getLastFTChar();
|
||||
|
||||
state.setCommand(cmd);
|
||||
state.pushState(CommandState.Mode.REPEAT, CommandState.SubMode.NONE, MappingMode.NORMAL);
|
||||
char reg = VimPlugin.getRegister().getCurrentRegister();
|
||||
@@ -67,6 +71,7 @@ public class RepeatChangeAction extends EditorAction {
|
||||
if (save != null) {
|
||||
state.setCommand(save);
|
||||
}
|
||||
VimPlugin.getMotion().setLastFTCmd(lastFTCmd, lastFTChar);
|
||||
state.saveLastChangeCommand(cmd);
|
||||
VimPlugin.getRegister().selectRegister(reg);
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,12 +19,14 @@
|
||||
package com.maddyhome.idea.vim.action.change.change;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||
import com.maddyhome.idea.vim.command.Command;
|
||||
import com.maddyhome.idea.vim.command.MappingMode;
|
||||
import com.maddyhome.idea.vim.common.TextRange;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -37,13 +39,11 @@ import java.util.Set;
|
||||
*/
|
||||
public class AutoIndentLinesVisualAction extends VimCommandAction {
|
||||
public AutoIndentLinesVisualAction() {
|
||||
super(new VisualOperatorActionHandler() {
|
||||
super(new VisualOperatorActionHandler(true, CaretOrder.DECREASING_OFFSET) {
|
||||
@Override
|
||||
protected boolean execute(@NotNull Editor editor,
|
||||
@NotNull DataContext context,
|
||||
@NotNull Command cmd,
|
||||
@NotNull TextRange range) {
|
||||
VimPlugin.getChange().autoIndentLines(context);
|
||||
protected boolean execute(@NotNull Editor editor, @NotNull Caret caret, @NotNull DataContext context,
|
||||
@NotNull Command cmd, @NotNull TextRange range) {
|
||||
VimPlugin.getChange().autoIndentRange(editor, caret, context, range);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,10 +19,12 @@
|
||||
package com.maddyhome.idea.vim.action.change.change;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.command.Argument;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||
import com.maddyhome.idea.vim.helper.CharacterHelper;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -36,10 +38,16 @@ public class ChangeCaseLowerMotionAction extends EditorAction {
|
||||
}
|
||||
|
||||
private static class Handler extends ChangeEditorActionHandler {
|
||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
||||
public Handler() {
|
||||
super(true, CaretOrder.DECREASING_OFFSET);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(@NotNull Editor editor, @NotNull Caret caret, @NotNull DataContext context, int count,
|
||||
int rawCount, @Nullable Argument argument) {
|
||||
return argument != null &&
|
||||
VimPlugin.getChange().changeCaseMotion(editor, context, count, rawCount, CharacterHelper.CASE_LOWER,
|
||||
argument);
|
||||
VimPlugin.getChange()
|
||||
.changeCaseMotion(editor, caret, context, count, rawCount, CharacterHelper.CASE_LOWER, argument);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,6 +19,7 @@
|
||||
package com.maddyhome.idea.vim.action.change.change;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
@@ -26,6 +27,7 @@ import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||
import com.maddyhome.idea.vim.command.Command;
|
||||
import com.maddyhome.idea.vim.command.MappingMode;
|
||||
import com.maddyhome.idea.vim.common.TextRange;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
||||
import com.maddyhome.idea.vim.helper.CharacterHelper;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -39,11 +41,12 @@ import java.util.Set;
|
||||
*/
|
||||
public class ChangeCaseLowerVisualAction extends VimCommandAction {
|
||||
public ChangeCaseLowerVisualAction() {
|
||||
super(new VisualOperatorActionHandler() {
|
||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
|
||||
@NotNull TextRange range) {
|
||||
super(new VisualOperatorActionHandler(true, CaretOrder.DECREASING_OFFSET) {
|
||||
@Override
|
||||
protected boolean execute(@NotNull Editor editor, @NotNull Caret caret, @NotNull DataContext context,
|
||||
@NotNull Command cmd, @NotNull TextRange range) {
|
||||
final Editor topLevelEditor = InjectedLanguageUtil.getTopLevelEditor(editor);
|
||||
return VimPlugin.getChange().changeCaseRange(topLevelEditor, range, CharacterHelper.CASE_LOWER);
|
||||
return VimPlugin.getChange().changeCaseRange(topLevelEditor, caret, range, CharacterHelper.CASE_LOWER);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,10 +19,12 @@
|
||||
package com.maddyhome.idea.vim.action.change.change;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.command.Argument;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -35,8 +37,14 @@ public class ChangeCaseToggleCharacterAction extends EditorAction {
|
||||
}
|
||||
|
||||
private static class Handler extends ChangeEditorActionHandler {
|
||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
||||
return VimPlugin.getChange().changeCaseToggleCharacter(editor, count);
|
||||
public Handler() {
|
||||
super(true, CaretOrder.DECREASING_OFFSET);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(@NotNull Editor editor, @NotNull Caret caret, @NotNull DataContext context, int count,
|
||||
int rawCount, @Nullable Argument argument) {
|
||||
return VimPlugin.getChange().changeCaseToggleCharacter(editor, caret, count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,10 +19,12 @@
|
||||
package com.maddyhome.idea.vim.action.change.change;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.command.Argument;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||
import com.maddyhome.idea.vim.helper.CharacterHelper;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -36,9 +38,16 @@ public class ChangeCaseToggleMotionAction extends EditorAction {
|
||||
}
|
||||
|
||||
private static class Handler extends ChangeEditorActionHandler {
|
||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
||||
return argument != null && VimPlugin.getChange().changeCaseMotion(editor, context, count, rawCount,
|
||||
CharacterHelper.CASE_TOGGLE, argument);
|
||||
public Handler() {
|
||||
super(true, CaretOrder.DECREASING_OFFSET);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(@NotNull Editor editor, @NotNull Caret caret, @NotNull DataContext context, int count,
|
||||
int rawCount, @Nullable Argument argument) {
|
||||
return argument != null &&
|
||||
VimPlugin.getChange()
|
||||
.changeCaseMotion(editor, caret, context, count, rawCount, CharacterHelper.CASE_TOGGLE, argument);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,12 +19,14 @@
|
||||
package com.maddyhome.idea.vim.action.change.change;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||
import com.maddyhome.idea.vim.command.Command;
|
||||
import com.maddyhome.idea.vim.command.MappingMode;
|
||||
import com.maddyhome.idea.vim.common.TextRange;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
||||
import com.maddyhome.idea.vim.helper.CharacterHelper;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -38,10 +40,11 @@ import java.util.Set;
|
||||
*/
|
||||
public class ChangeCaseToggleVisualAction extends VimCommandAction {
|
||||
public ChangeCaseToggleVisualAction() {
|
||||
super(new VisualOperatorActionHandler() {
|
||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
|
||||
@NotNull TextRange range) {
|
||||
return VimPlugin.getChange().changeCaseRange(editor, range, CharacterHelper.CASE_TOGGLE);
|
||||
super(new VisualOperatorActionHandler(true, CaretOrder.DECREASING_OFFSET) {
|
||||
@Override
|
||||
protected boolean execute(@NotNull Editor editor, @NotNull Caret caret, @NotNull DataContext context,
|
||||
@NotNull Command cmd, @NotNull TextRange range) {
|
||||
return VimPlugin.getChange().changeCaseRange(editor, caret, range, CharacterHelper.CASE_TOGGLE);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,10 +19,12 @@
|
||||
package com.maddyhome.idea.vim.action.change.change;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.command.Argument;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||
import com.maddyhome.idea.vim.helper.CharacterHelper;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -36,9 +38,15 @@ public class ChangeCaseUpperMotionAction extends EditorAction {
|
||||
}
|
||||
|
||||
private static class Handler extends ChangeEditorActionHandler {
|
||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
||||
return argument != null && VimPlugin.getChange().changeCaseMotion(editor, context, count, rawCount,
|
||||
CharacterHelper.CASE_UPPER, argument);
|
||||
public Handler() {
|
||||
super(true, CaretOrder.DECREASING_OFFSET);
|
||||
}
|
||||
|
||||
public boolean execute(@NotNull Editor editor, @NotNull Caret caret, @NotNull DataContext context, int count,
|
||||
int rawCount, @Nullable Argument argument) {
|
||||
return argument != null &&
|
||||
VimPlugin.getChange()
|
||||
.changeCaseMotion(editor, caret, context, count, rawCount, CharacterHelper.CASE_UPPER, argument);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,12 +19,14 @@
|
||||
package com.maddyhome.idea.vim.action.change.change;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||
import com.maddyhome.idea.vim.command.Command;
|
||||
import com.maddyhome.idea.vim.command.MappingMode;
|
||||
import com.maddyhome.idea.vim.common.TextRange;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
||||
import com.maddyhome.idea.vim.helper.CharacterHelper;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -38,10 +40,10 @@ import java.util.Set;
|
||||
*/
|
||||
public class ChangeCaseUpperVisualAction extends VimCommandAction {
|
||||
public ChangeCaseUpperVisualAction() {
|
||||
super(new VisualOperatorActionHandler() {
|
||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
|
||||
@NotNull TextRange range) {
|
||||
return VimPlugin.getChange().changeCaseRange(editor, range, CharacterHelper.CASE_UPPER);
|
||||
super(new VisualOperatorActionHandler(true, CaretOrder.DECREASING_OFFSET) {
|
||||
protected boolean execute(@NotNull Editor editor, @NotNull Caret caret, @NotNull DataContext context,
|
||||
@NotNull Command cmd, @NotNull TextRange range) {
|
||||
return VimPlugin.getChange().changeCaseRange(editor, caret, range, CharacterHelper.CASE_UPPER);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,10 +19,12 @@
|
||||
package com.maddyhome.idea.vim.action.change.change;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.command.Argument;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -35,8 +37,14 @@ public class ChangeCharacterAction extends EditorAction {
|
||||
}
|
||||
|
||||
private static class Handler extends ChangeEditorActionHandler {
|
||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
||||
return argument != null && VimPlugin.getChange().changeCharacter(editor, count, argument.getCharacter());
|
||||
public Handler() {
|
||||
super(true, CaretOrder.DECREASING_OFFSET);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(@NotNull Editor editor, @NotNull Caret caret, @NotNull DataContext context, int count,
|
||||
int rawCount, @Nullable Argument argument) {
|
||||
return argument != null && VimPlugin.getChange().changeCharacter(editor, caret, count, argument.getCharacter());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,10 +19,12 @@
|
||||
package com.maddyhome.idea.vim.action.change.change;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.command.Argument;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -35,8 +37,14 @@ public class ChangeCharactersAction extends EditorAction {
|
||||
}
|
||||
|
||||
private static class Handler extends ChangeEditorActionHandler {
|
||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
||||
return VimPlugin.getChange().changeCharacters(editor, context, count);
|
||||
public Handler() {
|
||||
super(true, CaretOrder.DECREASING_OFFSET);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(@NotNull Editor editor, @NotNull Caret caret, @NotNull DataContext context, int count,
|
||||
int rawCount, @Nullable Argument argument) {
|
||||
return VimPlugin.getChange().changeCharacters(editor, caret, count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,10 +19,12 @@
|
||||
package com.maddyhome.idea.vim.action.change.change;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.command.Argument;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -35,8 +37,14 @@ public class ChangeEndOfLineAction extends EditorAction {
|
||||
}
|
||||
|
||||
private static class Handler extends ChangeEditorActionHandler {
|
||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
||||
return VimPlugin.getChange().changeEndOfLine(editor, context, count);
|
||||
public Handler() {
|
||||
super(true, CaretOrder.DECREASING_OFFSET);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(@NotNull Editor editor, @NotNull Caret caret, @NotNull DataContext context, int count,
|
||||
int rawCount, @Nullable Argument argument) {
|
||||
return VimPlugin.getChange().changeEndOfLine(editor, caret, count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -38,8 +38,8 @@ public class ChangeLastGlobalSearchReplaceAction extends EditorAction {
|
||||
|
||||
private static class Handler extends ChangeEditorActionHandler {
|
||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
||||
LineRange range = new LineRange(0, EditorHelper.getLineCount(editor) - 1);
|
||||
return VimPlugin.getSearch().searchAndReplace(editor, range, "s", "//~/&");
|
||||
final LineRange range = new LineRange(0, EditorHelper.getLineCount(editor) - 1);
|
||||
return VimPlugin.getSearch().searchAndReplace(editor, editor.getCaretModel().getPrimaryCaret(), range, "s", "//~/&");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,6 +19,7 @@
|
||||
package com.maddyhome.idea.vim.action.change.change;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
@@ -36,10 +37,17 @@ public class ChangeLastSearchReplaceAction extends EditorAction {
|
||||
}
|
||||
|
||||
private static class Handler extends ChangeEditorActionHandler {
|
||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
||||
int line = editor.getCaretModel().getLogicalPosition().line;
|
||||
LineRange range = new LineRange(line, line);
|
||||
return VimPlugin.getSearch().searchAndReplace(editor, range, "s", "//~/");
|
||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount,
|
||||
@Nullable Argument argument) {
|
||||
boolean result = true;
|
||||
for (Caret caret : editor.getCaretModel().getAllCarets()) {
|
||||
final int line = caret.getLogicalPosition().line;
|
||||
if (!VimPlugin.getSearch().searchAndReplace(editor, caret, new LineRange(line, line), "s", "//~/")) {
|
||||
result = false;
|
||||
}
|
||||
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,10 +19,12 @@
|
||||
package com.maddyhome.idea.vim.action.change.change;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.command.Argument;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -31,12 +33,16 @@ import org.jetbrains.annotations.Nullable;
|
||||
*/
|
||||
public class ChangeLineAction extends EditorAction {
|
||||
public ChangeLineAction() {
|
||||
super(new Handler());
|
||||
}
|
||||
|
||||
private static class Handler extends ChangeEditorActionHandler {
|
||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
||||
return VimPlugin.getChange().changeLine(editor, context, count);
|
||||
super(new ChangeEditorActionHandler(true, CaretOrder.DECREASING_OFFSET) {
|
||||
@Override
|
||||
public boolean execute(@NotNull Editor editor,
|
||||
@NotNull Caret caret,
|
||||
@NotNull DataContext context,
|
||||
int count,
|
||||
int rawCount,
|
||||
@Nullable Argument argument) {
|
||||
return VimPlugin.getChange().changeLine(editor, caret, count);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,10 +19,12 @@
|
||||
package com.maddyhome.idea.vim.action.change.change;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.command.Argument;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -35,8 +37,14 @@ public class ChangeMotionAction extends EditorAction {
|
||||
}
|
||||
|
||||
private static class Handler extends ChangeEditorActionHandler {
|
||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
||||
return argument != null && VimPlugin.getChange().changeMotion(editor, context, count, rawCount, argument);
|
||||
public Handler() {
|
||||
super(true, CaretOrder.DECREASING_OFFSET);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(@NotNull Editor editor, @NotNull Caret caret, @NotNull DataContext context, int count,
|
||||
int rawCount, @Nullable Argument argument) {
|
||||
return argument != null && VimPlugin.getChange().changeMotion(editor, caret, context, count, rawCount, argument);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,10 +19,12 @@
|
||||
package com.maddyhome.idea.vim.action.change.change;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.command.Argument;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -35,8 +37,14 @@ public class ChangeNumberDecAction extends EditorAction {
|
||||
}
|
||||
|
||||
private static class Handler extends ChangeEditorActionHandler {
|
||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
||||
return VimPlugin.getChange().changeNumber(editor, -count);
|
||||
public Handler() {
|
||||
super(true, CaretOrder.DECREASING_OFFSET);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(@NotNull Editor editor, @NotNull Caret caret, @NotNull DataContext context, int count,
|
||||
int rawCount, @Nullable Argument argument) {
|
||||
return VimPlugin.getChange().changeNumber(editor, caret, -count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,10 +19,12 @@
|
||||
package com.maddyhome.idea.vim.action.change.change;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.command.Argument;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -35,8 +37,14 @@ public class ChangeNumberIncAction extends EditorAction {
|
||||
}
|
||||
|
||||
private static class Handler extends ChangeEditorActionHandler {
|
||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
||||
return VimPlugin.getChange().changeNumber(editor, count);
|
||||
public Handler() {
|
||||
super(true, CaretOrder.DECREASING_OFFSET);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(@NotNull Editor editor, @NotNull Caret caret, @NotNull DataContext context, int count,
|
||||
int rawCount, @Nullable Argument argument) {
|
||||
return VimPlugin.getChange().changeNumber(editor, caret, count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -31,12 +31,16 @@ import org.jetbrains.annotations.Nullable;
|
||||
*/
|
||||
public class ChangeReplaceAction extends EditorAction {
|
||||
public ChangeReplaceAction() {
|
||||
super(new Handler());
|
||||
}
|
||||
|
||||
private static class Handler extends ChangeEditorActionHandler {
|
||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
||||
return VimPlugin.getChange().changeReplace(editor, context);
|
||||
super(new ChangeEditorActionHandler() {
|
||||
@Override
|
||||
public boolean execute(@NotNull Editor editor,
|
||||
@NotNull DataContext context,
|
||||
int count,
|
||||
int rawCount,
|
||||
@Nullable Argument argument) {
|
||||
VimPlugin.getChange().changeReplace(editor, context);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,6 +19,7 @@
|
||||
package com.maddyhome.idea.vim.action.change.change;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||
@@ -26,7 +27,9 @@ import com.maddyhome.idea.vim.command.Command;
|
||||
import com.maddyhome.idea.vim.command.MappingMode;
|
||||
import com.maddyhome.idea.vim.command.SelectionType;
|
||||
import com.maddyhome.idea.vim.common.TextRange;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
||||
import com.maddyhome.idea.vim.helper.EditorData;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -38,11 +41,14 @@ import java.util.Set;
|
||||
*/
|
||||
public class ChangeVisualAction extends VimCommandAction {
|
||||
public ChangeVisualAction() {
|
||||
super(new VisualOperatorActionHandler() {
|
||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
|
||||
@NotNull TextRange range) {
|
||||
final SelectionType type = range.isMultiple() ? SelectionType.BLOCK_WISE : SelectionType.CHARACTER_WISE;
|
||||
return VimPlugin.getChange().changeRange(editor, context, range, type);
|
||||
super(new VisualOperatorActionHandler(true, CaretOrder.DECREASING_OFFSET) {
|
||||
@Override
|
||||
protected boolean execute(@NotNull Editor editor, @NotNull Caret caret, @NotNull DataContext context,
|
||||
@NotNull Command cmd, @NotNull TextRange range) {
|
||||
final SelectionType type = EditorData.wasVisualBlockMode(editor) && range.isMultiple()
|
||||
? SelectionType.BLOCK_WISE
|
||||
: SelectionType.CHARACTER_WISE;
|
||||
return VimPlugin.getChange().changeRange(editor, caret, range, type);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,6 +19,7 @@
|
||||
package com.maddyhome.idea.vim.action.change.change;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||
@@ -26,6 +27,7 @@ import com.maddyhome.idea.vim.command.Command;
|
||||
import com.maddyhome.idea.vim.command.MappingMode;
|
||||
import com.maddyhome.idea.vim.command.SelectionType;
|
||||
import com.maddyhome.idea.vim.common.TextRange;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
||||
import com.maddyhome.idea.vim.helper.EditorHelper;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -39,12 +41,13 @@ import java.util.Set;
|
||||
*/
|
||||
public class ChangeVisualLinesAction extends VimCommandAction {
|
||||
public ChangeVisualLinesAction() {
|
||||
super(new VisualOperatorActionHandler() {
|
||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
|
||||
@NotNull TextRange range) {
|
||||
super(new VisualOperatorActionHandler(true, CaretOrder.DECREASING_OFFSET) {
|
||||
@Override
|
||||
protected boolean execute(@NotNull Editor editor, @NotNull Caret caret, @NotNull DataContext context,
|
||||
@NotNull Command cmd, @NotNull TextRange range) {
|
||||
final TextRange lineRange = new TextRange(EditorHelper.getLineStartForOffset(editor, range.getStartOffset()),
|
||||
EditorHelper.getLineEndForOffset(editor, range.getEndOffset()) + 1);
|
||||
return VimPlugin.getChange().changeRange(editor, context, lineRange, SelectionType.LINE_WISE);
|
||||
return VimPlugin.getChange().changeRange(editor, caret, lineRange, SelectionType.LINE_WISE);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,6 +19,7 @@
|
||||
package com.maddyhome.idea.vim.action.change.change;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||
@@ -26,7 +27,9 @@ import com.maddyhome.idea.vim.command.Command;
|
||||
import com.maddyhome.idea.vim.command.MappingMode;
|
||||
import com.maddyhome.idea.vim.command.SelectionType;
|
||||
import com.maddyhome.idea.vim.common.TextRange;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
||||
import com.maddyhome.idea.vim.helper.EditorData;
|
||||
import com.maddyhome.idea.vim.helper.EditorHelper;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -39,10 +42,10 @@ import java.util.Set;
|
||||
*/
|
||||
public class ChangeVisualLinesEndAction extends VimCommandAction {
|
||||
public ChangeVisualLinesEndAction() {
|
||||
super(new VisualOperatorActionHandler() {
|
||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
|
||||
@NotNull TextRange range) {
|
||||
if (range.isMultiple()) {
|
||||
super(new VisualOperatorActionHandler(true, CaretOrder.DECREASING_OFFSET) {
|
||||
protected boolean execute(@NotNull Editor editor, @NotNull Caret caret, @NotNull DataContext context,
|
||||
@NotNull Command cmd, @NotNull TextRange range) {
|
||||
if (EditorData.wasVisualBlockMode(editor) && range.isMultiple()) {
|
||||
final int[] starts = range.getStartOffsets();
|
||||
final int[] ends = range.getEndOffsets();
|
||||
for (int i = 0; i < starts.length; i++) {
|
||||
@@ -51,12 +54,12 @@ public class ChangeVisualLinesEndAction extends VimCommandAction {
|
||||
}
|
||||
}
|
||||
final TextRange blockRange = new TextRange(starts, ends);
|
||||
return VimPlugin.getChange().changeRange(editor, context, blockRange, SelectionType.BLOCK_WISE);
|
||||
return VimPlugin.getChange().changeRange(editor, caret, blockRange, SelectionType.BLOCK_WISE);
|
||||
}
|
||||
else {
|
||||
final TextRange lineRange = new TextRange(EditorHelper.getLineStartForOffset(editor, range.getStartOffset()),
|
||||
EditorHelper.getLineEndForOffset(editor, range.getEndOffset()) + 1);
|
||||
return VimPlugin.getChange().changeRange(editor, context, lineRange, SelectionType.LINE_WISE);
|
||||
return VimPlugin.getChange().changeRange(editor, caret, lineRange, SelectionType.LINE_WISE);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -43,7 +43,9 @@ public class FilterMotionAction extends EditorAction {
|
||||
if (argument == null) {
|
||||
return false;
|
||||
}
|
||||
TextRange range = MotionGroup.getMotionRange(editor, context, cmd.getCount(), cmd.getRawCount(), argument, false);
|
||||
TextRange range = MotionGroup
|
||||
.getMotionRange(editor, editor.getCaretModel().getPrimaryCaret(), context, cmd.getCount(), cmd.getRawCount(),
|
||||
argument, false);
|
||||
if (range == null) {
|
||||
return false;
|
||||
}
|
||||
@@ -52,7 +54,7 @@ public class FilterMotionAction extends EditorAction {
|
||||
LogicalPosition start = editor.offsetToLogicalPosition(range.getStartOffset());
|
||||
LogicalPosition end = editor.offsetToLogicalPosition(range.getEndOffset());
|
||||
if (current.line != start.line) {
|
||||
MotionGroup.moveCaret(editor, range.getStartOffset());
|
||||
MotionGroup.moveCaret(editor, editor.getCaretModel().getPrimaryCaret(), range.getStartOffset());
|
||||
}
|
||||
|
||||
int count;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,10 +19,12 @@
|
||||
package com.maddyhome.idea.vim.action.change.delete;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.command.Argument;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -35,8 +37,14 @@ public class DeleteCharacterAction extends EditorAction {
|
||||
}
|
||||
|
||||
private static class Handler extends ChangeEditorActionHandler {
|
||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
||||
return VimPlugin.getChange().deleteCharacter(editor, 1, false);
|
||||
public Handler() {
|
||||
super(true, CaretOrder.DECREASING_OFFSET);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(@NotNull Editor editor, @NotNull Caret caret, @NotNull DataContext context, int count,
|
||||
int rawCount, @Nullable Argument argument) {
|
||||
return VimPlugin.getChange().deleteCharacter(editor, caret, 1, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,10 +19,12 @@
|
||||
package com.maddyhome.idea.vim.action.change.delete;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.command.Argument;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -35,8 +37,14 @@ public class DeleteCharacterLeftAction extends EditorAction {
|
||||
}
|
||||
|
||||
private static class Handler extends ChangeEditorActionHandler {
|
||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
||||
return VimPlugin.getChange().deleteCharacter(editor, -count, false);
|
||||
public Handler() {
|
||||
super(true, CaretOrder.INCREASING_OFFSET);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(@NotNull Editor editor, @NotNull Caret caret, @NotNull DataContext context, int count,
|
||||
int rawCount, @Nullable Argument argument) {
|
||||
return VimPlugin.getChange().deleteCharacter(editor, caret, -count, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,10 +19,12 @@
|
||||
package com.maddyhome.idea.vim.action.change.delete;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.command.Argument;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -35,8 +37,14 @@ public class DeleteCharacterRightAction extends EditorAction {
|
||||
}
|
||||
|
||||
private static class Handler extends ChangeEditorActionHandler {
|
||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
||||
return VimPlugin.getChange().deleteCharacter(editor, count, false);
|
||||
public Handler() {
|
||||
super(true, CaretOrder.DECREASING_OFFSET);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(@NotNull Editor editor, @NotNull Caret caret, @NotNull DataContext context, int count,
|
||||
int rawCount, @Nullable Argument argument) {
|
||||
return VimPlugin.getChange().deleteCharacter(editor, caret, count, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,10 +19,12 @@
|
||||
package com.maddyhome.idea.vim.action.change.delete;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.command.Argument;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -35,8 +37,14 @@ public class DeleteEndOfLineAction extends EditorAction {
|
||||
}
|
||||
|
||||
private static class Handler extends ChangeEditorActionHandler {
|
||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
||||
return VimPlugin.getChange().deleteEndOfLine(editor, count);
|
||||
public Handler() {
|
||||
super(true, CaretOrder.DECREASING_OFFSET);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(@NotNull Editor editor, @NotNull Caret caret, @NotNull DataContext context, int count,
|
||||
int rawCount, @Nullable Argument argument) {
|
||||
return VimPlugin.getChange().deleteEndOfLine(editor, caret, count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,10 +19,12 @@
|
||||
package com.maddyhome.idea.vim.action.change.delete;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.command.Argument;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -35,12 +37,18 @@ public class DeleteJoinLinesAction extends EditorAction {
|
||||
}
|
||||
|
||||
private static class Handler extends ChangeEditorActionHandler {
|
||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
||||
public Handler() {
|
||||
super(true, CaretOrder.DECREASING_OFFSET);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(@NotNull Editor editor, @NotNull Caret caret, @NotNull DataContext context, int count,
|
||||
int rawCount, @Nullable Argument argument) {
|
||||
if (editor.isOneLineMode()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return VimPlugin.getChange().deleteJoinLines(editor, count, false);
|
||||
return VimPlugin.getChange().deleteJoinLines(editor, caret, count, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,10 +19,12 @@
|
||||
package com.maddyhome.idea.vim.action.change.delete;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.command.Argument;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -35,12 +37,18 @@ public class DeleteJoinLinesSpacesAction extends EditorAction {
|
||||
}
|
||||
|
||||
private static class Handler extends ChangeEditorActionHandler {
|
||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
||||
public Handler() {
|
||||
super(true, CaretOrder.DECREASING_OFFSET);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(@NotNull Editor editor, @NotNull Caret caret, @NotNull DataContext context, int count,
|
||||
int rawCount, @Nullable Argument argument) {
|
||||
if (editor.isOneLineMode()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return VimPlugin.getChange().deleteJoinLines(editor, count, true);
|
||||
return VimPlugin.getChange().deleteJoinLines(editor, caret, count, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,13 +19,16 @@
|
||||
package com.maddyhome.idea.vim.action.change.delete;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||
import com.maddyhome.idea.vim.command.Command;
|
||||
import com.maddyhome.idea.vim.command.MappingMode;
|
||||
import com.maddyhome.idea.vim.common.TextRange;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
||||
import com.maddyhome.idea.vim.helper.EditorData;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -37,10 +40,11 @@ import java.util.Set;
|
||||
*/
|
||||
public class DeleteJoinVisualLinesAction extends VimCommandAction {
|
||||
public DeleteJoinVisualLinesAction() {
|
||||
super(new VisualOperatorActionHandler() {
|
||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
|
||||
@NotNull TextRange range) {
|
||||
return !editor.isOneLineMode() && VimPlugin.getChange().deleteJoinRange(editor, range, false);
|
||||
super(new VisualOperatorActionHandler(true, CaretOrder.DECREASING_OFFSET) {
|
||||
@Override
|
||||
protected boolean execute(@NotNull Editor editor, @NotNull Caret caret, @NotNull DataContext context,
|
||||
@NotNull Command cmd, @NotNull TextRange range) {
|
||||
return !editor.isOneLineMode() && VimPlugin.getChange().deleteJoinRange(editor, caret, range, false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,13 +19,16 @@
|
||||
package com.maddyhome.idea.vim.action.change.delete;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||
import com.maddyhome.idea.vim.command.Command;
|
||||
import com.maddyhome.idea.vim.command.MappingMode;
|
||||
import com.maddyhome.idea.vim.common.TextRange;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
||||
import com.maddyhome.idea.vim.helper.EditorData;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -37,10 +40,11 @@ import java.util.Set;
|
||||
*/
|
||||
public class DeleteJoinVisualLinesSpacesAction extends VimCommandAction {
|
||||
public DeleteJoinVisualLinesSpacesAction() {
|
||||
super(new VisualOperatorActionHandler() {
|
||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
|
||||
@NotNull TextRange range) {
|
||||
return !editor.isOneLineMode() && VimPlugin.getChange().deleteJoinRange(editor, range, true);
|
||||
super(new VisualOperatorActionHandler(true, CaretOrder.DECREASING_OFFSET) {
|
||||
@Override
|
||||
protected boolean execute(@NotNull Editor editor, @NotNull Caret caret, @NotNull DataContext context,
|
||||
@NotNull Command cmd, @NotNull TextRange range) {
|
||||
return !editor.isOneLineMode() && VimPlugin.getChange().deleteJoinRange(editor, caret, range, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,10 +19,12 @@
|
||||
package com.maddyhome.idea.vim.action.change.delete;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.command.Argument;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -31,12 +33,16 @@ import org.jetbrains.annotations.Nullable;
|
||||
*/
|
||||
public class DeleteLineAction extends EditorAction {
|
||||
public DeleteLineAction() {
|
||||
super(new Handler());
|
||||
}
|
||||
|
||||
private static class Handler extends ChangeEditorActionHandler {
|
||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
||||
return VimPlugin.getChange().deleteLine(editor, count);
|
||||
super(new ChangeEditorActionHandler(true, CaretOrder.DECREASING_OFFSET) {
|
||||
@Override
|
||||
public boolean execute(@NotNull Editor editor,
|
||||
@NotNull Caret caret,
|
||||
@NotNull DataContext context,
|
||||
int count,
|
||||
int rawCount,
|
||||
@Nullable Argument argument) {
|
||||
return VimPlugin.getChange().deleteLine(editor, caret, count);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,10 +19,12 @@
|
||||
package com.maddyhome.idea.vim.action.change.delete;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.command.Argument;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -35,8 +37,15 @@ public class DeleteMotionAction extends EditorAction {
|
||||
}
|
||||
|
||||
private static class Handler extends ChangeEditorActionHandler {
|
||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
||||
return argument != null && VimPlugin.getChange().deleteMotion(editor, context, count, rawCount, argument, false);
|
||||
public Handler() {
|
||||
super(true, CaretOrder.DECREASING_OFFSET);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(@NotNull Editor editor, @NotNull Caret caret, @NotNull DataContext context, int count,
|
||||
int rawCount, @Nullable Argument argument) {
|
||||
return argument != null &&
|
||||
VimPlugin.getChange().deleteMotion(editor, caret, context, count, rawCount, argument, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,6 +19,7 @@
|
||||
package com.maddyhome.idea.vim.action.change.delete;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||
@@ -27,6 +28,7 @@ import com.maddyhome.idea.vim.command.CommandState;
|
||||
import com.maddyhome.idea.vim.command.MappingMode;
|
||||
import com.maddyhome.idea.vim.command.SelectionType;
|
||||
import com.maddyhome.idea.vim.common.TextRange;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
||||
import com.maddyhome.idea.vim.helper.EditorHelper;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -40,17 +42,18 @@ import java.util.Set;
|
||||
*/
|
||||
public class DeleteVisualAction extends VimCommandAction {
|
||||
public DeleteVisualAction() {
|
||||
super(new VisualOperatorActionHandler() {
|
||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
|
||||
@NotNull TextRange range) {
|
||||
super(new VisualOperatorActionHandler(true, CaretOrder.DECREASING_OFFSET) {
|
||||
@Override
|
||||
protected boolean execute(@NotNull Editor editor, @NotNull Caret caret, @NotNull DataContext context,
|
||||
@NotNull Command cmd, @NotNull TextRange range) {
|
||||
final CommandState.SubMode mode = CommandState.getInstance(editor).getSubMode();
|
||||
if (mode == CommandState.SubMode.VISUAL_LINE) {
|
||||
final TextRange lineRange = new TextRange(EditorHelper.getLineStartForOffset(editor, range.getStartOffset()),
|
||||
EditorHelper.getLineEndForOffset(editor, range.getEndOffset()) + 1);
|
||||
return VimPlugin.getChange().deleteRange(editor, lineRange, SelectionType.fromSubMode(mode), false);
|
||||
return VimPlugin.getChange().deleteRange(editor, caret, lineRange, SelectionType.fromSubMode(mode), false);
|
||||
}
|
||||
else {
|
||||
return VimPlugin.getChange().deleteRange(editor, range, SelectionType.fromSubMode(mode), false);
|
||||
return VimPlugin.getChange().deleteRange(editor, caret, range, SelectionType.fromSubMode(mode), false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,6 +19,7 @@
|
||||
package com.maddyhome.idea.vim.action.change.delete;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||
@@ -27,6 +28,7 @@ import com.maddyhome.idea.vim.command.CommandState;
|
||||
import com.maddyhome.idea.vim.command.MappingMode;
|
||||
import com.maddyhome.idea.vim.command.SelectionType;
|
||||
import com.maddyhome.idea.vim.common.TextRange;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
||||
import com.maddyhome.idea.vim.helper.EditorHelper;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -40,17 +42,20 @@ import java.util.Set;
|
||||
*/
|
||||
public class DeleteVisualLinesAction extends VimCommandAction {
|
||||
public DeleteVisualLinesAction() {
|
||||
super(new VisualOperatorActionHandler() {
|
||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
|
||||
@NotNull TextRange range) {
|
||||
super(new VisualOperatorActionHandler(true, CaretOrder.DECREASING_OFFSET) {
|
||||
@Override
|
||||
protected boolean execute(@NotNull Editor editor, @NotNull Caret caret, @NotNull DataContext context,
|
||||
@NotNull Command cmd, @NotNull TextRange range) {
|
||||
final CommandState.SubMode mode = CommandState.getInstance(editor).getSubMode();
|
||||
if (mode == CommandState.SubMode.VISUAL_BLOCK) {
|
||||
return VimPlugin.getChange().deleteRange(editor, range, SelectionType.fromSubMode(mode), false);
|
||||
return VimPlugin.getChange()
|
||||
.deleteRange(editor, editor.getCaretModel().getPrimaryCaret(), range, SelectionType.fromSubMode(mode),
|
||||
false);
|
||||
}
|
||||
else {
|
||||
final TextRange lineRange = new TextRange(EditorHelper.getLineStartForOffset(editor, range.getStartOffset()),
|
||||
EditorHelper.getLineEndForOffset(editor, range.getEndOffset()) + 1);
|
||||
return VimPlugin.getChange().deleteRange(editor, lineRange, SelectionType.LINE_WISE, false);
|
||||
return VimPlugin.getChange().deleteRange(editor, caret, lineRange, SelectionType.LINE_WISE, false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,13 +19,16 @@
|
||||
package com.maddyhome.idea.vim.action.change.delete;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||
import com.maddyhome.idea.vim.command.Command;
|
||||
import com.maddyhome.idea.vim.command.CommandState;
|
||||
import com.maddyhome.idea.vim.command.MappingMode;
|
||||
import com.maddyhome.idea.vim.command.SelectionType;
|
||||
import com.maddyhome.idea.vim.common.TextRange;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
||||
import com.maddyhome.idea.vim.helper.EditorHelper;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -39,10 +42,11 @@ import java.util.Set;
|
||||
*/
|
||||
public class DeleteVisualLinesEndAction extends VimCommandAction {
|
||||
public DeleteVisualLinesEndAction() {
|
||||
super(new VisualOperatorActionHandler() {
|
||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
|
||||
@NotNull TextRange range) {
|
||||
if (range.isMultiple()) {
|
||||
super(new VisualOperatorActionHandler(true, CaretOrder.DECREASING_OFFSET) {
|
||||
@Override
|
||||
protected boolean execute(@NotNull Editor editor, @NotNull Caret caret, @NotNull DataContext context,
|
||||
@NotNull Command cmd, @NotNull TextRange range) {
|
||||
if (CommandState.inVisualBlockMode(editor)) {
|
||||
final int[] starts = range.getStartOffsets();
|
||||
final int[] ends = range.getEndOffsets();
|
||||
for (int i = 0; i < starts.length; i++) {
|
||||
@@ -51,12 +55,13 @@ public class DeleteVisualLinesEndAction extends VimCommandAction {
|
||||
}
|
||||
}
|
||||
final TextRange blockRange = new TextRange(starts, ends);
|
||||
return VimPlugin.getChange().deleteRange(editor, blockRange, SelectionType.BLOCK_WISE, false);
|
||||
return VimPlugin.getChange()
|
||||
.deleteRange(editor, editor.getCaretModel().getPrimaryCaret(), blockRange, SelectionType.BLOCK_WISE, false);
|
||||
}
|
||||
else {
|
||||
final TextRange lineRange = new TextRange(EditorHelper.getLineStartForOffset(editor, range.getStartOffset()),
|
||||
EditorHelper.getLineEndForOffset(editor, range.getEndOffset()) + 1);
|
||||
return VimPlugin.getChange().deleteRange(editor, lineRange, SelectionType.LINE_WISE, false);
|
||||
return VimPlugin.getChange().deleteRange(editor, caret, lineRange, SelectionType.LINE_WISE, false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -31,14 +31,16 @@ import org.jetbrains.annotations.Nullable;
|
||||
*/
|
||||
public class InsertAfterCursorAction extends EditorAction {
|
||||
public InsertAfterCursorAction() {
|
||||
super(new Handler());
|
||||
}
|
||||
|
||||
private static class Handler extends ChangeEditorActionHandler {
|
||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
||||
super(new ChangeEditorActionHandler() {
|
||||
@Override
|
||||
public boolean execute(@NotNull Editor editor,
|
||||
@NotNull DataContext context,
|
||||
int count,
|
||||
int rawCount,
|
||||
@Nullable Argument argument) {
|
||||
VimPlugin.getChange().insertAfterCursor(editor, context);
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -31,14 +31,16 @@ import org.jetbrains.annotations.Nullable;
|
||||
*/
|
||||
public class InsertAfterLineEndAction extends EditorAction {
|
||||
public InsertAfterLineEndAction() {
|
||||
super(new Handler());
|
||||
}
|
||||
|
||||
private static class Handler extends ChangeEditorActionHandler {
|
||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
||||
super(new ChangeEditorActionHandler() {
|
||||
@Override
|
||||
public boolean execute(@NotNull Editor editor,
|
||||
@NotNull DataContext context,
|
||||
int count,
|
||||
int rawCount,
|
||||
@Nullable Argument argument) {
|
||||
VimPlugin.getChange().insertAfterLineEnd(editor, context);
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -31,14 +31,16 @@ import org.jetbrains.annotations.Nullable;
|
||||
*/
|
||||
public class InsertAtPreviousInsertAction extends EditorAction {
|
||||
public InsertAtPreviousInsertAction() {
|
||||
super(new Handler());
|
||||
}
|
||||
|
||||
private static class Handler extends ChangeEditorActionHandler {
|
||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
||||
super(new ChangeEditorActionHandler() {
|
||||
@Override
|
||||
public boolean execute(@NotNull Editor editor,
|
||||
@NotNull DataContext context,
|
||||
int count,
|
||||
int rawCount,
|
||||
@Nullable Argument argument) {
|
||||
VimPlugin.getChange().insertAtPreviousInsert(editor, context);
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -31,14 +31,16 @@ import org.jetbrains.annotations.Nullable;
|
||||
*/
|
||||
public class InsertBeforeFirstNonBlankAction extends EditorAction {
|
||||
public InsertBeforeFirstNonBlankAction() {
|
||||
super(new Handler());
|
||||
}
|
||||
|
||||
private static class Handler extends ChangeEditorActionHandler {
|
||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
||||
super(new ChangeEditorActionHandler() {
|
||||
@Override
|
||||
public boolean execute(@NotNull Editor editor,
|
||||
@NotNull DataContext context,
|
||||
int count,
|
||||
int rawCount,
|
||||
@Nullable Argument argument) {
|
||||
VimPlugin.getChange().insertBeforeFirstNonBlank(editor, context);
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,12 +19,15 @@
|
||||
package com.maddyhome.idea.vim.action.change.insert;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.command.Command;
|
||||
import com.maddyhome.idea.vim.handler.EditorActionHandlerBase;
|
||||
import com.maddyhome.idea.vim.command.Argument;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
*/
|
||||
@@ -33,13 +36,19 @@ public class InsertCharacterAboveCursorAction extends EditorAction {
|
||||
super(new Handler());
|
||||
}
|
||||
|
||||
private static class Handler extends EditorActionHandlerBase {
|
||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
||||
private static class Handler extends ChangeEditorActionHandler {
|
||||
public Handler() {
|
||||
super(true, CaretOrder.INCREASING_OFFSET);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(@NotNull Editor editor, @NotNull Caret caret, @NotNull DataContext context, int count,
|
||||
int rawCount, @Nullable Argument argument) {
|
||||
if (editor.isOneLineMode()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return VimPlugin.getChange().insertCharacterAroundCursor(editor, context, -1);
|
||||
return VimPlugin.getChange().insertCharacterAroundCursor(editor, caret, -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,12 +19,15 @@
|
||||
package com.maddyhome.idea.vim.action.change.insert;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.command.Command;
|
||||
import com.maddyhome.idea.vim.handler.EditorActionHandlerBase;
|
||||
import com.maddyhome.idea.vim.command.Argument;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
*/
|
||||
@@ -33,13 +36,19 @@ public class InsertCharacterBelowCursorAction extends EditorAction {
|
||||
super(new Handler());
|
||||
}
|
||||
|
||||
private static class Handler extends EditorActionHandlerBase {
|
||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
||||
private static class Handler extends ChangeEditorActionHandler {
|
||||
public Handler() {
|
||||
super(true, CaretOrder.DECREASING_OFFSET);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(@NotNull Editor editor, @NotNull Caret caret, @NotNull DataContext context, int count,
|
||||
int rawCount, @Nullable Argument argument) {
|
||||
if (editor.isOneLineMode()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return VimPlugin.getChange().insertCharacterAroundCursor(editor, context, 1);
|
||||
return VimPlugin.getChange().insertCharacterAroundCursor(editor, caret, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,12 +19,17 @@
|
||||
package com.maddyhome.idea.vim.action.change.insert;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.command.Argument;
|
||||
import com.maddyhome.idea.vim.command.Command;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||
import com.maddyhome.idea.vim.handler.EditorActionHandlerBase;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
*/
|
||||
@@ -33,9 +38,15 @@ public class InsertDeleteInsertedTextAction extends EditorAction {
|
||||
super(new Handler());
|
||||
}
|
||||
|
||||
private static class Handler extends EditorActionHandlerBase {
|
||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
||||
return VimPlugin.getChange().insertDeleteInsertedText(editor);
|
||||
private static class Handler extends ChangeEditorActionHandler {
|
||||
public Handler() {
|
||||
super(true, CaretOrder.INCREASING_OFFSET);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(@NotNull Editor editor, @NotNull Caret caret, @NotNull DataContext context, int count,
|
||||
int rawCount, @Nullable Argument argument) {
|
||||
return VimPlugin.getChange().insertDeleteInsertedText(editor, caret);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,12 +19,17 @@
|
||||
package com.maddyhome.idea.vim.action.change.insert;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.command.Argument;
|
||||
import com.maddyhome.idea.vim.command.Command;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||
import com.maddyhome.idea.vim.handler.EditorActionHandlerBase;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
*/
|
||||
@@ -33,9 +38,15 @@ public class InsertDeletePreviousWordAction extends EditorAction {
|
||||
super(new Handler());
|
||||
}
|
||||
|
||||
private static class Handler extends EditorActionHandlerBase {
|
||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
||||
return VimPlugin.getChange().insertDeletePreviousWord(editor);
|
||||
private static class Handler extends ChangeEditorActionHandler {
|
||||
public Handler() {
|
||||
super(true, CaretOrder.DECREASING_OFFSET);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(@NotNull Editor editor, @NotNull Caret caret, @NotNull DataContext context, int count,
|
||||
int rawCount, @Nullable Argument argument) {
|
||||
return VimPlugin.getChange().insertDeletePreviousWord(editor, caret);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -21,7 +21,6 @@ package com.maddyhome.idea.vim.action.change.insert;
|
||||
import com.intellij.openapi.actionSystem.ActionManager;
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||
import com.maddyhome.idea.vim.command.Command;
|
||||
@@ -36,10 +35,11 @@ import java.util.Set;
|
||||
public class InsertExitModeAction extends VimCommandAction {
|
||||
private static final String ACTION_ID = "VimInsertExitMode";
|
||||
|
||||
public InsertExitModeAction() {
|
||||
protected InsertExitModeAction() {
|
||||
super(new EditorActionHandlerBase() {
|
||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
||||
VimPlugin.getChange().processEscape(InjectedLanguageUtil.getTopLevelEditor(editor), context);
|
||||
@Override
|
||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
||||
VimPlugin.getChange().processEscape(editor, context);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -31,14 +31,16 @@ import org.jetbrains.annotations.Nullable;
|
||||
*/
|
||||
public class InsertLineStartAction extends EditorAction {
|
||||
public InsertLineStartAction() {
|
||||
super(new Handler());
|
||||
}
|
||||
|
||||
private static class Handler extends ChangeEditorActionHandler {
|
||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
||||
super(new ChangeEditorActionHandler() {
|
||||
@Override
|
||||
public boolean execute(@NotNull Editor editor,
|
||||
@NotNull DataContext context,
|
||||
int count,
|
||||
int rawCount,
|
||||
@Nullable Argument argument) {
|
||||
VimPlugin.getChange().insertLineStart(editor, context);
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -35,7 +35,8 @@ public class InsertNewLineBelowAction extends EditorAction {
|
||||
}
|
||||
|
||||
private static class Handler extends ChangeEditorActionHandler {
|
||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount,
|
||||
@Nullable Argument argument) {
|
||||
if (editor.isOneLineMode()) {
|
||||
return false;
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -21,21 +21,26 @@ package com.maddyhome.idea.vim.action.change.insert;
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorActionHandler;
|
||||
import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.command.Argument;
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class InsertPreviousInsertAction extends EditorAction {
|
||||
public InsertPreviousInsertAction() {
|
||||
super(new Handler());
|
||||
}
|
||||
|
||||
private static class Handler extends EditorActionHandler {
|
||||
public void execute(@NotNull Editor editor, @NotNull DataContext context) {
|
||||
VimPlugin.getChange().insertPreviousInsert(InjectedLanguageUtil.getTopLevelEditor(editor), context, false);
|
||||
super(new ChangeEditorActionHandler() {
|
||||
@Override
|
||||
public boolean execute(@NotNull Editor editor,
|
||||
@NotNull DataContext context,
|
||||
int count,
|
||||
int rawCount,
|
||||
@Nullable Argument argument) {
|
||||
VimPlugin.getChange().insertPreviousInsert(editor, context, false);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -21,21 +21,26 @@ package com.maddyhome.idea.vim.action.change.insert;
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorActionHandler;
|
||||
import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.command.Argument;
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class InsertPreviousInsertExitAction extends EditorAction {
|
||||
public InsertPreviousInsertExitAction() {
|
||||
super(new Handler());
|
||||
}
|
||||
|
||||
private static class Handler extends EditorActionHandler {
|
||||
public void execute(@NotNull Editor editor, @NotNull DataContext context) {
|
||||
VimPlugin.getChange().insertPreviousInsert(InjectedLanguageUtil.getTopLevelEditor(editor), context, true);
|
||||
super(new ChangeEditorActionHandler() {
|
||||
@Override
|
||||
public boolean execute(@NotNull Editor editor,
|
||||
@NotNull DataContext context,
|
||||
int count,
|
||||
int rawCount,
|
||||
@Nullable Argument argument) {
|
||||
VimPlugin.getChange().insertPreviousInsert(editor, context, true);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -38,9 +38,12 @@ import java.util.Set;
|
||||
public class VisualBlockAppendAction extends VimCommandAction {
|
||||
public VisualBlockAppendAction() {
|
||||
super(new VisualOperatorActionHandler() {
|
||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
|
||||
protected boolean execute(@NotNull Editor editor,
|
||||
@NotNull DataContext context,
|
||||
@NotNull Command cmd,
|
||||
@NotNull TextRange range) {
|
||||
return !editor.isOneLineMode() && VimPlugin.getChange().blockInsert(editor, context, range, true);
|
||||
if (editor.isOneLineMode()) return false;
|
||||
return VimPlugin.getChange().blockInsert(editor, context, range, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -38,9 +38,13 @@ import java.util.Set;
|
||||
public class VisualBlockInsertAction extends VimCommandAction {
|
||||
public VisualBlockInsertAction() {
|
||||
super(new VisualOperatorActionHandler() {
|
||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
|
||||
@Override
|
||||
protected boolean execute(@NotNull Editor editor,
|
||||
@NotNull DataContext context,
|
||||
@NotNull Command cmd,
|
||||
@NotNull TextRange range) {
|
||||
return !editor.isOneLineMode() && VimPlugin.getChange().blockInsert(editor, context, range, false);
|
||||
if (editor.isOneLineMode()) return false;
|
||||
return VimPlugin.getChange().blockInsert(editor, context, range, false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
* Copyright (C) 2003-2016 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,10 +19,12 @@
|
||||
package com.maddyhome.idea.vim.action.change.shift;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.command.Argument;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -30,14 +32,14 @@ import org.jetbrains.annotations.Nullable;
|
||||
/**
|
||||
*/
|
||||
public class AutoIndentLinesAction extends EditorAction {
|
||||
public AutoIndentLinesAction() {
|
||||
super(new Handler());
|
||||
}
|
||||
|
||||
private static class Handler extends ChangeEditorActionHandler {
|
||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
||||
VimPlugin.getChange().autoIndentLines(context);
|
||||
protected AutoIndentLinesAction() {
|
||||
super(new ChangeEditorActionHandler(true, CaretOrder.DECREASING_OFFSET) {
|
||||
@Override
|
||||
public boolean execute(@NotNull Editor editor, @NotNull Caret caret, @NotNull DataContext context, int count,
|
||||
int rawCount, @Nullable Argument argument) {
|
||||
VimPlugin.getChange().autoIndentLines(editor, caret, context, count);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.maddyhome.idea.vim.action.change.shift;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.command.Argument;
|
||||
import com.maddyhome.idea.vim.handler.CaretOrder;
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* @author Aleksey Lagoshin
|
||||
*/
|
||||
public class AutoIndentMotionAction extends EditorAction {
|
||||
protected AutoIndentMotionAction() {
|
||||
super(new ChangeEditorActionHandler(true, CaretOrder.DECREASING_OFFSET) {
|
||||
@Override
|
||||
public boolean execute(@NotNull Editor editor, @NotNull Caret caret, @NotNull DataContext context, int count,
|
||||
int rawCount, @Nullable Argument argument) {
|
||||
if (argument == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
VimPlugin.getChange().autoIndentMotion(editor, caret, context, count, rawCount, argument);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user