mirror of
				https://github.com/chylex/IntelliJ-IdeaVim.git
				synced 2025-10-31 20:17:13 +01:00 
			
		
		
		
	Compare commits
	
		
			677 Commits
		
	
	
		
			3637022890
			...
			customized
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 9f469d0eb2 | |||
| f59d2f769c | |||
| dc00b59733 | |||
| bc20e6af9c | |||
| c40f07714a | |||
| fa68842c2d | |||
| eca9258607 | |||
| 46fb030977 | |||
|   | da3d83ecc6 | ||
|   | 4af8e574c4 | ||
|   | bdcb5c4f33 | ||
|   | 013f7a42c2 | ||
|   | d03398f3e8 | ||
|   | 7a26307a2b | ||
|   | fa6a0369b8 | ||
|   | ad8cb0ba09 | ||
|   | 8125ce5072 | ||
|   | 6c0cc7285f | ||
|   | d3424021c8 | ||
|   | 623aa40acd | ||
|   | c131cb338e | ||
|   | 14d242a233 | ||
|   | a131b7d29a | ||
|   | 85a1fbe89e | ||
|   | 142550a1f8 | ||
|   | e3d3b73903 | ||
|   | 45f18ff91c | ||
|   | 2103163207 | ||
|   | 19dd49670c | ||
|   | e738a1a821 | ||
|   | 6e0f301fb8 | ||
|   | c76b8db293 | ||
|   | 9fa4ca8fb3 | ||
|   | 871b60fe8d | ||
|   | 6715a5b61f | ||
|   | d7d91f1cc5 | ||
|   | 9f00dbd6f4 | ||
|   | f95cf3d671 | ||
|   | 7fbc17624f | ||
|   | b9c2ea37cb | ||
|   | ca0db15e01 | ||
|   | c32c62eacc | ||
|   | 43a79dbad4 | ||
|   | 2829a13187 | ||
|   | efc8c9207d | ||
|   | 183ed10592 | ||
|   | 926b47a31e | ||
|   | d272c919ea | ||
|   | f6e7d04fd5 | ||
|   | ccdff4f087 | ||
|   | ff14303e88 | ||
|   | 48a592340b | ||
|   | da8f5f3231 | ||
|   | f8fa8b73fa | ||
|   | aee126b625 | ||
|   | 396ac86939 | ||
|   | 81816f903f | ||
|   | 06a85b784b | ||
|   | 7f1e3bb155 | ||
|   | 241f554133 | ||
|   | 9498d0779c | ||
|   | b12fd5100f | ||
|   | 92f622430d | ||
|   | ef518f5b23 | ||
|   | 7acb17ebdb | ||
|   | 479a7dbbaf | ||
|   | 4fd1a25557 | ||
|   | f32d42e625 | ||
|   | 362b9a5c3a | ||
|   | e42b4d0ea3 | ||
|   | 43767b8500 | ||
|   | d05098c870 | ||
|   | 505f485568 | ||
|   | 86f512fb91 | ||
|   | 12903066b9 | ||
|   | 118d0433cb | ||
|   | eb781c3679 | ||
|   | 3c6bffba03 | ||
|   | 89623b04d6 | ||
|   | 444a96132c | ||
|   | c008553127 | ||
|   | 162d7b021f | ||
|   | c82364c1dd | ||
|   | 977402c6b0 | ||
|   | b14e59ab5b | ||
|   | 47dcefcfbf | ||
|   | 2b299cb422 | ||
|   | d0ccbb4620 | ||
|   | 187b207271 | ||
|   | a3e22c844c | ||
|   | f8384b2732 | ||
|   | 2dae43258c | ||
|   | 48033ecb85 | ||
|   | ad8df027ac | ||
|   | 91f580771d | ||
|   | 9c6f0981f5 | ||
|   | 2212569688 | ||
|   | 6711f1dbab | ||
|   | 0b7a883efb | ||
|   | 8ae84c62c0 | ||
|   | 0d168c8115 | ||
| c7b51b7fa5 | |||
|   | 86bf723791 | ||
|   | 71f2e9de4a | ||
|   | 33d3f270a3 | ||
|   | da94edd386 | ||
|   | 90dfaefd11 | ||
|   | 8bc616cc55 | ||
|   | a9e79d62c5 | ||
|   | 1998221a0b | ||
|   | a9b1625749 | ||
|   | b411836570 | ||
|   | df7e0221a8 | ||
|   | 8ff8f2b685 | ||
|   | 65dea7e3f7 | ||
|   | 1942f86633 | ||
|   | ee4ce5033a | ||
|   | 040fe806c8 | ||
|   | 97f5c9225e | ||
|   | 09b86c15f9 | ||
|   | 8f34285d8c | ||
|   | d3c3b71e3e | ||
|   | aa6f49c9b1 | ||
|   | c011628420 | ||
|   | 1c9fa9d662 | ||
|   | 7b9bc64364 | ||
|   | 729062bfdd | ||
|   | bc6c726a45 | ||
|   | dfc3df713e | ||
|   | 42eca1d5f2 | ||
|   | 66245e2730 | ||
|   | d44b82c1d1 | ||
|   | 5440e48fa3 | ||
|   | 1c513cf8aa | ||
|   | a17c4b8d43 | ||
|   | 15eb4ac278 | ||
|   | 0d9b81eab3 | ||
|   | f02e1a20c7 | ||
|   | a11991dad7 | ||
|   | 1238828bfd | ||
|   | ba409cb24c | ||
|   | d597670275 | ||
|   | d8540e95f8 | ||
|   | d35ebf00dd | ||
|   | 2b32cb26b1 | ||
|   | ca95fcb658 | ||
|   | cc18bbd168 | ||
|   | 8c8ea800cb | ||
|   | 0746dcc686 | ||
|   | 930650be9d | ||
|   | 4e3a9ffa40 | ||
|   | 3bf68a2bb8 | ||
|   | a80f6feab0 | ||
|   | 3cf8ae52ed | ||
|   | 62632a4514 | ||
|   | 249bd3778a | ||
|   | ab9e5d7a4a | ||
|   | 083b7dc952 | ||
|   | 1791692d92 | ||
|   | ba23c9ab5e | ||
|   | f96ab37bcb | ||
|   | 0da34bbb34 | ||
|   | 51e7c745ea | ||
|   | 8347251572 | ||
|   | ce8512f4e0 | ||
|   | a724a19d00 | ||
|   | 7eae7a98e8 | ||
|   | fe9566eebd | ||
|   | b69756730f | ||
|   | 6cd1a60b53 | ||
|   | 9d935e47b5 | ||
|   | a7d5372d06 | ||
|   | a575942c81 | ||
|   | 3cf6c53a8e | ||
|   | 91d86680de | ||
|   | d1d082fb99 | ||
|   | 2c634d1bf0 | ||
|   | 02a6fe4dc9 | ||
|   | 223d681526 | ||
|   | f42ef1c2fc | ||
|   | f4817b2111 | ||
|   | 6f5def0abf | ||
|   | f0fcd7f133 | ||
|   | 6115adb72e | ||
|   | bfd0b5fd91 | ||
|   | 6c0a52155b | ||
|   | c7ebce39bf | ||
|   | a0dc7a792f | ||
|   | fdb09a8f1f | ||
|   | 4ac2aa2339 | ||
|   | ebbc20692a | ||
|   | 5c82d112c9 | ||
|   | 40fd50d7f1 | ||
|   | f7b948fee2 | ||
|   | 6cdcf133bb | ||
|   | f3025757b6 | ||
|   | a49811a3f9 | ||
|   | 2ac4b265d1 | ||
|   | 46e994b563 | ||
|   | 81482bd298 | ||
|   | f1a239c085 | ||
|   | a48e38de7b | ||
|   | 0aaacee117 | ||
|   | b8373af69f | ||
|   | e99b2ee73d | ||
|   | 705022331a | ||
|   | bf62d444bf | ||
|   | 5dcff5657b | ||
|   | 7e79d5a960 | ||
|   | c1b480976d | ||
|   | ddabbe6891 | ||
|   | ffa3052b50 | ||
|   | 654ea88851 | ||
|   | 4dc7982baa | ||
|   | ae2fc1cd85 | ||
|   | 78bc8666e6 | ||
|   | 9c2de2cfc7 | ||
|   | 71e81465f3 | ||
|   | 885031e086 | ||
|   | d77c5bb5cf | ||
|   | 781bce0000 | ||
|   | a3ca1b965b | ||
|   | dd20b480a7 | ||
|   | 38292e97af | ||
|   | 46ea752164 | ||
|   | 194b744361 | ||
| b50197f7ce | |||
|   | c00703d1d0 | ||
|   | 6e12377116 | ||
|   | b0c4391ad8 | ||
|   | f43ac2538a | ||
|   | 9eaf8b5d2d | ||
|   | e365d0b07c | ||
|   | 69c273c4a5 | ||
|   | f7950e7adb | ||
|   | 7c1ae9812e | ||
|   | 5c794ac40e | ||
|   | 9dbe3c3363 | ||
|   | 8a98f46235 | ||
|   | 9ed8db4d4a | ||
|   | 5b94276836 | ||
|   | f1e427e2ff | ||
|   | a112cfe35f | ||
|   | 412b60d6b4 | ||
|   | 11d9ef7507 | ||
|   | ca143272f3 | ||
|   | 072449825c | ||
|   | 38ed9c206a | ||
|   | 8235a649a1 | ||
|   | 09efdd076e | ||
|   | da9b6ea762 | ||
|   | 437450a93b | ||
|   | 50fff8871e | ||
|   | 350e9cfca2 | ||
|   | 5639edf173 | ||
|   | f72313df9c | ||
|   | f52eb5e124 | ||
|   | 5da9c5e1cd | ||
|   | 53fdd891fb | ||
|   | 94820d7a83 | ||
|   | fe66d06ce2 | ||
|   | b6e917a2d7 | ||
|   | a6a39d249b | ||
|   | 518784c371 | ||
|   | 51c50cb902 | ||
|   | 6355d7765e | ||
|   | c083631590 | ||
|   | f62575c870 | ||
|   | 01e367cadf | ||
|   | e248bb5565 | ||
|   | 1744ec74c7 | ||
|   | 905f8003da | ||
|   | 3b3a036806 | ||
|   | ccf48d1e53 | ||
|   | d7a74fdf5e | ||
|   | 462c1bc75e | ||
|   | 96b05dcc94 | ||
|   | ceafe9d4e7 | ||
|   | fc9b09cf72 | ||
|   | 11c80b2ea9 | ||
|   | eb536766db | ||
|   | f3b6687d79 | ||
|   | adf483a748 | ||
|   | 7332cd1ed1 | ||
|   | 7726f4347b | ||
|   | ee092d988b | ||
|   | b3db3bb940 | ||
|   | edcb17a436 | ||
|   | f3b4933ef2 | ||
|   | c6fdf9cdf4 | ||
|   | 2244d0f776 | ||
|   | d7c4e4a8dd | ||
|   | b7c54d02cb | ||
|   | 620eca3a0d | ||
|   | aa3b2e988f | ||
|   | 753f589ea5 | ||
|   | 831e4e8c42 | ||
|   | 329722f338 | ||
|   | 2ff429cc76 | ||
|   | 47d4aee986 | ||
|   | 938325b93e | ||
|   | 12d0a2ffb7 | ||
|   | 4ff7e9aefa | ||
|   | f52792e7f0 | ||
|   | cbc6662ef7 | ||
|   | 26ffc2ad32 | ||
|   | df32e573b0 | ||
|   | 19647d96b2 | ||
|   | b1714a2fc1 | ||
|   | 83199d5475 | ||
|   | 4c0af66dff | ||
|   | ccd7204b21 | ||
|   | b82f1e6602 | ||
|   | 4104258219 | ||
|   | 11054f908b | ||
|   | e0dc6f7214 | ||
|   | 735686c415 | ||
|   | 385bcbc383 | ||
|   | f273620466 | ||
|   | acb27d5ccc | ||
|   | 62c79e1470 | ||
|   | 1a99918819 | ||
|   | 7e3a9e0b38 | ||
|   | f51d74f2b8 | ||
|   | 987cba6072 | ||
|   | 770e6371df | ||
|   | 30e660cf19 | ||
|   | 8ccf0b5364 | ||
|   | 3ef86186eb | ||
|   | b8b3669b04 | ||
|   | ac41890759 | ||
| ![dependabot[bot]](/assets/img/avatar_default.png)  | cf85e0f25e | ||
| ![dependabot[bot]](/assets/img/avatar_default.png)  | a4b52be833 | ||
| ![dependabot[bot]](/assets/img/avatar_default.png)  | 4cb8f27ca5 | ||
|   | 9a06ee97c4 | ||
|   | d7dfc6dc05 | ||
|   | 5a6de3afaa | ||
|   | cd242511a8 | ||
|   | 745ae6caa4 | ||
|   | acc7d0954d | ||
|   | 330d64c7cb | ||
|   | 673e43dd77 | ||
|   | c2c5c60899 | ||
|   | 7d5176829b | ||
|   | fd0dc0d445 | ||
|   | be11317667 | ||
|   | 22fce51640 | ||
|   | 4223da47d6 | ||
|   | 64100fea59 | ||
|   | 2244c65233 | ||
|   | e08bffd7ba | ||
|   | 0d5aa52af2 | ||
|   | e617fc4c34 | ||
|   | c34a7f123d | ||
|   | cc029fc98e | ||
|   | feae15c48c | ||
|   | 07485727c4 | ||
|   | 8b0ad7680b | ||
|   | 43d70cd467 | ||
|   | d73b605ef0 | ||
|   | 5afd4df69a | ||
|   | 323c611f87 | ||
|   | 0dd0a4976b | ||
|   | 48820d4dff | ||
|   | 2fbab395f1 | ||
|   | a9fd32f64e | ||
|   | da7a2226d4 | ||
|   | 44b37339dc | ||
|   | db1ec29470 | ||
|   | 713c3f0a3c | ||
|   | c6c2bc5e74 | ||
|   | c8352158b8 | ||
| ![dependabot[bot]](/assets/img/avatar_default.png)  | 8927c0acfa | ||
| ![dependabot[bot]](/assets/img/avatar_default.png)  | 02dfac8a34 | ||
|   | 8ab3664992 | ||
|   | 03e6101747 | ||
|   | 9f47995c10 | ||
|   | d58f36ea1a | ||
|   | 442970a986 | ||
|   | fcc6c8a3c5 | ||
|   | 1dbd4b4391 | ||
| ![dependabot[bot]](/assets/img/avatar_default.png)  | 1943c72c1c | ||
| ![dependabot[bot]](/assets/img/avatar_default.png)  | 7816da3f2d | ||
|   | b25d7e358d | ||
|   | 04b62e6392 | ||
|   | 4ecfb796d4 | ||
|   | de9fa81da3 | ||
|   | be484d381c | ||
|   | 351e3b15ea | ||
|   | 2b9b48ac2f | ||
|   | 7c4ac5f561 | ||
|   | def09b0be8 | ||
|   | 2415b167fb | ||
|   | dfc7aef07d | ||
|   | 276ad276ec | ||
|   | 83da2d304e | ||
|   | 6ddc40d080 | ||
|   | 42fb5487e5 | ||
|   | 1ce35ac233 | ||
|   | 2734202e12 | ||
|   | 6a31fd2732 | ||
|   | 5d84aa6939 | ||
|   | 7173b7960d | ||
|   | bb1c30d6c8 | ||
|   | d70abf6e27 | ||
|   | 8931fdf82a | ||
|   | 25ba72e46b | ||
|   | ebd71d41dc | ||
|   | 4b49bb4737 | ||
|   | eeac47e522 | ||
|   | 335267c0af | ||
|   | c4254dc6dd | ||
|   | 12cb359967 | ||
|   | d73cb274b4 | ||
|   | 6cb6afe032 | ||
|   | 3686f0eb24 | ||
|   | 6cc24fe99e | ||
|   | 3784f1957f | ||
|   | 69fd8d68af | ||
|   | 301d72c169 | ||
|   | ca11974b12 | ||
|   | 8917dbf4bb | ||
|   | 56afa6d564 | ||
|   | 8ecac1a8cf | ||
|   | f742e414e6 | ||
|   | c462af2d10 | ||
|   | 66ede93d95 | ||
|   | c97f5be3fa | ||
|   | c4d35849fd | ||
|   | 88c191bc61 | ||
|   | a1e6318bce | ||
|   | 3606f5ea14 | ||
|   | 38c3b206e2 | ||
|   | e69bf9760d | ||
|   | 0b763e23cf | ||
|   | 311cb0bada | ||
|   | a78782b73a | ||
|   | 54df803ee1 | ||
|   | 2819b782c9 | ||
|   | 38c12660b0 | ||
|   | 3917a8c5e3 | ||
|   | 17c642d5ed | ||
|   | 2d84e2d788 | ||
|   | ca19d2bfd5 | ||
|   | cd56fb87d0 | ||
|   | 7290edd3ae | ||
|   | 8d4e9b8514 | ||
|   | db87b51784 | ||
|   | 96dc9af1e3 | ||
|   | a453cb2582 | ||
|   | b0d53330bb | ||
|   | 99ebcacf31 | ||
|   | 3ec90194d7 | ||
|   | 5ce52f7189 | ||
|   | d163837d8d | ||
|   | 81811530de | ||
|   | 7276bc49a7 | ||
|   | 90cff7e574 | ||
|   | c673550901 | ||
|   | 5b360b6de2 | ||
|   | 8e2783962f | ||
|   | 866b319c5b | ||
|   | 6eb47567e8 | ||
|   | d27f87fbb8 | ||
|   | b2a2299347 | ||
|   | 905862ab9f | ||
|   | 5c307fd22c | ||
|   | e92b69ad3f | ||
|   | c6a5f9c268 | ||
|   | 54f91f2a64 | ||
|   | 4b2ed33cdd | ||
|   | 5fa48fc7dd | ||
|   | e028c269b7 | ||
|   | 9798c7aca2 | ||
|   | b5bca78ef4 | ||
|   | 1c619cfc74 | ||
|   | dc5832a44c | ||
|   | 8fd64afc90 | ||
|   | 1484f4e370 | ||
|   | 32df1597c4 | ||
|   | 707b750ff1 | ||
|   | 3388c8517b | ||
|   | 60a8e0d5f5 | ||
|   | 5a757a58b5 | ||
|   | 2e555b6eaa | ||
|   | c57277cc15 | ||
|   | bf035d42af | ||
|   | 8cb6f9b65f | ||
|   | fcbc4a0688 | ||
|   | 42bc15c8ea | ||
|   | 992231bcad | ||
|   | 6d494c99e3 | ||
|   | a848f2175a | ||
|   | 4e6a2f951b | ||
|   | 5a41bbe806 | ||
|   | 066e6619af | ||
|   | f0dbabd20f | ||
|   | 35c0e33ec4 | ||
|   | a5715dac7d | ||
|   | cdb9af5ab6 | ||
|   | 19c05c23f3 | ||
|   | 12c744c1ba | ||
|   | 604a6a5140 | ||
|   | 62aae7b7c4 | ||
|   | 2ea899330c | ||
|   | 3574db020f | ||
|   | b2ae2a38ec | ||
|   | 04ebb6077a | ||
|   | d5062944d0 | ||
|   | dc181ce0ce | ||
|   | 042e3388b0 | ||
|   | d4a1ffa9a9 | ||
|   | 54927d0af7 | ||
|   | d26765e217 | ||
|   | 277b4e63c3 | ||
|   | 848514405b | ||
|   | 7b8fd0ee55 | ||
|   | d373ebac58 | ||
|   | 370ccc5254 | ||
|   | 9272fc8cd7 | ||
| ![dependabot[bot]](/assets/img/avatar_default.png)  | 22cfdbae0a | ||
|   | f49f5e5d25 | ||
|   | 118c12e7fe | ||
|   | 02a7eb34ee | ||
|   | 739390739e | ||
|   | 6b2ead0d4e | ||
|   | 1eaf9e7b17 | ||
|   | 954e1a9099 | ||
|   | 5aeff6f914 | ||
|   | fb15049fbf | ||
|   | 6f3a9c210e | ||
|   | 6fdd6d839e | ||
|   | ac1101a410 | ||
|   | 2fd33e6ec2 | ||
|   | 779c69a982 | ||
|   | 3494286e66 | ||
|   | 139b78d7f4 | ||
|   | daee2f615c | ||
|   | 710825ec28 | ||
|   | 478539911b | ||
|   | b21d984cf8 | ||
|   | 1a92cebf6b | ||
|   | fd3f939526 | ||
|   | 7d28760fa1 | ||
|   | 4a0a1c95a9 | ||
|   | 9da0c10141 | ||
|   | 43b9ecdf3c | ||
|   | 987952a2f2 | ||
|   | 92f6ac57ad | ||
|   | b4af51f3cc | ||
|   | 4ba6e62ada | ||
|   | 58d5924e80 | ||
|   | 8f55551339 | ||
|   | 9229497be8 | ||
|   | 99e77cd8ed | ||
|   | 8d8809238c | ||
|   | f03d574e86 | ||
|   | cbb5fbe92e | ||
|   | 6a376ad62c | ||
|   | 8e61853459 | ||
|   | b17bc1bb3e | ||
|   | 1343c7603b | ||
|   | 5b5a4b1347 | ||
|   | 62fb3f9c5a | ||
|   | 986378db42 | ||
|   | ce99c26c03 | ||
|   | 3571595838 | ||
|   | c0c450124f | ||
|   | aa62022218 | ||
|   | 71c27babfd | ||
|   | 2ff93270d7 | ||
|   | c07719dd3d | ||
|   | 6b7ef88418 | ||
|   | ee9f12180d | ||
|   | 8df3bc57c5 | ||
|   | 0aabb2971e | ||
|   | e5740bf496 | ||
|   | e8f1dff61c | ||
|   | 267fc62865 | ||
|   | 05a64f51f7 | ||
|   | e5460d7a31 | ||
|   | 1826a31e2f | ||
|   | 2bb44c414f | ||
|   | ef7442c488 | ||
|   | 775bde62c8 | ||
|   | c5a504bde3 | ||
|   | f7f7e010c4 | ||
|   | aa82f7ed64 | ||
|   | 684d192b4b | ||
|   | aed2d1159d | ||
|   | d2500df05e | ||
|   | 8922303a72 | ||
|   | cea4de03cd | ||
|   | 9529c19b9b | ||
|   | b0f5c502d9 | ||
|   | c3fc369bc4 | ||
|   | a5ef0d5edf | ||
|   | 26e9056f17 | ||
|   | 1553aa774b | ||
|   | 2ebdbc5ac4 | ||
|   | e3ca172101 | ||
|   | 17d4ec6c29 | ||
|   | bec317615d | ||
|   | d00fd767ff | ||
|   | 557652c526 | ||
|   | e138541495 | ||
|   | f6dfbcad0d | ||
|   | 2518be2704 | ||
|   | 42ec2b9dce | ||
|   | 9484599bfd | ||
|   | 5e6d3ddae8 | ||
|   | 13cce3afcc | ||
|   | 9743cb1424 | ||
|   | dbbcf3860a | ||
|   | ae983be0a8 | ||
|   | f8156fbbca | ||
|   | 1909547543 | ||
|   | e47c0c1914 | ||
|   | 1a122337fe | ||
|   | bcf2578da9 | ||
|   | 06cd41ba0e | ||
|   | 64ec421cfc | ||
|   | 86fcda5afc | ||
|   | e799d40803 | ||
|   | c84325a37c | ||
|   | 3b6d57849c | ||
|   | 9b4825db77 | ||
|   | 6a4bb7395b | ||
|   | c8463d9b3e | ||
|   | 376ca4e93b | ||
|   | 6a43e558fd | ||
|   | 05414276f2 | ||
|   | bec73749c2 | ||
|   | 0d4f9891c3 | ||
|   | f082ab4b68 | ||
|   | d4f4765ffd | ||
|   | 8902c0839c | ||
|   | 66fc8034ba | ||
|   | 109cb58d68 | ||
|   | a71916df84 | ||
|   | 5f10eb808e | ||
|   | 6c1e7b0b60 | ||
|   | 792c22a90a | ||
|   | eff2cd02f9 | ||
|   | 163e7751f2 | ||
|   | 370c22b2f5 | ||
|   | a251ac55e5 | ||
|   | 987df6958e | ||
|   | 60ae189442 | ||
|   | ce734906d4 | ||
|   | 3b26572731 | ||
|   | 4d9c606c79 | ||
|   | 22050fc16d | ||
|   | 2fb419253c | ||
|   | 3bb4fc67bf | ||
|   | a0a009cb59 | ||
|   | ce2bb85e18 | ||
|   | 7ff8ac76fa | ||
|   | 935c51c985 | ||
|   | a8d0e698eb | ||
|   | 5b13ad6726 | ||
|   | e88d0d1493 | ||
|   | 898af47f89 | ||
|   | 84868c0fb5 | ||
|   | 8e2b7d2089 | ||
|   | f359ac49f3 | ||
|   | 37ce0925a5 | ||
|   | 23985aea7d | ||
|   | 3bd5ab970f | ||
|   | fbdcbdc626 | ||
|   | f197ee54d1 | ||
|   | efa0489f7b | ||
|   | 66dd90a090 | ||
|   | 68cfb12746 | ||
|   | 4ad14f3404 | ||
|   | 4bcf44570b | ||
| ![dependabot[bot]](/assets/img/avatar_default.png)  | b6128418be | 
							
								
								
									
										3
									
								
								.github/workflows/mergePr.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.github/workflows/mergePr.yml
									
									
									
									
										vendored
									
									
								
							| @@ -4,6 +4,7 @@ | ||||
| name: Update Changelog On PR | ||||
|  | ||||
| on: | ||||
|   workflow_dispatch: | ||||
|   pull_request: | ||||
|     types: [ closed ] | ||||
|  | ||||
| @@ -29,7 +30,7 @@ jobs: | ||||
|         id: update_authors | ||||
|         run: ./gradlew updateMergedPr -PprId=${{ github.event.number }} | ||||
|         env: | ||||
|           GITHUB_OAUTH: ${{ secrets.AUTOMATION_TOKEN }} | ||||
|           GITHUB_OAUTH: ${{ secrets.MERGE_PR }} | ||||
|  | ||||
|       - name: Commit changes | ||||
|         uses: stefanzweifel/git-auto-commit-action@v4 | ||||
|   | ||||
							
								
								
									
										40
									
								
								.github/workflows/mergePrTest.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								.github/workflows/mergePrTest.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,40 @@ | ||||
| # This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created | ||||
| # For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle | ||||
|  | ||||
| name: Update Changelog On PR (Test) | ||||
|  | ||||
| on: | ||||
|   workflow_dispatch: | ||||
|  | ||||
| jobs: | ||||
|   build: | ||||
|  | ||||
|     runs-on: ubuntu-latest | ||||
|  | ||||
|     steps: | ||||
|       - uses: actions/checkout@v2 | ||||
|         with: | ||||
|           fetch-depth: 50 | ||||
|       - name: Set up JDK 11 | ||||
|         uses: actions/setup-java@v2 | ||||
|         with: | ||||
|           java-version: '11' | ||||
|           distribution: 'adopt' | ||||
|           server-id: github # Value of the distributionManagement/repository/id field of the pom.xml | ||||
|           settings-path: ${{ github.workspace }} # location for the settings.xml file | ||||
|  | ||||
|       - name: Update authors | ||||
|         id: update_authors | ||||
|         run: ./gradlew updateMergedPr -PprId=525 | ||||
|         env: | ||||
|           GITHUB_OAUTH: ${{ secrets.MERGE_PR }} | ||||
|  | ||||
| #      - name: Commit changes | ||||
| #        uses: stefanzweifel/git-auto-commit-action@v4 | ||||
| #        with: | ||||
| #          branch: master | ||||
| #          commit_message: Update changelog  after merging PR | ||||
| #          commit_user_name: Alex Plate | ||||
| #          commit_user_email: aleksei.plate@jetbrains.com | ||||
| #          commit_author: Alex Plate <aleksei.plate@jetbrains.com> | ||||
| #          file_pattern: CHANGES.md | ||||
							
								
								
									
										2
									
								
								.github/workflows/updateAuthors.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/updateAuthors.yml
									
									
									
									
										vendored
									
									
								
							| @@ -37,7 +37,7 @@ jobs: | ||||
|         run: ./gradlew updateAuthors --stacktrace | ||||
|         env: | ||||
|           SUCCESS_COMMIT: ${{ steps.last_successful_commit.outputs.commit_hash }} | ||||
|           GITHUB_OAUTH: ${{ secrets.AUTOMATION_TOKEN }} | ||||
|           GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }} | ||||
|  | ||||
|       - name: Commit changes | ||||
|         uses: stefanzweifel/git-auto-commit-action@v4 | ||||
|   | ||||
							
								
								
									
										6
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -10,9 +10,9 @@ | ||||
| !/.idea/runConfigurations | ||||
| !/.idea/codeStyles | ||||
|  | ||||
| /build/ | ||||
| /out/ | ||||
| /tmp/ | ||||
| **/build/ | ||||
| **/out/ | ||||
| **/tmp/ | ||||
|  | ||||
| *.DS_Store | ||||
|  | ||||
|   | ||||
							
								
								
									
										8
									
								
								.teamcity/_Self/Constants.kt
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								.teamcity/_Self/Constants.kt
									
									
									
									
										vendored
									
									
								
							| @@ -5,16 +5,16 @@ object Constants { | ||||
|   const val EAP_CHANNEL = "eap" | ||||
|   const val DEV_CHANNEL = "Dev" | ||||
|  | ||||
|   const val VERSION = "1.9.3" | ||||
|   const val DEV_VERSION = "1.10.0" | ||||
|   const val VERSION = "1.11.1" | ||||
|   const val DEV_VERSION = "1.12.0" | ||||
|  | ||||
|   const val GITHUB_TESTS = "LATEST-EAP-SNAPSHOT" | ||||
|   const val LINTING_TESTS = "LATEST-EAP-SNAPSHOT" | ||||
|   const val NVIM_TESTS = "LATEST-EAP-SNAPSHOT" | ||||
|   const val PROPERTY_TESTS = "LATEST-EAP-SNAPSHOT" | ||||
|   const val LONG_RUNNING_TESTS = "LATEST-EAP-SNAPSHOT" | ||||
|   const val QODANA_TESTS = "LATEST-EAP-SNAPSHOT" | ||||
|   const val RELEASE = "2021.3" | ||||
|   const val RELEASE = "LATEST-EAP-SNAPSHOT" | ||||
|  | ||||
|   const val RELEASE_DEV = "LATEST-EAP-SNAPSHOT" | ||||
|   const val RELEASE_EAP = "LATEST-EAP-SNAPSHOT" | ||||
| } | ||||
|   | ||||
							
								
								
									
										22
									
								
								.teamcity/_Self/Project.kt
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										22
									
								
								.teamcity/_Self/Project.kt
									
									
									
									
										vendored
									
									
								
							| @@ -1,6 +1,13 @@ | ||||
| package _Self | ||||
|  | ||||
| import _Self.buildTypes.* | ||||
| import _Self.buildTypes.Compatibility | ||||
| import _Self.buildTypes.LongRunning | ||||
| import _Self.buildTypes.Nvim | ||||
| import _Self.buildTypes.PluginVerifier | ||||
| import _Self.buildTypes.PropertyBased | ||||
| import _Self.buildTypes.Qodana | ||||
| import _Self.buildTypes.TestsForIntelliJ20222 | ||||
| import _Self.buildTypes.TestsForIntelliJEAP | ||||
| import _Self.subprojects.GitHub | ||||
| import _Self.subprojects.OldTests | ||||
| import _Self.subprojects.Releases | ||||
| @@ -9,6 +16,9 @@ import _Self.vcsRoots.Branch_183 | ||||
| import _Self.vcsRoots.Branch_191_193 | ||||
| import _Self.vcsRoots.Branch_201 | ||||
| import _Self.vcsRoots.Branch_202 | ||||
| import _Self.vcsRoots.Branch_203_212 | ||||
| import _Self.vcsRoots.Branch_213_221 | ||||
| import _Self.vcsRoots.Branch_Release | ||||
| import _Self.vcsRoots.GitHubPullRequest | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.Project | ||||
|  | ||||
| @@ -23,19 +33,21 @@ object Project : Project({ | ||||
|   vcsRoot(Branch_191_193) | ||||
|   vcsRoot(Branch_201) | ||||
|   vcsRoot(Branch_202) | ||||
|   vcsRoot(Branch_203_212) | ||||
|   vcsRoot(Branch_213_221) | ||||
|   vcsRoot(Branch_Release) | ||||
|   vcsRoot(GitHubPullRequest) | ||||
|  | ||||
|   // Builds | ||||
|   buildType(TestsForIntelliJ20203) | ||||
|   buildType(TestsForIntelliJ20211) | ||||
|   buildType(TestsForIntelliJ20212) | ||||
|   buildType(TestsForIntelliJEAP) | ||||
|   buildType(TestsForIntelliJ20222) | ||||
|  | ||||
|   buildType(PropertyBased) | ||||
|   buildType(LongRunning) | ||||
|  | ||||
|   buildType(Nvim) | ||||
|   buildType(PluginVerifier) | ||||
|   buildType(Compatibility) | ||||
|  | ||||
|   buildType(Qodana) | ||||
|  | ||||
| @@ -45,7 +57,7 @@ object Project : Project({ | ||||
|       type = "CloudImage" | ||||
|       id = "PROJECT_EXT_768" | ||||
|       param("agent_pool_id", "41") | ||||
|       param("amazon-id", "ami-0d1a6a32faa92923e") | ||||
|       param("amazon-id", "ami-0fa17ce8238eb8868") | ||||
|       param("ebs-optimized", "false") | ||||
|       param("image-instances-limit", "") | ||||
|       param("image-name-prefix", "BuildAgentsIdeaVim") | ||||
|   | ||||
							
								
								
									
										4
									
								
								.teamcity/_Self/buildTypes/ActiveTests.kt
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.teamcity/_Self/buildTypes/ActiveTests.kt
									
									
									
									
										vendored
									
									
								
							| @@ -55,6 +55,4 @@ sealed class ActiveTests(buildName: String, ijVersion: String) : BuildType({ | ||||
| }) | ||||
|  | ||||
| object TestsForIntelliJEAP : ActiveTests("Tests for IntelliJ Latest EAP", "LATEST-EAP-SNAPSHOT") | ||||
| object TestsForIntelliJ20212 : ActiveTests("Tests for IntelliJ 2021.2", "2021.2.2") | ||||
| object TestsForIntelliJ20211 : ActiveTests("Tests for IntelliJ 2021.1", "2021.1") | ||||
| object TestsForIntelliJ20203 : ActiveTests("Tests for IntelliJ 2020.3", "2020.3") | ||||
| object TestsForIntelliJ20222 : ActiveTests("Tests for IntelliJ 2022.2", "2022.2.1") | ||||
|   | ||||
							
								
								
									
										49
									
								
								.teamcity/_Self/buildTypes/Compatibility.kt
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								.teamcity/_Self/buildTypes/Compatibility.kt
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,49 @@ | ||||
| package _Self.buildTypes | ||||
|  | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.BuildType | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.DslContext | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.buildFeatures.golang | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.script | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.schedule | ||||
|  | ||||
| object Compatibility : BuildType({ | ||||
|   id("IdeaVimCompatibility") | ||||
|   name = "IdeaVim compatibility with external plugins" | ||||
|  | ||||
|   vcs { | ||||
|     root(DslContext.settingsRoot) | ||||
|   } | ||||
|  | ||||
|   steps { | ||||
|     script { | ||||
|       name = "Check" | ||||
|       scriptContent = """ | ||||
|                 java -jar verifier/verifier-cli-dev-all.jar check-plugin '${'$'}org.jetbrains.IdeaVim-EasyMotion' [latest-IU] -team-city | ||||
|                 java -jar verifier/verifier-cli-dev-all.jar check-plugin '${'$'}io.github.mishkun.ideavimsneak' [latest-IU] -team-city | ||||
|                 java -jar verifier/verifier-cli-dev-all.jar check-plugin '${'$'}eu.theblob42.idea.whichkey' [latest-IU] -team-city | ||||
|                 java -jar verifier/verifier-cli-dev-all.jar check-plugin '${'$'}IdeaVimExtension' [latest-IU] -team-city | ||||
|                 # Outdated java -jar verifier/verifier-cli-dev-all.jar check-plugin '${'$'}github.zgqq.intellij-enhance' [latest-IU] -team-city | ||||
|                 java -jar verifier/verifier-cli-dev-all.jar check-plugin '${'$'}com.github.copilot' [latest-IU] -team-city | ||||
|                 java -jar verifier/verifier-cli-dev-all.jar check-plugin '${'$'}com.github.dankinsoid.multicursor' [latest-IU] -team-city | ||||
|                 java -jar verifier/verifier-cli-dev-all.jar check-plugin '${'$'}com.joshestein.ideavim-quickscope' [latest-IU] -team-city | ||||
|             """.trimIndent() | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   triggers { | ||||
|     schedule { | ||||
|       schedulingPolicy = daily { | ||||
|         hour = 4 | ||||
|       } | ||||
|       branchFilter = "" | ||||
|       triggerBuild = always() | ||||
|       withPendingChangesOnly = false | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   features { | ||||
|     golang { | ||||
|       testFormat = "json" | ||||
|     } | ||||
|   } | ||||
| }) | ||||
							
								
								
									
										2
									
								
								.teamcity/_Self/buildTypes/Nvim.kt
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.teamcity/_Self/buildTypes/Nvim.kt
									
									
									
									
										vendored
									
									
								
							| @@ -31,7 +31,7 @@ object Nvim : BuildType({ | ||||
|     script { | ||||
|       name = "Set up NeoVim" | ||||
|       scriptContent = """ | ||||
|               wget https://github.com/neovim/neovim/releases/download/v0.4.4/nvim-linux64.tar.gz | ||||
|               wget https://github.com/neovim/neovim/releases/download/v0.7.2/nvim-linux64.tar.gz | ||||
|               tar xzf nvim-linux64.tar.gz | ||||
|               cd nvim-linux64/bin | ||||
|               chmod +x nvim | ||||
|   | ||||
							
								
								
									
										10
									
								
								.teamcity/_Self/buildTypes/Qodana.kt
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										10
									
								
								.teamcity/_Self/buildTypes/Qodana.kt
									
									
									
									
										vendored
									
									
								
							| @@ -4,6 +4,7 @@ import _Self.Constants.QODANA_TESTS | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.BuildType | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.CheckoutMode | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.DslContext | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.Qodana | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.qodana | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.failureConditions.BuildFailureOnMetric | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.failureConditions.failOnMetricChange | ||||
| @@ -28,11 +29,15 @@ object Qodana : BuildType({ | ||||
|   steps { | ||||
|     qodana { | ||||
|       name = "Qodana" | ||||
| /* | ||||
|       reportAsTestsEnable = "" | ||||
|       failBuildOnErrors = "" | ||||
|       codeInspectionXmlConfig = "Custom" | ||||
|       codeInspectionCustomXmlConfigPath = ".idea/inspectionProfiles/Qodana.xml" | ||||
|       reportAsTestsEnable = "true" | ||||
| */ | ||||
|       clearConditions() | ||||
|       param("licenseaudit-enable", "true") | ||||
|       param("clonefinder-languages", "Java") | ||||
|       param("clonefinder-mode", "") | ||||
|       param("report-version", "") | ||||
| @@ -42,12 +47,15 @@ object Qodana : BuildType({ | ||||
|       param("clonefinder-enable", "true") | ||||
|       param("clonefinder-reference-projects", "src") | ||||
|       param("yaml-configuration", "") | ||||
|       linter = jvm { | ||||
|         version = Qodana.JVMVersion.LATEST | ||||
|       } | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   triggers { | ||||
|     vcs { | ||||
|       enabled = false | ||||
|       enabled = true | ||||
|       branchFilter = "" | ||||
|     } | ||||
|     schedule { | ||||
|   | ||||
							
								
								
									
										3
									
								
								.teamcity/_Self/buildTypes/Release.kt
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.teamcity/_Self/buildTypes/Release.kt
									
									
									
									
										vendored
									
									
								
							| @@ -5,6 +5,7 @@ import _Self.Constants.DEV_CHANNEL | ||||
| import _Self.Constants.EAP_CHANNEL | ||||
| import _Self.Constants.RELEASE | ||||
| import _Self.Constants.VERSION | ||||
| import _Self.vcsRoots.Branch_Release | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.BuildType | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.CheckoutMode | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.DslContext | ||||
| @@ -38,7 +39,7 @@ object Release : BuildType({ | ||||
|   } | ||||
|  | ||||
|   vcs { | ||||
|     root(DslContext.settingsRoot) | ||||
|     root(Branch_Release) | ||||
|  | ||||
|     checkoutMode = CheckoutMode.AUTO | ||||
|   } | ||||
|   | ||||
							
								
								
									
										64
									
								
								.teamcity/_Self/buildTypes/TestsForIntelliJ_203-212.kt
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										64
									
								
								.teamcity/_Self/buildTypes/TestsForIntelliJ_203-212.kt
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,64 @@ | ||||
| @file:Suppress("ClassName") | ||||
|  | ||||
| package _Self.buildTypes | ||||
|  | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.BuildType | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.CheckoutMode | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.gradle | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.failureConditions.BuildFailureOnMetric | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.failureConditions.failOnMetricChange | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.vcs | ||||
|  | ||||
| sealed class TestsForIntelliJ_203_212_branch(private val version: String) : BuildType({ | ||||
|   name = "Tests for IntelliJ $version" | ||||
|  | ||||
|   params { | ||||
|     param("env.ORG_GRADLE_PROJECT_downloadIdeaSources", "false") | ||||
|     param("env.ORG_GRADLE_PROJECT_legacyNoJavaPlugin", "true") | ||||
|     param("env.ORG_GRADLE_PROJECT_ideaVersion", "IC-$version") | ||||
|     param("env.ORG_GRADLE_PROJECT_instrumentPluginCode", "false") | ||||
|     param("env.ORG_GRADLE_PROJECT_javaVersion", "1.8") | ||||
|   } | ||||
|  | ||||
|   vcs { | ||||
|     root(_Self.vcsRoots.Branch_203_212) | ||||
|  | ||||
|     checkoutMode = CheckoutMode.AUTO | ||||
|   } | ||||
|  | ||||
|   steps { | ||||
|     gradle { | ||||
|       tasks = "clean test" | ||||
|       buildFile = "" | ||||
|       enableStacktrace = true | ||||
|       param("org.jfrog.artifactory.selectedDeployableServer.defaultModuleVersionConfiguration", "GLOBAL") | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   triggers { | ||||
|     vcs { | ||||
|       branchFilter = "" | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   requirements { | ||||
|     noLessThanVer("teamcity.agent.jvm.version", "1.8") | ||||
|   } | ||||
|  | ||||
|   failureConditions { | ||||
|     failOnMetricChange { | ||||
|       metric = BuildFailureOnMetric.MetricType.TEST_COUNT | ||||
|       threshold = 20 | ||||
|       units = BuildFailureOnMetric.MetricUnit.PERCENTS | ||||
|       comparison = BuildFailureOnMetric.MetricComparison.LESS | ||||
|       compareTo = build { | ||||
|         buildRule = lastSuccessful() | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| }) | ||||
|  | ||||
|  | ||||
| object TestsForIntelliJ20212 : TestsForIntelliJ_203_212_branch("2021.2.2") | ||||
| object TestsForIntelliJ20211 : TestsForIntelliJ_203_212_branch("2021.1") | ||||
| object TestsForIntelliJ20203 : TestsForIntelliJ_203_212_branch("2020.3") | ||||
							
								
								
									
										62
									
								
								.teamcity/_Self/buildTypes/TestsForIntelliJ_213-221.kt
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										62
									
								
								.teamcity/_Self/buildTypes/TestsForIntelliJ_213-221.kt
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,62 @@ | ||||
| @file:Suppress("ClassName") | ||||
|  | ||||
| package _Self.buildTypes | ||||
|  | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.BuildType | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.CheckoutMode | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.gradle | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.failureConditions.BuildFailureOnMetric | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.failureConditions.failOnMetricChange | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.vcs | ||||
|  | ||||
| sealed class TestsForIntelliJ_213_221_branch(private val version: String) : BuildType({ | ||||
|   name = "Tests for IntelliJ $version" | ||||
|  | ||||
|   params { | ||||
|     param("env.ORG_GRADLE_PROJECT_downloadIdeaSources", "false") | ||||
|     param("env.ORG_GRADLE_PROJECT_legacyNoJavaPlugin", "true") | ||||
|     param("env.ORG_GRADLE_PROJECT_ideaVersion", "IC-$version") | ||||
|     param("env.ORG_GRADLE_PROJECT_instrumentPluginCode", "false") | ||||
|     param("env.ORG_GRADLE_PROJECT_javaVersion", "1.8") | ||||
|   } | ||||
|  | ||||
|   vcs { | ||||
|     root(_Self.vcsRoots.Branch_213_221) | ||||
|  | ||||
|     checkoutMode = CheckoutMode.AUTO | ||||
|   } | ||||
|  | ||||
|   steps { | ||||
|     gradle { | ||||
|       tasks = "clean test" | ||||
|       buildFile = "" | ||||
|       enableStacktrace = true | ||||
|       param("org.jfrog.artifactory.selectedDeployableServer.defaultModuleVersionConfiguration", "GLOBAL") | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   triggers { | ||||
|     vcs { | ||||
|       branchFilter = "" | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   requirements { | ||||
|     noLessThanVer("teamcity.agent.jvm.version", "1.8") | ||||
|   } | ||||
|  | ||||
|   failureConditions { | ||||
|     failOnMetricChange { | ||||
|       metric = BuildFailureOnMetric.MetricType.TEST_COUNT | ||||
|       threshold = 20 | ||||
|       units = BuildFailureOnMetric.MetricUnit.PERCENTS | ||||
|       comparison = BuildFailureOnMetric.MetricComparison.LESS | ||||
|       compareTo = build { | ||||
|         buildRule = lastSuccessful() | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| }) | ||||
|  | ||||
|  | ||||
| object TestsForIntelliJ20213 : TestsForIntelliJ_213_221_branch("2021.3.2") | ||||
							
								
								
									
										18
									
								
								.teamcity/_Self/subprojects/OldTests.kt
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										18
									
								
								.teamcity/_Self/subprojects/OldTests.kt
									
									
									
									
										vendored
									
									
								
							| @@ -8,18 +8,26 @@ import _Self.buildTypes.TestsForIntelliJ20192 | ||||
| import _Self.buildTypes.TestsForIntelliJ20193 | ||||
| import _Self.buildTypes.TestsForIntelliJ20201 | ||||
| import _Self.buildTypes.TestsForIntelliJ20202 | ||||
| import _Self.buildTypes.TestsForIntelliJ20203 | ||||
| import _Self.buildTypes.TestsForIntelliJ20211 | ||||
| import _Self.buildTypes.TestsForIntelliJ20212 | ||||
| import _Self.buildTypes.TestsForIntelliJ20213 | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.Project | ||||
|  | ||||
| object OldTests : Project({ | ||||
|   name = "Old IdeaVim tests" | ||||
|   description = "Tests for older versions of IJ" | ||||
|  | ||||
|   buildType(TestsForIntelliJ20202) | ||||
|   buildType(TestsForIntelliJ20201) | ||||
|   buildType(TestsForIntelliJ20191) | ||||
|   buildType(TestsForIntelliJ20181) | ||||
|   buildType(TestsForIntelliJ20192) | ||||
|   buildType(TestsForIntelliJ20182) | ||||
|   buildType(TestsForIntelliJ20193) | ||||
|   buildType(TestsForIntelliJ20183) | ||||
|   buildType(TestsForIntelliJ20191) | ||||
|   buildType(TestsForIntelliJ20192) | ||||
|   buildType(TestsForIntelliJ20193) | ||||
|   buildType(TestsForIntelliJ20201) | ||||
|   buildType(TestsForIntelliJ20202) | ||||
|   buildType(TestsForIntelliJ20203) | ||||
|   buildType(TestsForIntelliJ20211) | ||||
|   buildType(TestsForIntelliJ20212) | ||||
|   buildType(TestsForIntelliJ20213) | ||||
| }) | ||||
|   | ||||
							
								
								
									
										12
									
								
								.teamcity/_Self/vcsRoots/Branch_203_212.kt
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								.teamcity/_Self/vcsRoots/Branch_203_212.kt
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | ||||
| @file:Suppress("ClassName") | ||||
|  | ||||
| package _Self.vcsRoots | ||||
|  | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.vcs.GitVcsRoot | ||||
|  | ||||
| object Branch_203_212 : GitVcsRoot({ | ||||
|   name = "https://github.com/JetBrains/ideavim (branch 203-212)" | ||||
|   url = "https://github.com/JetBrains/ideavim.git" | ||||
|   branch = "203-212" | ||||
|   useMirrors = false | ||||
| }) | ||||
							
								
								
									
										12
									
								
								.teamcity/_Self/vcsRoots/Branch_213_221.kt
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								.teamcity/_Self/vcsRoots/Branch_213_221.kt
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | ||||
| @file:Suppress("ClassName") | ||||
|  | ||||
| package _Self.vcsRoots | ||||
|  | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.vcs.GitVcsRoot | ||||
|  | ||||
| object Branch_213_221 : GitVcsRoot({ | ||||
|   id("HttpsGithubComJetBrainsIdeavimBranch213221") | ||||
|   name = "https://github.com/JetBrains/ideavim (branch 213-221)" | ||||
|   url = "https://github.com/JetBrains/ideavim.git" | ||||
|   branch = "213-221" | ||||
| }) | ||||
							
								
								
									
										11
									
								
								.teamcity/_Self/vcsRoots/Branch_Release.kt
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								.teamcity/_Self/vcsRoots/Branch_Release.kt
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| @file:Suppress("ClassName") | ||||
|  | ||||
| package _Self.vcsRoots | ||||
|  | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.vcs.GitVcsRoot | ||||
|  | ||||
| object Branch_Release : GitVcsRoot({ | ||||
|   name = "https://github.com/JetBrains/ideavim (branch release)" | ||||
|   url = "https://github.com/JetBrains/ideavim.git" | ||||
|   branch = "release" | ||||
| }) | ||||
							
								
								
									
										29
									
								
								.teamcity/patches/buildTypes/Qodana.kts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										29
									
								
								.teamcity/patches/buildTypes/Qodana.kts
									
									
									
									
										vendored
									
									
								
							| @@ -2,6 +2,7 @@ package patches.buildTypes | ||||
|  | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.* | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.Qodana | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.gradle | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.qodana | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.ui.* | ||||
|  | ||||
| @@ -14,25 +15,41 @@ changeBuildType(RelativeId("Qodana")) { | ||||
|     expectSteps { | ||||
|         qodana { | ||||
|             name = "Qodana" | ||||
|             reportAsTestsEnable = "true" | ||||
|             failBuildOnErrors = "" | ||||
|             codeInspectionXmlConfig = "Custom" | ||||
|             codeInspectionCustomXmlConfigPath = ".idea/inspectionProfiles/Qodana.xml" | ||||
|             linter = jvm { | ||||
|                 version = Qodana.JVMVersion.LATEST | ||||
|             } | ||||
|             param("clonefinder-enable", "true") | ||||
|             param("clonefinder-languages", "Java") | ||||
|             param("clonefinder-languages-container", "Java Kotlin") | ||||
|             param("clonefinder-mode", "") | ||||
|             param("clonefinder-queried-project", "src") | ||||
|             param("clonefinder-reference-projects", "src") | ||||
|             param("licenseaudit-enable", "true") | ||||
|             param("namesAndTagsCustom", "repo.labs.intellij.net/static-analyser/qodana") | ||||
|             param("report-version", "") | ||||
|             param("yaml-configuration", "") | ||||
|         } | ||||
|     } | ||||
|     steps { | ||||
|         update<Qodana>(0) { | ||||
|         insert(0) { | ||||
|             gradle { | ||||
|                 name = "Generate grammar" | ||||
|                 tasks = "generateGrammarSource" | ||||
|                 param("org.jfrog.artifactory.selectedDeployableServer.defaultModuleVersionConfiguration", "GLOBAL") | ||||
|             } | ||||
|         } | ||||
|         update<Qodana>(1) { | ||||
|             clearConditions() | ||||
|             param("licenseaudit-enable", "true") | ||||
|             reportAsTests = true | ||||
|             argumentsCommandDocker = "-e QODANA_TOKEN=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJvcmdhbml6YXRpb24iOiIzUFZrQSIsInByb2plY3QiOiIzN1FlQSIsInRva2VuIjoiM0t2bXoifQ.uohp81tM7iAfvvB6k8faarfpV-OjusAaEbWQ8iNrOgs" | ||||
|             argumentsEntryPointDocker = "--baseline qodana.sarif.json" | ||||
|             param("clonefinder-languages", "") | ||||
|             param("collect-anonymous-statistics", "") | ||||
|             param("licenseaudit-enable", "") | ||||
|             param("clonefinder-languages-container", "") | ||||
|             param("clonefinder-queried-project", "") | ||||
|             param("clonefinder-enable", "") | ||||
|             param("clonefinder-reference-projects", "") | ||||
|         } | ||||
|     } | ||||
| } | ||||
|   | ||||
							
								
								
									
										16
									
								
								.teamcity/patches/buildTypes/Release.kts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										16
									
								
								.teamcity/patches/buildTypes/Release.kts
									
									
									
									
										vendored
									
									
								
							| @@ -1,16 +0,0 @@ | ||||
| package patches.buildTypes | ||||
|  | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.* | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.ui.* | ||||
|  | ||||
| /* | ||||
| This patch script was generated by TeamCity on settings change in UI. | ||||
| To apply the patch, change the buildType with id = 'Release' | ||||
| accordingly, and delete the patch script. | ||||
| */ | ||||
| changeBuildType(RelativeId("Release")) { | ||||
|     vcs { | ||||
|         remove(DslContext.settingsRoot.id!!) | ||||
|         add(RelativeId("Branch_Release")) | ||||
|     } | ||||
| } | ||||
							
								
								
									
										27
									
								
								.teamcity/patches/buildTypes/ReleaseEap.kts
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								.teamcity/patches/buildTypes/ReleaseEap.kts
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,27 @@ | ||||
| package patches.buildTypes | ||||
|  | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.* | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.buildFeatures.VcsLabeling | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.buildFeatures.vcsLabeling | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.ui.* | ||||
|  | ||||
| /* | ||||
| This patch script was generated by TeamCity on settings change in UI. | ||||
| To apply the patch, change the buildType with id = 'ReleaseEap' | ||||
| accordingly, and delete the patch script. | ||||
| */ | ||||
| changeBuildType(RelativeId("ReleaseEap")) { | ||||
|     features { | ||||
|         val feature1 = find<VcsLabeling> { | ||||
|             vcsLabeling { | ||||
|                 vcsRootId = "${DslContext.settingsRoot.id}" | ||||
|                 labelingPattern = "%system.build.number%" | ||||
|                 successfulOnly = true | ||||
|                 branchFilter = "" | ||||
|             } | ||||
|         } | ||||
|         feature1.apply { | ||||
|             successfulOnly = false | ||||
|         } | ||||
|     } | ||||
| } | ||||
							
								
								
									
										18
									
								
								.teamcity/patches/vcsRoots/Branch_Release.kts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										18
									
								
								.teamcity/patches/vcsRoots/Branch_Release.kts
									
									
									
									
										vendored
									
									
								
							| @@ -1,18 +0,0 @@ | ||||
| package patches.vcsRoots | ||||
|  | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.* | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.ui.* | ||||
| import jetbrains.buildServer.configs.kotlin.v2019_2.vcs.GitVcsRoot | ||||
|  | ||||
| /* | ||||
| This patch script was generated by TeamCity on settings change in UI. | ||||
| To apply the patch, create a vcsRoot with id = 'Branch_Release' | ||||
| in the root project, and delete the patch script. | ||||
| */ | ||||
| create(DslContext.projectId, GitVcsRoot({ | ||||
|     id("Branch_Release") | ||||
|     name = "https://github.com/JetBrains/ideavim (branch release)" | ||||
|     url = "https://github.com/JetBrains/ideavim.git" | ||||
|     branch = "release" | ||||
| })) | ||||
|  | ||||
							
								
								
									
										109
									
								
								AUTHORS.md
									
									
									
									
									
								
							
							
						
						
									
										109
									
								
								AUTHORS.md
									
									
									
									
									
								
							| @@ -32,16 +32,48 @@ Contributors: | ||||
|   [![icon][github]](https://github.com/yole) | ||||
|     | ||||
|   Dmitry Jemerov | ||||
| * [![icon][mail]](mailto:tony.kay@gmail.com) | ||||
|   [![icon][github]](https://github.com/awkay) | ||||
|     | ||||
|   Tony Kay | ||||
| * [![icon][mail]](mailto:jamescmartinez@gmail.com) | ||||
|   [![icon][github]](https://github.com/jamescmartinez) | ||||
|     | ||||
|   James Martinez | ||||
| * [![icon][mail]](mailto:almas337519@gmail.com) | ||||
|   [![icon][github]](https://github.com/strogiyotec) | ||||
|     | ||||
|   strogiyotec | ||||
| * [![icon][mail]](mailto:raimon49@hotmail.com) | ||||
|   [![icon][github]](https://github.com/raimon49) | ||||
|     | ||||
|   raimon | ||||
| * [![icon][mail]](mailto:agrsbm@gmail.com) | ||||
|   [![icon][github-off]](#) | ||||
|     | ||||
|   Alexander Griesbaum | ||||
| * [![icon][mail]](mailto:manwe64@gmail.com) | ||||
|   [![icon][github]](https://github.com/baldrs) | ||||
|     | ||||
|   Baldrs | ||||
| * [![icon][mail]](mailto:yury@shurup.com) | ||||
|   [![icon][github]](https://github.com/zyv) | ||||
|     | ||||
|   Yury V. Zaytsev | ||||
| * [![icon][mail]](mailto:jflorian@doubledog.org) | ||||
|   [![icon][github]](https://github.com/jflorian) | ||||
|     | ||||
|   John Florian | ||||
| * [![icon][mail]](mailto:marquis@marquiswang.com) | ||||
|   [![icon][github]](https://github.com/marquiswang) | ||||
|     | ||||
|   Marquis Wang | ||||
| * [![icon][mail]](mailto:madgnome@gmail.com) | ||||
|   [![icon][github-off]](#) | ||||
|   [![icon][github]](https://github.com/madgnome) | ||||
|     | ||||
|   Julien Hoarau   | ||||
| * [![icon][mail]](mailto:masanobu.imai@gmail.com) | ||||
|   [![icon][github-off]](#) | ||||
|   [![icon][github]](https://github.com/masanobuimai) | ||||
|     | ||||
|   Masanobu Imai | ||||
| * [![icon][mail]](mailto:poxvuibr@gmail.com) | ||||
| @@ -57,7 +89,7 @@ Contributors: | ||||
|     | ||||
|   John Lindquist | ||||
| * [![icon][mail]](mailto:iklotzko@ltech.com) | ||||
|   [![icon][github-off]](#) | ||||
|   [![icon][github]](https://github.com/iklotzko) | ||||
|     | ||||
|   Ira Klotzko | ||||
| * [![icon][mail]](mailto:alex@selesse.com) | ||||
| @@ -65,7 +97,7 @@ Contributors: | ||||
|     | ||||
|   Alex Selesse | ||||
| * [![icon][mail]](mailto:dbennett@palantir.com) | ||||
|   [![icon][github-off]](#) | ||||
|   [![icon][github]](https://github.com/dathanb) | ||||
|     | ||||
|   Dathan Bennett | ||||
| * [![icon][mail]](mailto:kphayen@gmail.com) | ||||
| @@ -77,11 +109,11 @@ Contributors: | ||||
|     | ||||
|   Alexey Shmalko | ||||
| * [![icon][mail]](mailto:a.m.brookins@gmail.com) | ||||
|   [![icon][github-off]](#) | ||||
|   [![icon][github]](https://github.com/abrookins) | ||||
|     | ||||
|   Andrew Brookins | ||||
| * [![icon][mail]](mailto:changwang83@gmail.com) | ||||
|   [![icon][github-off]](#) | ||||
|   [![icon][github]](https://github.com/changwang) | ||||
|     | ||||
|   Chang Wang | ||||
| * [![icon][mail]](mailto:josejaime.sanchez@gmail.com) | ||||
| @@ -89,19 +121,19 @@ Contributors: | ||||
|     | ||||
|   Jaime Sanchez | ||||
| * [![icon][mail]](mailto:thomas@homburg.dk) | ||||
|   [![icon][github-off]](#) | ||||
|   [![icon][github]](https://github.com/homburg) | ||||
|     | ||||
|   Thomas B Homburg | ||||
| * [![icon][mail]](mailto:smartbomb@server.fake) | ||||
|   [![icon][github-off]](#) | ||||
|   [![icon][github]](https://github.com/smartbomb) | ||||
|     | ||||
|   smartbomb | ||||
| * [![icon][mail]](mailto:tuomas.tynkkynen@iki.fi) | ||||
|   [![icon][github-off]](#) | ||||
|   [![icon][github]](https://github.com/dezgeg) | ||||
|     | ||||
|   Tuomas Tynkkynen | ||||
| * [![icon][mail]](mailto:jackson@donorschoose.org) | ||||
|   [![icon][github-off]](#) | ||||
|   [![icon][github]](https://github.com/jdpopkin) | ||||
|     | ||||
|   Jackson Popkin | ||||
| * [![icon][mail]](mailto:yuyuyu1999@gmail.com) | ||||
| @@ -109,7 +141,7 @@ Contributors: | ||||
|     | ||||
|   Teruo Kunihiro | ||||
| * [![icon][mail]](mailto:lubashka.994@mail.ru) | ||||
|   [![icon][github-off]](#) | ||||
|   [![icon][github]](https://github.com/lubba) | ||||
|     | ||||
|   Liubov Paina | ||||
| * [![icon][mail]](mailto:me@dhleong.net) | ||||
| @@ -137,7 +169,7 @@ Contributors: | ||||
|     | ||||
|   tieTYT | ||||
| * [![icon][mail]](mailto:nickgieschen@gmail.com) | ||||
|   [![icon][github-off]](#) | ||||
|   [![icon][github]](https://github.com/nickgieschen) | ||||
|     | ||||
|   Nick Gieschen | ||||
| * [![icon][mail]](mailto:ikenox@gmail.com) | ||||
| @@ -149,7 +181,7 @@ Contributors: | ||||
|     | ||||
|   Maximilian Luz | ||||
| * [![icon][mail]](mailto:vparfinenko@excelsior-usa.com) | ||||
|   [![icon][github-off]](#) | ||||
|   [![icon][github]](https://github.com/cypok) | ||||
|     | ||||
|   Vladimir Parfinenko | ||||
| * [![icon][mail]](mailto:hassmann@hwdev.de) | ||||
| @@ -193,7 +225,7 @@ Contributors: | ||||
|     | ||||
|   Marcel Hild | ||||
| * [![icon][mail]](mailto:vedranb@gmail.com) | ||||
|   [![icon][github-off]](#) | ||||
|   [![icon][github]](https://github.com/vedran) | ||||
|     | ||||
|   Vedran Budimcic | ||||
| * [![icon][mail]](mailto:andreigasparovici1@gmail.com) | ||||
| @@ -208,10 +240,13 @@ Contributors: | ||||
|   [![icon][github]](https://github.com/TonyArra) | ||||
|     | ||||
|   Tony Arra | ||||
| * [![icon][mail]](mailto:bradziolko@gmail.com) | ||||
|   [![icon][github]](https://github.com/bradziolko) | ||||
| * [![icon][mail]](mailto:mj@ziolko.dev) | ||||
|   [![icon][github]](https://github.com/mjziolko) | ||||
|     | ||||
|   Brad Ziolko | ||||
|   Madeline Ziolko | ||||
|   [Original contribution from: | ||||
|   [![icon][mail]](mailto:bradziolko@gmail.com) | ||||
|   [![icon][github]](https://github.com/bradziolko)] | ||||
| * [![icon][mail]](mailto:sumoooru2@gmail.com) | ||||
|   [![icon][github]](https://github.com/sumoooru2) | ||||
|     | ||||
| @@ -380,6 +415,46 @@ Contributors: | ||||
|   [![icon][github]](https://github.com/chylex) | ||||
|     | ||||
|   chylex | ||||
| * [![icon][mail]](mailto:daniel.egger@gmail.com) | ||||
|   [![icon][github]](https://github.com/DanEEStar) | ||||
|     | ||||
|   DanEEStar | ||||
| * [![icon][mail]](mailto:ksrbkevinsuen@gmail.com) | ||||
|   [![icon][github]](https://github.com/ksrb) | ||||
|     | ||||
|   Kevin Suen | ||||
| * [![icon][mail]](mailto:michael.schertenleib@inftec.ch) | ||||
|   [![icon][github]](https://github.com/cravay) | ||||
|     | ||||
|   Michael Schertenleib | ||||
| * [![icon][mail]](mailto:piotr@near.org) | ||||
|   [![icon][github]](https://github.com/pmnoxx) | ||||
|     | ||||
|   Piotr Mikulski | ||||
| * [![icon][mail]](mailto:lonrevip@gmail.com) | ||||
|   [![icon][github]](https://github.com/lonre) | ||||
|     | ||||
|   Lonre Wang | ||||
| * [![icon][mail]](mailto:AlexPl292@gmail.com) | ||||
|   [![icon][github]](https://github.com/AlexPl292) | ||||
|     | ||||
|   Alex Pláte | ||||
| * [![icon][mail]](mailto:david@dadon.fr) | ||||
|   [![icon][github]](https://github.com/ddadon10) | ||||
|     | ||||
|   David Dadon | ||||
| * [![icon][mail]](mailto:hollandpirates@gmail.com) | ||||
|   [![icon][github]](https://github.com/PHPirates) | ||||
|     | ||||
|   Thomas Schouten | ||||
| * [![icon][mail]](mailto:sr@mail25.de) | ||||
|   [![icon][github]](https://github.com/Vvalter) | ||||
|     | ||||
|   Simon Rainer | ||||
| * [![icon][mail]](mailto:filipp.vakhitov@jetbrains.com) | ||||
|   [![icon][github]](https://github.com/lippfi) | ||||
|     | ||||
|   lippfi | ||||
|                          | ||||
| If you are a contributor and your name is not listed here, feel free to | ||||
| contact the maintainers. | ||||
|   | ||||
							
								
								
									
										84
									
								
								CHANGES.md
									
									
									
									
									
								
							
							
						
						
									
										84
									
								
								CHANGES.md
									
									
									
									
									
								
							| @@ -25,15 +25,93 @@ usual beta standards. | ||||
|  | ||||
| ## To Be Released | ||||
|  | ||||
| ### Fixes: | ||||
| * [VIM-1758](https://youtrack.jetbrains.com/issue/VIM-1758) Commentary plugin in rider | ||||
| * [VIM-1903](https://youtrack.jetbrains.com/issue/VIM-1903) Autoindent now works in rider | ||||
| * [VIM-2744](https://youtrack.jetbrains.com/issue/VIM-2744) Fix undo from ex line | ||||
| * [VIM-2749](https://youtrack.jetbrains.com/issue/VIM-2749) Fix :tabn and :tabN commands | ||||
| * [VIM-2718](https://youtrack.jetbrains.com/issue/VIM-2718) Fixed case where the primary caret was changed | ||||
| * [VIM-2766](https://youtrack.jetbrains.com/issue/VIM-2766) Move NERDTree update to background thread | ||||
| * [VIM-2768](https://youtrack.jetbrains.com/issue/VIM-2768) Refactor listeners | ||||
|  | ||||
| ## 1.11.0, 2022-08-09 | ||||
|  | ||||
| ### Features: | ||||
| * Add register support to let command | [VIM-749](https://youtrack.jetbrains.com/issue/VIM-749) | ||||
| * Add register support to let command | [VIM-1783](https://youtrack.jetbrains.com/issue/VIM-1783) | ||||
| * Add `trackactionids`/`tai` option to track action ids | ||||
| * Add `gcu` command for Commentary plugin | ||||
| * Add `:Commentary` command, which works great for commands such as `:%g/fun/Commentary` | ||||
| * Support `gc` – commentary text objects. E.g. `dgc`: delete commented text. | ||||
| * Support `redo-register feature` | [VIM-2643](https://youtrack.jetbrains.com/issue/VIM-2643/Dot-operator-doesn-t-increment-number-register-after-pasting-fro) | [viminfo](http://vimdoc.sourceforge.net/htmldoc/undo.html#redo-register) | ||||
|  | ||||
| ### Changes: | ||||
| * Uses the same mappings as Commentary, so custom bindings for the Vim plugin will work with IdeaVim, too. | ||||
|   E.g. `<Plug>Commentary` instead of `<Plug>(CommentMotion)`. Old mappings are maintained for compatibility. | ||||
| * If you open `~/.ideavimrc` in IDE, remove a mapping, and reload the config using the reload button, | ||||
|   the mapping will actually be unmapped. | ||||
| * New vim (and IdeaVim) behaviour: `ci(`& friends searches for the brackets in the line. | ||||
|  | ||||
| ### Fixes: | ||||
| * [VIM-2587](https://youtrack.jetbrains.com/issue/VIM-2587) Use ctrl-6 as ctrl-^ | ||||
| * [VIM-2590](https://youtrack.jetbrains.com/issue/VIM-2590) Fix caret shape in PyCharm | ||||
| * [VIM-2553](https://youtrack.jetbrains.com/issue/VIM-2553) Substitute consecutive matches | ||||
| * [VIM-1687](https://youtrack.jetbrains.com/issue/VIM-1687) Support count for `gcc` | ||||
| * [VIM-2381](https://youtrack.jetbrains.com/issue/VIM-2381) Fall back to line comment if block comment is not available | ||||
| * [VIM-2589](https://youtrack.jetbrains.com/issue/VIM-2589) Add `gc` text object | ||||
| * [VIM-2604](https://youtrack.jetbrains.com/issue/VIM-2604) Update action execution rules | ||||
| * [VIM-2654](https://youtrack.jetbrains.com/issue/VIM-2654) Add support for `return` without expression | ||||
| * [VIM-2630](https://youtrack.jetbrains.com/issue/VIM-2630/Please-fix-warning-Shall-not-be-called-on-a-template-presentatio) Fix IDE freeze | ||||
| * [VIM-2661](https://youtrack.jetbrains.com/issue/VIM-2661/Spamming-does-not-work) Fix repeating the `@@` command | ||||
| * [VIM-2668](https://youtrack.jetbrains.com/issue/VIM-2668/tabm-or-tabm-with-no-number-does-not-match-vim-behavior) Fix omitted numbers in `tabm` command | ||||
| * [VIM-2595](https://youtrack.jetbrains.com/issue/VIM-2595) Support plugins in macro execution | ||||
| * [VIM-2671](https://youtrack.jetbrains.com/issue/VIM-2671) Fix using plugins from mappings | ||||
| * [VIM-2675](https://youtrack.jetbrains.com/issue/VIM-2675) Fix numbering register in visual mode | ||||
| * [VIM-744](https://youtrack.jetbrains.com/issue/VIM-744/Use-undoredo-with-count-modifier) Add count to undo/redo | ||||
| * [VIM-1862](https://youtrack.jetbrains.com/issue/VIM-1862/Ex-commands-executed-in-keymaps-and-macros-are-added-to-the-command-history) Fix command history | ||||
| * [VIM-2227](https://youtrack.jetbrains.com/issue/VIM-2227) Wrong behavior when deleting / changing surround with invalid character | ||||
| * [VIM-2691](https://youtrack.jetbrains.com/issue/VIM-2691) Save file on :w | ||||
| * [VIM-2710](https://youtrack.jetbrains.com/issue/VIM-2710) Show options value on `set opt` | ||||
| * [VIM-913](https://youtrack.jetbrains.com/issue/VIM-913) Partially fix the issue with macros and autocompletion | ||||
| * [VIM-2723](https://youtrack.jetbrains.com/issue/VIM-2723) Move focus to editor after :q | ||||
| * [VIM-2728](https://youtrack.jetbrains.com/issue/VIM-2728) Give access to global variables | ||||
|  | ||||
| ### Merged PRs: | ||||
| * [468](https://github.com/JetBrains/ideavim/pull/468) by [Thomas Schouten](https://github.com/PHPirates): Implement UserDataHolder for EditorDataContext | ||||
| * [483](https://github.com/JetBrains/ideavim/pull/483) by [Simon Rainer](https://github.com/Vvalter): Fix(VIM-2553): Substitute consecutive matches | ||||
| * [488](https://github.com/JetBrains/ideavim/pull/488) by [Martin Yzeiri](https://github.com/myzeiri): Add Matchit support for the C family of languages | ||||
| * [493](https://github.com/JetBrains/ideavim/pull/493) by [Matt Ellis](https://github.com/citizenmatt): Improvements to Commentary extension | ||||
| * [494](https://github.com/JetBrains/ideavim/pull/494) by [Matt Ellis](https://github.com/citizenmatt): Cleanup pre-212 CaretVisualAttributes compatibility code | ||||
| * [504](https://github.com/JetBrains/ideavim/pull/504) by [Matt Ellis](https://github.com/citizenmatt): Minor bug fixes | ||||
| * [519](https://github.com/JetBrains/ideavim/pull/519) by [chylex](https://github.com/chylex): Fix(VIM-2227): Wrong behavior when deleting / changing surround with invalid character | ||||
| * [525](https://github.com/JetBrains/ideavim/pull/525) by [Matt Ellis](https://github.com/citizenmatt): Improve handling of fractional width fonts | ||||
| * [526](https://github.com/JetBrains/ideavim/pull/526) by [Alex Pláte](https://github.com/AlexPl292): Create gradle.properties | ||||
| * [528](https://github.com/JetBrains/ideavim/pull/528) by [chylex](https://github.com/chylex): Implement partial code completion support in macros | ||||
| * [531](https://github.com/JetBrains/ideavim/pull/531) by [Matt Ellis](https://github.com/citizenmatt): Consolidate doTest methods | ||||
|  | ||||
| ## 1.10.0, 2022-02-17 | ||||
|  | ||||
| ### Features: | ||||
| * Add register support to let command | [VIM-749](https://youtrack.jetbrains.com/issue/VIM-749), [VIM-1783](https://youtrack.jetbrains.com/issue/VIM-1783) | ||||
| * Add tabmove command | [VIM-1164](https://youtrack.jetbrains.com/issue/VIM-1164) | ||||
|  | ||||
| ### Fixes: | ||||
| * [VIM-2502](https://youtrack.jetbrains.com/issue/VIM-2502) Fix the shape of new carets | ||||
| * [VIM-2499](https://youtrack.jetbrains.com/issue/VIM-2499) Fix mapping to esc | ||||
| * [VIM-2500](https://youtrack.jetbrains.com/issue/VIM-2500) Fix esc for normal mode | ||||
| * [VIM-2523](https://youtrack.jetbrains.com/issue/VIM-2523) `i` command for the folder in the project tree | ||||
| * [VIM-2471](https://youtrack.jetbrains.com/issue/VIM-2471) Multiple [{ and ]} actions | ||||
| * [VIM-2504](https://youtrack.jetbrains.com/issue/VIM-2504) Fix esc with using python notebooks | ||||
| * [VIM-2540](https://youtrack.jetbrains.com/issue/VIM-2540) Fix option listeners | ||||
| * [VIM-2548](https://youtrack.jetbrains.com/issue/VIM-2548) Fix paste | ||||
| * [VIM-2470](https://youtrack.jetbrains.com/issue/VIM-2470) Fix incorrect reset of cursor shape | ||||
| * [VIM-2223](https://youtrack.jetbrains.com/issue/VIM-2223), [VIM-1684](https://youtrack.jetbrains.com/issue/VIM-1684), [VIM-2491](https://youtrack.jetbrains.com/issue/VIM-2491) Fix `gv` | ||||
|  | ||||
| ### Merged PRs: | ||||
| * [441](https://github.com/JetBrains/ideavim/pull/441) by [DanEEStar](https://github.com/DanEEStar): Add Matchit support for Vue.js files | ||||
| * [440](https://github.com/JetBrains/ideavim/pull/440) by [Kevin Suen](https://github.com/ksrb): Add matchit support for handlebars | ||||
| * [448](https://github.com/JetBrains/ideavim/pull/448) by [Michael Schertenleib](https://github.com/cravay): Support custom element names in vim-surround | ||||
| * [435](https://github.com/JetBrains/ideavim/pull/435) by [Piotr Mikulski](https://github.com/pmnoxx): Print stderr when running a command just like vim does | ||||
| * [449](https://github.com/JetBrains/ideavim/pull/449) by [Lonre Wang](https://github.com/lonre): Typo fix | ||||
| * [453](https://github.com/JetBrains/ideavim/pull/453) by [Matt Ellis](https://github.com/citizenmatt): fix(VIM-2470): Fix incorrect reset of cursor shape | ||||
| * [461](https://github.com/JetBrains/ideavim/pull/461) by [David Dadon](https://github.com/ddadon10): Add shortcut to ideajoin example | ||||
|  | ||||
| ## 1.9.0, 2021-12-10 | ||||
|  | ||||
|   | ||||
| @@ -4,6 +4,9 @@ IdeaVim is an open source project created by 80+ contributors. Would you like to | ||||
|  | ||||
| This page is created to help you start contributing. And who knows, maybe in a few days this project will be brighter than ever! | ||||
|  | ||||
| :warning: The plugin is currently under a huge refactoring aiming to split into vim-engine and IdeaVim in order to | ||||
| support the new [Fleet IDE](https://www.jetbrains.com/fleet/). Please see [Fleet refactoring](#Fleet-refactoring). | ||||
|  | ||||
| ## Before you begin | ||||
|  | ||||
| - The project is written in Kotlin and Java. Choose whichever language you feel more comfortable with, | ||||
| @@ -29,7 +32,7 @@ OK, ready to do some coding? | ||||
| Yoo hoo! You’re all set to begin contributing. | ||||
| We've prepared some useful configurations for you: | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| And here are useful gradle commands: | ||||
|  | ||||
| @@ -71,7 +74,7 @@ If you are looking for: | ||||
|  | ||||
| - Common features: | ||||
|     - State machine. How every particular keystroke is parsed in IdeaVim: `KeyHandler.handleKey()`. | ||||
|     - Options (`incsearch`, `iskeyword`, `relativenumber`): `OptionsManager`. | ||||
|     - Options (`incsearch`, `iskeyword`, `relativenumber`): `OptionServiceImpl`. | ||||
|     - Plugin startup: `PluginStartup`. | ||||
|     - Notifications: `NotificationService`. | ||||
|     - Status bar icon: `StatusBar.kt`. | ||||
| @@ -117,6 +120,17 @@ so you can reuse your `.vimrc` settings. | ||||
| We also support proper command mappings (functions are mapped to `<Plug>...`), the operator function (`OperatorFunction`), and so on. | ||||
| - Magic is supported as well. See `Magic`. | ||||
|  | ||||
|  | ||||
| ## Fleet refactoring | ||||
| At the moment, IdeaVim is under an active refactoring aiming to split IdeaVim into two modules: vim-engine and IdeaVim. | ||||
|  | ||||
| If you develop a plugin that depends on IdeaVim: We have an instrument to check that our changes don't affect | ||||
| the plugins in the marketplace. Also, we commit to support currently used API at least till the end of 2022. | ||||
| If you still encounter any issues with the newer versions of IdeaVim, please [contact maintainers](https://github.com/JetBrains/ideavim#contact-maintainers). | ||||
| We kindly ask you not to use anything from the new API (like `VimEditor`, `injector`) because at the moment we don't | ||||
| guarantee the compatibility of this API in the future versions. | ||||
|  | ||||
|  | ||||
| ----- | ||||
|  | ||||
| ### I read the whole page but something is still unclear. | ||||
|   | ||||
							
								
								
									
										14
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								README.md
									
									
									
									
									
								
							| @@ -11,7 +11,7 @@ IdeaVim | ||||
| [![Gitter][gitter-svg]][gitter] | ||||
| [![Twitter][twitter-svg]][twitter] | ||||
|  | ||||
| IdeaVim is a Vim emulation plugin for IntelliJ Platform-based IDEs. | ||||
| IdeaVim is a Vim engine for JetBrains IDEs. | ||||
|  | ||||
| ##### Contact maintainers: | ||||
| * [Bug tracker](https://youtrack.jetbrains.com/issues/VIM) | ||||
| @@ -36,7 +36,7 @@ Setup | ||||
| - IdeaVim can be installed via `Settings | Plugins`. | ||||
| See the [detailed instructions](https://www.jetbrains.com/help/idea/managing-plugins.html#). | ||||
|  | ||||
| - Use `Tools | Vim Emulator` in the menu to enable or disable emulation. | ||||
| - Use `Tools | Vim` in the menu to enable or disable vim. | ||||
|  | ||||
| - Use the `~/.ideavimrc` file as an analog of `~/.vimrc` ([learn more](#Files)). The XDG standard is supported, as well. | ||||
|  | ||||
| @@ -88,7 +88,7 @@ Here are some examples of supported vim features and commands: | ||||
| * Vim web help | ||||
| * `~/.ideavimrc` configuration file | ||||
|  | ||||
| [Emulated Vim plugins](https://github.com/JetBrains/ideavim/wiki/Emulated-plugins): | ||||
| [IdeaVim plugins](https://github.com/JetBrains/ideavim/wiki/Emulated-plugins): | ||||
|  | ||||
| * vim-easymotion | ||||
| * NERDTree | ||||
| @@ -198,7 +198,7 @@ Alternatively, you can set up initialization commands using [XDG](https://specif | ||||
| Put your settings to `$XDG_CONFIG_HOME/ideavim/ideavimrc` file. | ||||
|  | ||||
|  | ||||
| Emulated Vim Plugins | ||||
| IdeaVim Plugins | ||||
| -------------------- | ||||
|  | ||||
| See [doc/emulated-plugins.md](https://github.com/JetBrains/ideavim/wiki/Emulated-plugins) | ||||
| @@ -212,6 +212,7 @@ Ex commands or via `:map` command mappings: | ||||
| ### Executing actions: | ||||
| * `:action {action_id}` | ||||
|     * Execute an action by `{action_id}`. Works from Ex command line. | ||||
|     * Please don't use `:action` in mappings. Use `<Action>` instead. | ||||
| * `<Action>({action_id})` | ||||
|     * For the mappings you can use a special `<Action>` keyword. Don't forget the parentheses. | ||||
|     * E.g. `map gh <Action>(ShowErrorDescription)`  <- execute hover on `gh`. | ||||
| @@ -225,7 +226,10 @@ Ex commands or via `:map` command mappings: | ||||
|  | ||||
|     <details> | ||||
|         <summary><strong>"Track action Ids" Details</strong> (click to see)</summary> | ||||
|         <img src="assets/readme/track_action_id.gif" alt="track action ids"/> | ||||
|         <picture> | ||||
|             <source media="(prefers-color-scheme: dark)" srcset="assets/readme/track_action_dark.gif"> | ||||
|             <img src="assets/readme/track_action_light.gif" alt="track action ids"/> | ||||
|         </picture> | ||||
|     </details> | ||||
|  | ||||
|  | ||||
|   | ||||
							
								
								
									
										
											BIN
										
									
								
								assets/contributing/configs-dark.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								assets/contributing/configs-dark.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 27 KiB | 
							
								
								
									
										
											BIN
										
									
								
								assets/contributing/configs-light.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								assets/contributing/configs-light.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 31 KiB | 
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 22 KiB | 
							
								
								
									
										
											BIN
										
									
								
								assets/readme/track_action_dark.gif
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								assets/readme/track_action_dark.gif
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 1.0 MiB | 
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 2.1 MiB | 
							
								
								
									
										
											BIN
										
									
								
								assets/readme/track_action_light.gif
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								assets/readme/track_action_light.gif
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 981 KiB | 
							
								
								
									
										160
									
								
								build.gradle.kts
									
									
									
									
									
								
							
							
						
						
									
										160
									
								
								build.gradle.kts
									
									
									
									
									
								
							| @@ -11,24 +11,26 @@ buildscript { | ||||
|     } | ||||
|  | ||||
|     dependencies { | ||||
|         classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.10") | ||||
|         classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21") | ||||
|         classpath("com.github.AlexPl292:mark-down-to-slack:1.1.2") | ||||
|         classpath("org.eclipse.jgit:org.eclipse.jgit:5.13.0.202109080827-r") | ||||
|         classpath("org.kohsuke:github-api:1.301") | ||||
|         classpath("org.jetbrains:markdown:0.2.4") | ||||
|         classpath("org.eclipse.jgit:org.eclipse.jgit:6.1.0.202203080745-r") | ||||
|         classpath("org.kohsuke:github-api:1.305") | ||||
|  | ||||
|         // This comes from the changelog plugin | ||||
| //        classpath("org.jetbrains:markdown:0.3.1") | ||||
|     } | ||||
| } | ||||
|  | ||||
| plugins { | ||||
|     antlr | ||||
|     java | ||||
|     kotlin("jvm") version "1.5.10" | ||||
|     kotlin("jvm") version "1.6.21" | ||||
|  | ||||
|     id("org.jetbrains.intellij") version "1.3.0" | ||||
|     id("org.jetbrains.intellij") version "1.10.0-SNAPSHOT" | ||||
|     id("org.jetbrains.changelog") version "1.3.1" | ||||
|  | ||||
|     // ktlint linter - read more: https://github.com/JLLeitschuh/ktlint-gradle | ||||
|     id("org.jlleitschuh.gradle.ktlint") version "10.2.0" | ||||
|     id("org.jlleitschuh.gradle.ktlint") version "10.3.0" | ||||
| } | ||||
|  | ||||
| // Import variables from gradle.properties file | ||||
| @@ -38,6 +40,7 @@ val ideaVersion: String by project | ||||
| val downloadIdeaSources: String by project | ||||
| val instrumentPluginCode: String by project | ||||
| val remoteRobotVersion: String by project | ||||
| val antlrVersion: String by project | ||||
|  | ||||
| val publishChannels: String by project | ||||
| val publishToken: String by project | ||||
| @@ -57,11 +60,21 @@ dependencies { | ||||
|     testImplementation("com.ensarsarajcic.neovim.java:neovim-api:0.2.3") | ||||
|     testImplementation("com.ensarsarajcic.neovim.java:core-rpc:0.2.3") | ||||
|  | ||||
|     // https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-test | ||||
|     testImplementation("org.jetbrains.kotlin:kotlin-test:$kotlinVersion") | ||||
|  | ||||
|     // https://mvnrepository.com/artifact/org.mockito.kotlin/mockito-kotlin | ||||
|     testImplementation("org.mockito.kotlin:mockito-kotlin:4.0.0") | ||||
|  | ||||
|     testImplementation("com.intellij.remoterobot:remote-robot:$remoteRobotVersion") | ||||
|     testImplementation("com.intellij.remoterobot:remote-fixtures:$remoteRobotVersion") | ||||
|     testImplementation("com.automation-remarks:video-recorder-junit:2.0") | ||||
|     runtimeOnly("org.antlr:antlr4-runtime:4.9.3") | ||||
|     antlr("org.antlr:antlr4:4.9.3") | ||||
|     runtimeOnly("org.antlr:antlr4-runtime:$antlrVersion") | ||||
|     antlr("org.antlr:antlr4:$antlrVersion") | ||||
|  | ||||
|     api(project(":vim-engine")) | ||||
|  | ||||
|     testApi("com.squareup.okhttp3:okhttp:4.10.0") | ||||
| } | ||||
|  | ||||
| configurations { | ||||
| @@ -71,6 +84,24 @@ configurations { | ||||
| } | ||||
|  | ||||
| // --- Compilation | ||||
| // This can be moved to other test registration when issue with tests in gradle will be fixed | ||||
| tasks.register<Test>("testWithNeovim") { | ||||
|     group = "verification" | ||||
|     systemProperty("ideavim.nvim.test", "true") | ||||
|     exclude("/ui/**") | ||||
|     exclude("**/longrunning/**") | ||||
|     exclude("**/propertybased/**") | ||||
| } | ||||
|  | ||||
| tasks.register<Test>("testPropertyBased") { | ||||
|     group = "verification" | ||||
| //    include("**/propertybased/**") | ||||
| } | ||||
|  | ||||
| tasks.register<Test>("testLongRunning") { | ||||
|     group = "verification" | ||||
| //    include("**/longrunning/**") | ||||
| } | ||||
|  | ||||
| tasks { | ||||
|     // Issue in gradle 7.3 | ||||
| @@ -83,6 +114,34 @@ tasks { | ||||
|         exclude("**/ParserTest.class") | ||||
|     } | ||||
|  | ||||
|     val testWithNeovim by getting(Test::class) { | ||||
|         isScanForTestClasses = false | ||||
|         // Only run tests from classes that end with "Test" | ||||
|         include("**/*Test.class") | ||||
|         include("**/*test.class") | ||||
|         include("**/*Tests.class") | ||||
|         exclude("**/ParserTest.class") | ||||
|         exclude("**/longrunning/**") | ||||
|         exclude("**/propertybased/**") | ||||
|     } | ||||
|  | ||||
|     val testPropertyBased by getting(Test::class) { | ||||
|         isScanForTestClasses = false | ||||
|         // Only run tests from classes that end with "Test" | ||||
|         include("**/propertybased/*Test.class") | ||||
|         include("**/propertybased/*test.class") | ||||
|         include("**/propertybased/*Tests.class") | ||||
|     } | ||||
|  | ||||
|     val testLongRunning by getting(Test::class) { | ||||
|         isScanForTestClasses = false | ||||
|         // Only run tests from classes that end with "Test" | ||||
|         include("**/longrunning/**/*Test.class") | ||||
|         include("**/longrunning/**/*test.class") | ||||
|         include("**/longrunning/**/*Tests.class") | ||||
|         exclude("**/longrunning/**/ParserTest.class") | ||||
|     } | ||||
|  | ||||
|     compileJava { | ||||
|         sourceCompatibility = javaVersion | ||||
|         targetCompatibility = javaVersion | ||||
| @@ -93,19 +152,32 @@ tasks { | ||||
|     compileKotlin { | ||||
|         kotlinOptions { | ||||
|             jvmTarget = javaVersion | ||||
|             apiVersion = "1.4" | ||||
|             apiVersion = "1.6" | ||||
|             freeCompilerArgs = listOf("-Xjvm-default=all-compatibility") | ||||
| //            allWarningsAsErrors = true | ||||
|         } | ||||
|     } | ||||
|     compileTestKotlin { | ||||
|         kotlinOptions { | ||||
|             jvmTarget = javaVersion | ||||
|             apiVersion = "1.4" | ||||
|             apiVersion = "1.6" | ||||
| //            allWarningsAsErrors = true | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
| java { | ||||
|     toolchain { | ||||
|         languageVersion.set(JavaLanguageVersion.of(javaVersion)) | ||||
|     } | ||||
| } | ||||
|  | ||||
| kotlin { | ||||
|     jvmToolchain { | ||||
|         (this as JavaToolchainSpec).languageVersion.set(JavaLanguageVersion.of(javaVersion)) | ||||
|     } | ||||
| } | ||||
|  | ||||
| gradle.projectsEvaluated { | ||||
|     tasks.compileJava { | ||||
| //        options.compilerArgs.add("-Werror") | ||||
| @@ -118,11 +190,14 @@ gradle.projectsEvaluated { | ||||
| intellij { | ||||
|     version.set(ideaVersion) | ||||
|     pluginName.set("IdeaVim") | ||||
|  | ||||
|     updateSinceUntilBuild.set(false) | ||||
|  | ||||
|     downloadSources.set(downloadIdeaSources.toBoolean()) | ||||
|     instrumentCode.set(instrumentPluginCode.toBoolean()) | ||||
|     intellijRepository.set("https://www.jetbrains.com/intellij-repository") | ||||
|     plugins.set(listOf("java", "AceJump:3.8.4")) | ||||
|     // Yaml is only used for testing. It's part of the IdeaIC distribution, but needs to be included as a reference | ||||
|     plugins.set(listOf("java", "AceJump:3.8.4", "yaml")) | ||||
| } | ||||
|  | ||||
| tasks { | ||||
| @@ -145,6 +220,7 @@ tasks { | ||||
|     runPluginVerifier { | ||||
|         downloadDir.set("${project.buildDir}/pluginVerifier/ides") | ||||
|         teamCityOutputFormat.set(true) | ||||
| //        ideVersions.set(listOf("IC-2021.3.4")) | ||||
|     } | ||||
|  | ||||
|     generateGrammarSource { | ||||
| @@ -156,12 +232,37 @@ tasks { | ||||
|     named("compileKotlin") { | ||||
|         dependsOn("generateGrammarSource") | ||||
|     } | ||||
|  | ||||
|     // Add plugin open API sources to the plugin ZIP | ||||
|     val createOpenApiSourceJar by registering(Jar::class) { | ||||
|         // Java sources | ||||
|         from(sourceSets.main.get().java) { | ||||
|             include("**/com/maddyhome/idea/vim/**/*.java") | ||||
|         } | ||||
|         // Kotlin sources | ||||
|         from(kotlin.sourceSets.main.get().kotlin) { | ||||
|             include("**/com/maddyhome/idea/vim/**/*.kt") | ||||
|         } | ||||
|         destinationDirectory.set(layout.buildDirectory.dir("libs")) | ||||
|         archiveClassifier.set("src") | ||||
|     } | ||||
|  | ||||
|     buildPlugin { | ||||
|         dependsOn(createOpenApiSourceJar) | ||||
|         from(createOpenApiSourceJar) { into("lib/src") } | ||||
|     } | ||||
|  | ||||
|     // Don't forget to update plugin.xml | ||||
|     patchPluginXml { | ||||
|         sinceBuild.set("222") | ||||
|     } | ||||
| } | ||||
|  | ||||
| // --- Linting | ||||
|  | ||||
| ktlint { | ||||
|     disabledRules.add("no-wildcard-imports") | ||||
|     version.set("0.43.0") | ||||
| } | ||||
|  | ||||
| // --- Tests | ||||
| @@ -174,22 +275,6 @@ tasks { | ||||
|     } | ||||
| } | ||||
|  | ||||
| tasks.register<Test>("testWithNeovim") { | ||||
|     group = "verification" | ||||
|     systemProperty("ideavim.nvim.test", "true") | ||||
|     exclude("/ui/**") | ||||
| } | ||||
|  | ||||
| tasks.register<Test>("testPropertyBased") { | ||||
|     group = "verification" | ||||
|     include("**/propertybased/**") | ||||
| } | ||||
|  | ||||
| tasks.register<Test>("testLongRunning") { | ||||
|     group = "verification" | ||||
|     include("**/longrunning/**") | ||||
| } | ||||
|  | ||||
| tasks.register<Test>("testUi") { | ||||
|     group = "verification" | ||||
|     include("/ui/**") | ||||
| @@ -202,7 +287,7 @@ changelog { | ||||
|     itemPrefix.set("*") | ||||
|     path.set("${project.projectDir}/CHANGES.md") | ||||
|     unreleasedTerm.set("To Be Released") | ||||
|     headerParserRegex.set("\\d\\.\\d+(.\\d+)?".toRegex()) | ||||
|     headerParserRegex.set("(\\d\\.\\d+(.\\d+)?)".toRegex()) | ||||
| //    header = { "${project.version}" } | ||||
| //    version = "0.60" | ||||
| } | ||||
| @@ -255,20 +340,30 @@ tasks.register("slackNotification") { | ||||
|             println("Response code: $postRc") | ||||
|             if (postRc == 200) { | ||||
|                 println(inputStream.bufferedReader().use { it.readText() }) | ||||
|             } else { | ||||
|                 println(errorStream.bufferedReader().use { it.readText() }) | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
| // --- Update authors | ||||
| // Uncomment to enable FUS testing mode | ||||
| // tasks { | ||||
| //    withType<org.jetbrains.intellij.tasks.RunIdeTask> { | ||||
| //        jvmArgs("-Didea.is.internal=true") | ||||
| //        jvmArgs("-Dfus.internal.test.mode=true") | ||||
| //    } | ||||
| // } | ||||
|  | ||||
| // --- Update authors | ||||
| tasks.register("updateAuthors") { | ||||
|     doLast { | ||||
|         val uncheckedEmails = setOf( | ||||
|             "aleksei.plate@jetbrains.com", | ||||
|             "aleksei.plate@teamcity", | ||||
|             "aleksei.plate@TeamCity", | ||||
|             "alex.plate@192.168.0.109" | ||||
|             "alex.plate@192.168.0.109", | ||||
|             "nikita.koshcheev@TeamCity", | ||||
|         ) | ||||
|         updateAuthors(uncheckedEmails) | ||||
|     } | ||||
| @@ -279,6 +374,7 @@ val prId: String by project | ||||
| tasks.register("updateMergedPr") { | ||||
|     doLast { | ||||
|         if (project.hasProperty("prId")) { | ||||
|             println("Got pr id: $prId") | ||||
|             updateMergedPr(prId.toInt()) | ||||
|         } else { | ||||
|             error("Cannot get prId") | ||||
| @@ -442,7 +538,9 @@ data class Change(val id: String, val text: String) | ||||
|  | ||||
| fun updateMergedPr(number: Int) { | ||||
|     val gitHub = org.kohsuke.github.GitHub.connect() | ||||
|     println("Connecting to the repo...") | ||||
|     val repository = gitHub.getRepository("JetBrains/ideavim") | ||||
|     println("Getting pull requests...") | ||||
|     val pullRequest = repository.getPullRequest(number) | ||||
|     if (pullRequest.user.login == "dependabot[bot]") return | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,8 @@ | ||||
| Some examples of join command with `ideajoin` option enabled.   | ||||
| Put `set ideajoin` to your `~/.ideavimrc` to enable this functionality. | ||||
|  | ||||
| Now, you can press `J` (`shift+j`) on a line or a selected block of text to join the lines together. | ||||
|  | ||||
| * Automatic join concatenated lines: | ||||
|  | ||||
| ``` | ||||
|   | ||||
| @@ -1,14 +1,15 @@ | ||||
| # suppress inspection "UnusedProperty" for whole file | ||||
|  | ||||
| ideaVersion=LATEST-EAP-SNAPSHOT | ||||
| ideaVersion=2022.2.2 | ||||
| downloadIdeaSources=true | ||||
| instrumentPluginCode=true | ||||
| version=SNAPSHOT | ||||
| javaVersion=11 | ||||
| remoteRobotVersion=0.11.10 | ||||
| version=chylex-13 | ||||
| javaVersion=17 | ||||
| remoteRobotVersion=0.11.15 | ||||
| antlrVersion=4.10.1 | ||||
|  | ||||
| # Please don't forget to update kotlin version in buildscript section | ||||
| kotlinVersion=1.5.10 | ||||
| kotlinVersion=1.6.21 | ||||
| publishToken=token | ||||
| publishChannels=eap | ||||
|  | ||||
|   | ||||
							
								
								
									
										2
									
								
								gradle/wrapper/gradle-wrapper.properties
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								gradle/wrapper/gradle-wrapper.properties
									
									
									
									
										vendored
									
									
								
							| @@ -1,5 +1,5 @@ | ||||
| distributionBase=GRADLE_USER_HOME | ||||
| distributionPath=wrapper/dists | ||||
| distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-bin.zip | ||||
| distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip | ||||
| zipStoreBase=GRADLE_USER_HOME | ||||
| zipStorePath=wrapper/dists | ||||
|   | ||||
							
								
								
									
										79982
									
								
								qodana.sarif.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										79982
									
								
								qodana.sarif.json
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										21
									
								
								qodana.yaml
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								qodana.yaml
									
									
									
									
									
								
							| @@ -1,6 +1,8 @@ | ||||
| version: 1.0 | ||||
| profile: | ||||
|   name: Qodana | ||||
| include: | ||||
|   - name: CheckDependencyLicenses | ||||
| exclude: | ||||
|   - name: MoveVariableDeclarationIntoWhen | ||||
|   - name: PluginXmlValidity | ||||
| @@ -9,12 +11,15 @@ exclude: | ||||
|   - name: UnusedReturnValue | ||||
|   - name: All | ||||
|     paths: | ||||
|       - build.gradle | ||||
|       - build.gradle.kts | ||||
|       - gradle/wrapper/gradle-wrapper.properties | ||||
|       - resources/icons/youtrack.svg | ||||
|       - src/com/maddyhome/idea/vim/ex/vimscript/VimScriptCommandHandler.java | ||||
|       - src/com/maddyhome/idea/vim/helper/SearchHelper.java | ||||
|       - src/com/maddyhome/idea/vim/regexp/RegExp.java | ||||
|       - test/org/jetbrains/plugins/ideavim/propertybased/samples/JavaText.kt | ||||
|       - test/org/jetbrains/plugins/ideavim/propertybased/samples/LoremText.kt | ||||
|       - test/org/jetbrains/plugins/ideavim/propertybased/samples/SimpleText.kt | ||||
|       - src/main/resources/icons/youtrack.svg | ||||
|       - src/main/java/com/maddyhome/idea/vim/helper/SearchHelper.java | ||||
|       - src/main/java/com/maddyhome/idea/vim/regexp/RegExp.kt | ||||
|       - src/test/java/org/jetbrains/plugins/ideavim/propertybased/samples/JavaText.kt | ||||
|       - src/test/java/org/jetbrains/plugins/ideavim/propertybased/samples/LoremText.kt | ||||
|       - src/test/java/org/jetbrains/plugins/ideavim/propertybased/samples/SimpleText.kt | ||||
|       - src/main/java/com/maddyhome/idea/vim/vimscript/parser/generated/VimscriptListener.java | ||||
|       - src/main/java/com/maddyhome/idea/vim/vimscript/parser/generated/VimscriptLexer.java | ||||
|       - src/main/java/com/maddyhome/idea/vim/vimscript/parser/generated/VimscriptParser.java | ||||
|       - src/main/java/com/maddyhome/idea/vim/vimscript/parser/generated/VimscriptVisitor.java | ||||
| @@ -1,19 +1,13 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
| // Set repository for snapshot versions of gradle plugin | ||||
| pluginManagement { | ||||
|   repositories { | ||||
|     maven { | ||||
|       url 'https://oss.sonatype.org/content/repositories/snapshots/' | ||||
|     } | ||||
|     gradlePluginPortal() | ||||
|   } | ||||
| } | ||||
|  | ||||
| rootProject.name = 'IdeaVIM' | ||||
| include 'vim-engine' | ||||
|  | ||||
|   | ||||
| @@ -28,7 +28,7 @@ comment:                (WS | COLON)* QUOTE ~(NEW_LINE)* NEW_LINE; | ||||
| finishStatement:        (WS | COLON)* FINISH WS* (NEW_LINE | BAR); | ||||
| continueStatement:      (WS | COLON)* CONTINUE WS* (NEW_LINE | BAR); | ||||
| breakStatement:         (WS | COLON)* BREAK WS* (NEW_LINE | BAR); | ||||
| returnStatement:        (WS | COLON)* range? (WS | COLON)* RETURN WS+ expr WS* (NEW_LINE | BAR); | ||||
| returnStatement:        (WS | COLON)* range? (WS | COLON)* RETURN (WS+ expr)? WS* (NEW_LINE | BAR); | ||||
| throwStatement:         (WS | COLON)* THROW WS+ expr WS* (NEW_LINE | BAR); | ||||
|  | ||||
| ifStatement:            ifBlock | ||||
| @@ -117,7 +117,7 @@ command: | ||||
|         | MARK_COMMAND | JUMPS | J_LOWERCASE | JOIN_LINES | HISTORY | GO_TO_CHAR | SYMBOL | FIND | CLASS | F_LOWERCASE | ||||
|         | FILE | EXIT | E_LOWERCASE | EDIT_FILE | DUMP_LINE | DIGRAPH | DEL_MARKS | D_LOWERCASE | DEL_LINES | DELCMD | ||||
|         | T_LOWERCASE | COPY | CMD_CLEAR | BUFFER_LIST | BUFFER_CLOSE | B_LOWERCASE | BUFFER | ASCII | ||||
|         | ACTIONLIST | ACTION | LOCKVAR | UNLOCKVAR | PACKADD | ||||
|         | ACTIONLIST | ACTION | LOCKVAR | UNLOCKVAR | PACKADD | TABMOVE | ||||
|       ) | ||||
|     WS* ((commandArgumentWithoutBars? inline_comment NEW_LINE) | (commandArgumentWithoutBars? NEW_LINE) | (commandArgumentWithoutBars? BAR)) (NEW_LINE | BAR)* | ||||
|     #CommandWithComment| | ||||
| @@ -146,7 +146,7 @@ rShift: GREATER+; | ||||
|  | ||||
| letCommands: | ||||
|     (WS | COLON)* range? (WS | COLON)* LET WS+ expr WS* | ||||
|         assignmentOperator =  (ASSIGN | PLUS_ASSIGN | MINUS_ASSIGN | STAR_ASSIGN | DIV_ASSIGN | MOD_ASSIGN | DOT_ASSIGN) | ||||
|         assignmentOperator | ||||
|         WS* expr WS* ((inline_comment NEW_LINE) | (NEW_LINE | BAR)+) | ||||
|     #Let1Command| | ||||
|  | ||||
| @@ -154,6 +154,21 @@ letCommands: | ||||
|     #Let2Command | ||||
| ; | ||||
|  | ||||
| assignmentOperator: | ||||
|     ASSIGN | plusAssign | minusAssign | startAssign | divAssign | modAssign | dotAssign; | ||||
| plusAssign: | ||||
|     PLUS ASSIGN; | ||||
| minusAssign: | ||||
|     MINUS ASSIGN; | ||||
| startAssign: | ||||
|     STAR ASSIGN; | ||||
| divAssign: | ||||
|     DIV ASSIGN; | ||||
| modAssign: | ||||
|     MOD ASSIGN; | ||||
| dotAssign: | ||||
|     DOT ASSIGN; | ||||
|  | ||||
| shortRange: | ||||
|     ((QUESTION (~QUESTION)* QUESTION?) | (DIV (~DIV)* DIV?)); | ||||
| range: | ||||
| @@ -492,6 +507,7 @@ existingCommands:       RETURN | ||||
|                     |   EXECUTE | ||||
|                     |   CALL | ||||
|                     |   NORMAL | ||||
|                     |   TABMOVE | ||||
| ; | ||||
| //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||||
| // | ||||
| @@ -684,6 +700,7 @@ EXECUTE:                'exe' | 'exec' | 'execu' | 'execut' | 'execute'; | ||||
| LOCKVAR:                'lockv' | 'lockva' | 'lockvar'; | ||||
| UNLOCKVAR:              'unlo' | 'unloc' | 'unlock' | 'unlockv' | 'unlockva' | 'unlockvar'; | ||||
| NORMAL:                 'norm' | 'norma' | 'normal'; | ||||
| TABMOVE:                'tabm' | 'tabmo' | 'tabmov' | 'tabmove'; | ||||
|  | ||||
| // Types | ||||
| DIGIT:                  [0-9]; | ||||
| @@ -776,12 +793,12 @@ IS_NOT_CS:              'isnot#'; | ||||
|  | ||||
| // Assignment operators | ||||
| ASSIGN:                 '='; | ||||
| PLUS_ASSIGN:            '+='; | ||||
| MINUS_ASSIGN:           '-='; | ||||
| STAR_ASSIGN:            '*='; | ||||
| DIV_ASSIGN:             '/='; | ||||
| MOD_ASSIGN:             '%='; | ||||
| DOT_ASSIGN:             '.='; | ||||
| //PLUS_ASSIGN:            '+='; | ||||
| //MINUS_ASSIGN:           '-='; | ||||
| //STAR_ASSIGN:            '*='; | ||||
| //DIV_ASSIGN:             '/='; | ||||
| //MOD_ASSIGN:             '%='; | ||||
| //DOT_ASSIGN:             '.='; | ||||
|  | ||||
| // Escaped chars | ||||
| ESCAPED_QUESTION:       '\\?'; | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 The IdeaVim authors | ||||
|  * Copyright (C) 2003-2022 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-2021 The IdeaVim authors | ||||
|  * Copyright (C) 2003-2022 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 | ||||
| @@ -27,6 +27,7 @@ import com.intellij.openapi.editor.EditorFactory; | ||||
| import com.intellij.openapi.editor.actionSystem.TypedAction; | ||||
| import com.intellij.openapi.editor.actionSystem.TypedActionHandler; | ||||
| import com.intellij.openapi.editor.event.*; | ||||
| import com.intellij.openapi.util.Disposer; | ||||
| import com.maddyhome.idea.vim.helper.HandlerInjector; | ||||
| import org.jetbrains.annotations.NotNull; | ||||
| import org.jetbrains.annotations.Nullable; | ||||
| @@ -53,7 +54,7 @@ public class EventFacade { | ||||
|   public void setupTypedActionHandler(@NotNull VimTypedActionHandler handler) { | ||||
|     final TypedAction typedAction = getTypedAction(); | ||||
|  | ||||
|     if (HandlerInjector.notebookCommandMode()) { | ||||
|     if (HandlerInjector.notebookCommandMode(null)) { | ||||
|       TypedActionHandler result = HandlerInjector.inject(); | ||||
|       if (result != null) { | ||||
|         myOriginalTypedActionHandler = result; | ||||
| @@ -101,38 +102,41 @@ public class EventFacade { | ||||
|     EditorFactory.getInstance().addEditorFactoryListener(listener, parentDisposable); | ||||
|   } | ||||
|  | ||||
|   @SuppressWarnings("deprecation") | ||||
|   public void removeEditorFactoryListener(@NotNull EditorFactoryListener listener) { | ||||
|     // Listener is removed not only if application is disposed | ||||
|     EditorFactory.getInstance().removeEditorFactoryListener(listener); | ||||
|   } | ||||
|  | ||||
|   public void addEditorMouseListener(@NotNull Editor editor, @NotNull EditorMouseListener listener) { | ||||
|     editor.addEditorMouseListener(listener); | ||||
|   public void addEditorMouseListener(@NotNull Editor editor, | ||||
|                                      @NotNull EditorMouseListener listener, | ||||
|                                      @NotNull Disposable disposable) { | ||||
|     editor.addEditorMouseListener(listener, disposable); | ||||
|   } | ||||
|  | ||||
|   public void removeEditorMouseListener(@NotNull Editor editor, @NotNull EditorMouseListener listener) { | ||||
|     editor.removeEditorMouseListener(listener); | ||||
|   } | ||||
|  | ||||
|   public void addComponentMouseListener(@NotNull Component component, @NotNull MouseListener mouseListener) { | ||||
|   public void addComponentMouseListener(@NotNull Component component, | ||||
|                                         @NotNull MouseListener mouseListener, | ||||
|                                         @NotNull Disposable disposable) { | ||||
|     component.addMouseListener(mouseListener); | ||||
|     Disposer.register(disposable, () -> component.removeMouseListener(mouseListener)); | ||||
|   } | ||||
|  | ||||
|   public void removeComponentMouseListener(@NotNull Component component, @NotNull MouseListener mouseListener) { | ||||
|     component.removeMouseListener(mouseListener); | ||||
|   } | ||||
|  | ||||
|   public void addEditorMouseMotionListener(@NotNull Editor editor, @NotNull EditorMouseMotionListener listener) { | ||||
|     editor.addEditorMouseMotionListener(listener); | ||||
|   public void addEditorMouseMotionListener(@NotNull Editor editor, | ||||
|                                            @NotNull EditorMouseMotionListener listener, | ||||
|                                            @NotNull Disposable disposable) { | ||||
|     editor.addEditorMouseMotionListener(listener, disposable); | ||||
|   } | ||||
|  | ||||
|   public void removeEditorMouseMotionListener(@NotNull Editor editor, @NotNull EditorMouseMotionListener listener) { | ||||
|     editor.removeEditorMouseMotionListener(listener); | ||||
|   } | ||||
|  | ||||
|   public void addEditorSelectionListener(@NotNull Editor editor, @NotNull SelectionListener listener) { | ||||
|     editor.getSelectionModel().addSelectionListener(listener); | ||||
|   public void addEditorSelectionListener(@NotNull Editor editor, | ||||
|                                          @NotNull SelectionListener listener, | ||||
|                                          @NotNull Disposable disposable) { | ||||
|     editor.getSelectionModel().addSelectionListener(listener, disposable); | ||||
|   } | ||||
|  | ||||
|   public void removeEditorSelectionListener(@NotNull Editor editor, @NotNull SelectionListener listener) { | ||||
|   | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 The IdeaVim authors | ||||
|  * Copyright (C) 2003-2022 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 | ||||
| @@ -18,8 +18,14 @@ | ||||
|  | ||||
| package com.maddyhome.idea.vim | ||||
|  | ||||
| import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx | ||||
| import com.intellij.openapi.project.Project | ||||
| import com.intellij.openapi.project.ProjectManagerListener | ||||
| import com.intellij.openapi.startup.StartupActivity | ||||
| import com.maddyhome.idea.vim.api.injector | ||||
| import com.maddyhome.idea.vim.helper.EditorHelper | ||||
| import com.maddyhome.idea.vim.helper.localEditors | ||||
| import com.maddyhome.idea.vim.options.OptionScope | ||||
|  | ||||
| /** | ||||
|  * @author Alex Plate | ||||
| @@ -36,3 +42,19 @@ class PluginStartup : StartupActivity.DumbAware/*, LightEditCompatible*/ { | ||||
|     VimPlugin.getInstance().initialize() | ||||
|   } | ||||
| } | ||||
|  | ||||
| // This is a temporal workaround for VIM-2487 | ||||
| class PyNotebooksCloseWorkaround : ProjectManagerListener { | ||||
|   override fun projectClosingBeforeSave(project: Project) { | ||||
|     val close = injector.optionService.getOptionValue(OptionScope.GLOBAL, "closenotebooks").asBoolean() | ||||
|     if (close) { | ||||
|       localEditors().forEach { editor -> | ||||
|         val virtualFile = EditorHelper.getVirtualFile(editor) | ||||
|         if (virtualFile?.extension == "ipynb") { | ||||
|           val fileEditorManager = FileEditorManagerEx.getInstanceEx(project) | ||||
|           fileEditorManager.closeFile(virtualFile) | ||||
|         } | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 The IdeaVim authors | ||||
|  * Copyright (C) 2003-2022 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,6 +22,7 @@ import com.maddyhome.idea.vim.group.KeyGroup; | ||||
| import com.maddyhome.idea.vim.handler.ActionBeanClass; | ||||
| import com.maddyhome.idea.vim.handler.EditorActionHandlerBase; | ||||
| import com.maddyhome.idea.vim.key.MappingOwner; | ||||
| import com.maddyhome.idea.vim.newapi.IjVimActionsInitiator; | ||||
| import org.jetbrains.annotations.NotNull; | ||||
| import org.jetbrains.annotations.Nullable; | ||||
|  | ||||
| @@ -71,7 +72,7 @@ public class RegisterActions { | ||||
|  | ||||
|   private static void registerVimCommandActions() { | ||||
|     KeyGroup parser = VimPlugin.getKey(); | ||||
|     VIM_ACTIONS_EP.extensions().forEach(parser::registerCommandAction); | ||||
|     VIM_ACTIONS_EP.extensions().map(IjVimActionsInitiator::new).forEach(parser::registerCommandAction); | ||||
|   } | ||||
|  | ||||
|   private static void registerEmptyShortcuts() { | ||||
| @@ -80,6 +81,6 @@ public class RegisterActions { | ||||
|     // The {char1} <BS> {char2} shortcut is handled directly by KeyHandler#handleKey, so doesn't have an action. But we | ||||
|     // still need to register the shortcut, to make sure the editor doesn't swallow it. | ||||
|     parser | ||||
|       .registerShortcutWithoutAction(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0), MappingOwner.IdeaVim.INSTANCE); | ||||
|       .registerShortcutWithoutAction(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0), MappingOwner.IdeaVim.System.INSTANCE); | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 The IdeaVim authors | ||||
|  * Copyright (C) 2003-2022 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-2021 The IdeaVim authors | ||||
|  * Copyright (C) 2003-2022 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,10 @@ package com.maddyhome.idea.vim; | ||||
|  | ||||
| import com.intellij.ide.plugins.IdeaPluginDescriptor; | ||||
| import com.intellij.ide.plugins.PluginManagerCore; | ||||
| import com.intellij.notification.Notification; | ||||
| import com.intellij.notification.NotificationListener; | ||||
| import com.intellij.openapi.Disposable; | ||||
| import com.intellij.openapi.application.Application; | ||||
| import com.intellij.openapi.application.ApplicationManager; | ||||
| import com.intellij.openapi.components.PersistentStateComponent; | ||||
| import com.intellij.openapi.components.ServiceManager; | ||||
| import com.intellij.openapi.components.State; | ||||
| import com.intellij.openapi.components.Storage; | ||||
| import com.intellij.openapi.diagnostic.Logger; | ||||
| @@ -33,13 +30,12 @@ import com.intellij.openapi.extensions.PluginId; | ||||
| import com.intellij.openapi.keymap.Keymap; | ||||
| import com.intellij.openapi.keymap.ex.KeymapManagerEx; | ||||
| import com.intellij.openapi.keymap.impl.DefaultKeymap; | ||||
| import com.intellij.openapi.options.ShowSettingsUtil; | ||||
| import com.intellij.openapi.project.Project; | ||||
| import com.intellij.openapi.project.ProjectManager; | ||||
| import com.intellij.openapi.ui.Messages; | ||||
| import com.intellij.openapi.util.Disposer; | ||||
| import com.intellij.openapi.util.SystemInfo; | ||||
| import com.intellij.openapi.wm.StatusBar; | ||||
| import com.intellij.openapi.wm.WindowManager; | ||||
| import com.maddyhome.idea.vim.api.VimInjectorKt; | ||||
| import com.maddyhome.idea.vim.api.VimKeyGroup; | ||||
| import com.maddyhome.idea.vim.config.VimState; | ||||
| import com.maddyhome.idea.vim.config.migration.ApplicationConfigurationMigrator; | ||||
| import com.maddyhome.idea.vim.extension.VimExtensionRegistrar; | ||||
| @@ -49,22 +45,18 @@ import com.maddyhome.idea.vim.group.copy.YankGroup; | ||||
| import com.maddyhome.idea.vim.group.visual.VisualMotionGroup; | ||||
| import com.maddyhome.idea.vim.helper.MacKeyRepeat; | ||||
| import com.maddyhome.idea.vim.listener.VimListenerManager; | ||||
| import com.maddyhome.idea.vim.option.OptionsManager; | ||||
| import com.maddyhome.idea.vim.newapi.IjVimInjector; | ||||
| import com.maddyhome.idea.vim.ui.StatusBarIconFactory; | ||||
| import com.maddyhome.idea.vim.ui.VimEmulationConfigurable; | ||||
| import com.maddyhome.idea.vim.ui.ex.ExEntryPanel; | ||||
| import com.maddyhome.idea.vim.vimscript.services.FunctionStorage; | ||||
| import com.maddyhome.idea.vim.vimscript.services.IjVimOptionService; | ||||
| import com.maddyhome.idea.vim.vimscript.services.OptionService; | ||||
| import com.maddyhome.idea.vim.vimscript.services.VariableService; | ||||
| import com.maddyhome.idea.vim.vimscript.services.VariableServiceImpl; | ||||
| import org.jdom.Element; | ||||
| import org.jetbrains.annotations.Nls; | ||||
| import org.jetbrains.annotations.NotNull; | ||||
| import org.jetbrains.annotations.Nullable; | ||||
|  | ||||
| import javax.swing.event.HyperlinkEvent; | ||||
| import java.awt.*; | ||||
|  | ||||
| import static com.maddyhome.idea.vim.group.EditorGroup.EDITOR_STORE_ELEMENT; | ||||
| import static com.maddyhome.idea.vim.group.KeyGroup.SHORTCUT_CONFLICTS_ELEMENT; | ||||
| import static com.maddyhome.idea.vim.vimscript.services.VimRcService.executeIdeaVimRc; | ||||
| @@ -77,18 +69,16 @@ import static com.maddyhome.idea.vim.vimscript.services.VimRcService.executeIdea | ||||
|  * This is an application level plugin meaning that all open projects will share a common instance of the plugin. | ||||
|  * Registers and marks are shared across open projects so you can copy and paste between files of different projects. | ||||
|  */ | ||||
| @SuppressWarnings("deprecation") | ||||
| // [VERSION UPDATE] 212+ getService | ||||
| @State(name = "VimSettings", storages = {@Storage("$APP_CONFIG$/vim_settings.xml")}) | ||||
| public class VimPlugin implements PersistentStateComponent<Element>, Disposable { | ||||
|  | ||||
|   static { | ||||
|     VimInjectorKt.setInjector(new IjVimInjector()); | ||||
|   } | ||||
|  | ||||
|   private static final String IDEAVIM_PLUGIN_ID = "IdeaVIM"; | ||||
|   public static final int STATE_VERSION = 7; | ||||
|  | ||||
|   private static long lastBeepTimeMillis; | ||||
|  | ||||
|   private boolean error = false; | ||||
|   private String message = null; | ||||
|  | ||||
|   private int previousStateVersion = 0; | ||||
|   private String previousKeyMap = ""; | ||||
|  | ||||
| @@ -99,6 +89,8 @@ public class VimPlugin implements PersistentStateComponent<Element>, Disposable | ||||
|  | ||||
|   private final @NotNull VimState state = new VimState(); | ||||
|  | ||||
|   public Disposable onOffDisposable; | ||||
|  | ||||
|   VimPlugin() { | ||||
|     ApplicationConfigurationMigrator.getInstance().migrate(); | ||||
|   } | ||||
| @@ -122,7 +114,7 @@ public class VimPlugin implements PersistentStateComponent<Element>, Disposable | ||||
|   @Override | ||||
|   public void dispose() { | ||||
|     LOG.debug("disposeComponent"); | ||||
|     turnOffPlugin(); | ||||
|     turnOffPlugin(false); | ||||
|     LOG.debug("done"); | ||||
|   } | ||||
|  | ||||
| @@ -131,10 +123,10 @@ public class VimPlugin implements PersistentStateComponent<Element>, Disposable | ||||
|    */ | ||||
|   public static @NotNull NotificationService getNotifications(@Nullable Project project) { | ||||
|     if (project == null) { | ||||
|       return ServiceManager.getService(NotificationService.class); | ||||
|       return ApplicationManager.getApplication().getService(NotificationService.class); | ||||
|     } | ||||
|     else { | ||||
|       return ServiceManager.getService(project, NotificationService.class); | ||||
|       return project.getService(NotificationService.class); | ||||
|     } | ||||
|   } | ||||
|  | ||||
| @@ -144,35 +136,35 @@ public class VimPlugin implements PersistentStateComponent<Element>, Disposable | ||||
|  | ||||
|  | ||||
|   public static @NotNull MotionGroup getMotion() { | ||||
|     return ServiceManager.getService(MotionGroup.class); | ||||
|     return ApplicationManager.getApplication().getService(MotionGroup.class); | ||||
|   } | ||||
|  | ||||
|   public static @NotNull XMLGroup getXML() { | ||||
|     return ApplicationManager.getApplication().getService(XMLGroup.class); | ||||
|   } | ||||
|  | ||||
|   public static @NotNull ChangeGroup getChange() { | ||||
|     return ServiceManager.getService(ChangeGroup.class); | ||||
|     return ((ChangeGroup)VimInjectorKt.getInjector().getChangeGroup()); | ||||
|   } | ||||
|  | ||||
|   public static @NotNull CommandGroup getCommand() { | ||||
|     return ServiceManager.getService(CommandGroup.class); | ||||
|     return ApplicationManager.getApplication().getService(CommandGroup.class); | ||||
|   } | ||||
|  | ||||
|   public static @NotNull MarkGroup getMark() { | ||||
|     return ServiceManager.getService(MarkGroup.class); | ||||
|     return ((MarkGroup)VimInjectorKt.getInjector().getMarkGroup()); | ||||
|   } | ||||
|  | ||||
|   public static @NotNull RegisterGroup getRegister() { | ||||
|     return ServiceManager.getService(RegisterGroup.class); | ||||
|   } | ||||
|  | ||||
|   public static @Nullable RegisterGroup getRegisterIfCreated() { | ||||
|     return ApplicationManager.getApplication().getServiceIfCreated(RegisterGroup.class); | ||||
|     return ((RegisterGroup)VimInjectorKt.getInjector().getRegisterGroup()); | ||||
|   } | ||||
|  | ||||
|   public static @NotNull FileGroup getFile() { | ||||
|     return ServiceManager.getService(FileGroup.class); | ||||
|     return (FileGroup)VimInjectorKt.getInjector().getFile(); | ||||
|   } | ||||
|  | ||||
|   public static @NotNull SearchGroup getSearch() { | ||||
|     return ServiceManager.getService(SearchGroup.class); | ||||
|     return ApplicationManager.getApplication().getService(SearchGroup.class); | ||||
|   } | ||||
|  | ||||
|   public static @Nullable SearchGroup getSearchIfCreated() { | ||||
| @@ -180,35 +172,39 @@ public class VimPlugin implements PersistentStateComponent<Element>, Disposable | ||||
|   } | ||||
|  | ||||
|   public static @NotNull ProcessGroup getProcess() { | ||||
|     return ServiceManager.getService(ProcessGroup.class); | ||||
|     return ((ProcessGroup)VimInjectorKt.getInjector().getProcessGroup()); | ||||
|   } | ||||
|  | ||||
|   public static @NotNull MacroGroup getMacro() { | ||||
|     return ServiceManager.getService(MacroGroup.class); | ||||
|     return (MacroGroup)VimInjectorKt.getInjector().getMacro(); | ||||
|   } | ||||
|  | ||||
|   public static @NotNull DigraphGroup getDigraph() { | ||||
|     return ServiceManager.getService(DigraphGroup.class); | ||||
|     return (DigraphGroup)VimInjectorKt.getInjector().getDigraphGroup(); | ||||
|   } | ||||
|  | ||||
|   public static @NotNull HistoryGroup getHistory() { | ||||
|     return ServiceManager.getService(HistoryGroup.class); | ||||
|     return ApplicationManager.getApplication().getService(HistoryGroup.class); | ||||
|   } | ||||
|  | ||||
|   public static @NotNull KeyGroup getKey() { | ||||
|     return ServiceManager.getService(KeyGroup.class); | ||||
|     return ((KeyGroup)VimInjectorKt.getInjector().getKeyGroup()); | ||||
|   } | ||||
|  | ||||
|   public static @Nullable KeyGroup getKeyIfCreated() { | ||||
|     return ApplicationManager.getApplication().getServiceIfCreated(KeyGroup.class); | ||||
|     return ((KeyGroup)ApplicationManager.getApplication().getServiceIfCreated(VimKeyGroup.class)); | ||||
|   } | ||||
|  | ||||
|   public static @NotNull WindowGroup getWindow() { | ||||
|     return ServiceManager.getService(WindowGroup.class); | ||||
|     return ((WindowGroup)VimInjectorKt.getInjector().getWindow()); | ||||
|   } | ||||
|  | ||||
|   public static @NotNull TabService getTabService() { | ||||
|     return ApplicationManager.getApplication().getService(TabService.class); | ||||
|   } | ||||
|  | ||||
|   public static @NotNull EditorGroup getEditor() { | ||||
|     return ServiceManager.getService(EditorGroup.class); | ||||
|     return ApplicationManager.getApplication().getService(EditorGroup.class); | ||||
|   } | ||||
|  | ||||
|   public static @Nullable EditorGroup getEditorIfCreated() { | ||||
| @@ -216,23 +212,27 @@ public class VimPlugin implements PersistentStateComponent<Element>, Disposable | ||||
|   } | ||||
|  | ||||
|   public static @NotNull VisualMotionGroup getVisualMotion() { | ||||
|     return ServiceManager.getService(VisualMotionGroup.class); | ||||
|     return (VisualMotionGroup)VimInjectorKt.getInjector().getVisualMotionGroup(); | ||||
|   } | ||||
|  | ||||
|   public static @NotNull YankGroup getYank() { | ||||
|     return ServiceManager.getService(YankGroup.class); | ||||
|     return (YankGroup)VimInjectorKt.getInjector().getYank(); | ||||
|   } | ||||
|  | ||||
|   public static @NotNull PutGroup getPut() { | ||||
|     return ServiceManager.getService(PutGroup.class); | ||||
|     return (PutGroup)VimInjectorKt.getInjector().getPut(); | ||||
|   } | ||||
|  | ||||
|   public static @NotNull VariableService getVariableService() { | ||||
|     return ServiceManager.getService(VariableService.class); | ||||
|     return ApplicationManager.getApplication().getService(VariableService.class); | ||||
|   } | ||||
|  | ||||
|   public static @NotNull OptionService getOptionService() { | ||||
|     return ServiceManager.getService(OptionService.class); | ||||
|     return VimInjectorKt.getInjector().getOptionService(); | ||||
|   } | ||||
|  | ||||
|   public static @NotNull IjVimOptionService getOptionServiceImpl() { | ||||
|     return (IjVimOptionService)VimInjectorKt.getInjector().getOptionService(); | ||||
|   } | ||||
|  | ||||
|   private static @NotNull NotificationService getNotifications() { | ||||
| @@ -272,7 +272,7 @@ public class VimPlugin implements PersistentStateComponent<Element>, Disposable | ||||
|     if (isEnabled() == enabled) return; | ||||
|  | ||||
|     if (!enabled) { | ||||
|       getInstance().turnOffPlugin(); | ||||
|       getInstance().turnOffPlugin(true); | ||||
|     } | ||||
|  | ||||
|     getInstance().enabled = enabled; | ||||
| @@ -285,100 +285,100 @@ public class VimPlugin implements PersistentStateComponent<Element>, Disposable | ||||
|   } | ||||
|  | ||||
|   public static boolean isError() { | ||||
|     return getInstance().error; | ||||
|     return VimInjectorKt.getInjector().getMessages().isError(); | ||||
|   } | ||||
|  | ||||
|   public static String getMessage() { | ||||
|     return getInstance().message; | ||||
|     return VimInjectorKt.getInjector().getMessages().getStatusBarMessage(); | ||||
|   } | ||||
|  | ||||
|   /** | ||||
|    * Indicate to the user that an error has occurred. Just beep. | ||||
|    */ | ||||
|   public static void indicateError() { | ||||
|     if (ApplicationManager.getApplication().isUnitTestMode()) { | ||||
|       getInstance().error = true; | ||||
|     } | ||||
|     else if (!VimPlugin.getOptionService().isSet(OptionService.Scope.GLOBAL.INSTANCE, "visualbell", "visualbell")) { | ||||
|       // Vim only allows a beep once every half second - :help 'visualbell' | ||||
|       final long currentTimeMillis = System.currentTimeMillis(); | ||||
|       if (currentTimeMillis - lastBeepTimeMillis > 500) { | ||||
|         Toolkit.getDefaultToolkit().beep(); | ||||
|         lastBeepTimeMillis = currentTimeMillis; | ||||
|       } | ||||
|     } | ||||
|     VimInjectorKt.getInjector().getMessages().indicateError(); | ||||
|   } | ||||
|  | ||||
|   public static void clearError() { | ||||
|     if (ApplicationManager.getApplication().isUnitTestMode()) { | ||||
|       getInstance().error = false; | ||||
|     } | ||||
|     VimInjectorKt.getInjector().getMessages().clearError(); | ||||
|   } | ||||
|  | ||||
|   public static void showMode(String msg) { | ||||
|     showMessage(msg); | ||||
|     VimInjectorKt.getInjector().getMessages().showMode(msg); | ||||
|   } | ||||
|  | ||||
|   public static void showMessage(@Nls(capitalization = Nls.Capitalization.Sentence) @Nullable String msg) { | ||||
|     if (ApplicationManager.getApplication().isUnitTestMode()) { | ||||
|       getInstance().message = msg; | ||||
|     } | ||||
|     ProjectManager pm = ProjectManager.getInstance(); | ||||
|     Project[] projects = pm.getOpenProjects(); | ||||
|     for (Project project : projects) { | ||||
|       StatusBar bar = WindowManager.getInstance().getStatusBar(project); | ||||
|       if (bar != null) { | ||||
|         if (msg == null || msg.length() == 0) { | ||||
|           bar.setInfo(""); | ||||
|         } | ||||
|         else { | ||||
|           bar.setInfo("VIM - " + msg); | ||||
|         } | ||||
|       } | ||||
|     } | ||||
|     VimInjectorKt.getInjector().getMessages().showStatusBarMessage(msg); | ||||
|   } | ||||
|  | ||||
|   public static @NotNull VimPlugin getInstance() { | ||||
|     return ServiceManager.getService(VimPlugin.class); | ||||
|     return ApplicationManager.getApplication().getService(VimPlugin.class); | ||||
|   } | ||||
|  | ||||
|   /** | ||||
|    * IdeaVim plugin initialization. | ||||
|    * This is an important operation and some commands ordering should be preserved. | ||||
|    * Please make sure that the documentation of this function is in sync with the code | ||||
|    * | ||||
|    * 1) Update state | ||||
|    *    This schedules a state update. In most cases it just shows some dialogs to the user. As I know, there are | ||||
|    *      no special reasons to keep this command as a first line, so it seems safe to move it. | ||||
|    * 2) Command registration | ||||
|    *    This block should be located BEFORE ~/.ideavimrc execution. Without it the commands won't be registered | ||||
|    *      and initialized, but ~/.ideavimrc file may refer or execute some commands or functions. | ||||
|    *    This block DOES NOT initialize extensions, but only registers the available ones. | ||||
|    * 3) ~/.ideavimrc execution | ||||
|    *    3.1 executes commands from the .ideavimrc file and 3.2 initializes extensions. | ||||
|    *    3.1 MUST BE BEFORE 3.2. This is a flow of vim/IdeaVim initialization, firstly .ideavimrc is executed and then | ||||
|    *      the extensions are initialized. | ||||
|    * 4) Components initialization | ||||
|    *    This should happen after ideavimrc execution because VimListenerManager accesses `number` option | ||||
|    *      to init line numbers and guicaret to initialize carets. | ||||
|    *    However, there is a question about listeners attaching. Listeners registration happens after the .ideavimrc | ||||
|    *      execution, what theoretically may cause bugs (e.g. VIM-2540) | ||||
|    */ | ||||
|   private void turnOnPlugin() { | ||||
|     onOffDisposable = Disposer.newDisposable(this, "IdeaVimOnOffDisposer"); | ||||
|  | ||||
|     // 1) Update state | ||||
|     ApplicationManager.getApplication().invokeLater(this::updateState); | ||||
|  | ||||
|     // Register vim actions in command mode | ||||
|     // 2) Command registration | ||||
|     // 2.1) Register vim actions in command mode | ||||
|     RegisterActions.registerActions(); | ||||
|  | ||||
|     // Register extensions | ||||
|     // 2.2) Register extensions | ||||
|     VimExtensionRegistrar.registerExtensions(); | ||||
|  | ||||
|     // Register functions | ||||
|     // 2.3) Register functions | ||||
|     FunctionStorage.INSTANCE.registerHandlers(); | ||||
|  | ||||
|     // Execute ~/.ideavimrc | ||||
|     // 3) ~/.ideavimrc execution | ||||
|     // 3.1) Execute ~/.ideavimrc | ||||
|     registerIdeavimrc(); | ||||
|  | ||||
|     // Initialize extensions | ||||
|     // 3.2) Initialize extensions. Always after 3.1 | ||||
|     VimExtensionRegistrar.enableDelayedExtensions(); | ||||
|  | ||||
|     // Some options' default values are based on values set in .ideavimrc, e.g. 'shellxquote' on Windows when 'shell' | ||||
|     // is cmd.exe has a different default to when 'shell' contains "sh" | ||||
|     OptionsManager.INSTANCE.completeInitialisation(); | ||||
|  | ||||
|     // Turing on should be performed after all commands registration | ||||
|     getSearch().turnOn(); | ||||
|     VimListenerManager.INSTANCE.turnOn(); | ||||
|   } | ||||
|  | ||||
|   private void turnOffPlugin() { | ||||
|   private void turnOffPlugin(boolean unsubscribe) { | ||||
|     SearchGroup searchGroup = getSearchIfCreated(); | ||||
|     if (searchGroup != null) { | ||||
|       searchGroup.turnOff(); | ||||
|     } | ||||
|     VimListenerManager.INSTANCE.turnOff(); | ||||
|     if (unsubscribe) { | ||||
|       VimListenerManager.INSTANCE.turnOff(); | ||||
|     } | ||||
|     ExEntryPanel.fullReset(); | ||||
|  | ||||
|     // Unregister vim actions in command mode | ||||
|     RegisterActions.unregisterActions(); | ||||
|  | ||||
|     Disposer.dispose(onOffDisposable); | ||||
|   } | ||||
|  | ||||
|   private boolean stateUpdated = false; | ||||
| @@ -392,7 +392,9 @@ public class VimPlugin implements PersistentStateComponent<Element>, Disposable | ||||
|         final Boolean enabled = keyRepeat.isEnabled(); | ||||
|         final Boolean isKeyRepeat = getEditor().isKeyRepeat(); | ||||
|         if ((enabled == null || !enabled) && (isKeyRepeat == null || isKeyRepeat)) { | ||||
|           if (VimPlugin.getNotifications().enableRepeatingMode() == Messages.YES) { | ||||
|           // This system property is used in IJ ui robot to hide the startup tips | ||||
|           boolean showNotification = Boolean.getBoolean("ide.show.tips.on.startup.default.value"); | ||||
|           if (showNotification && VimPlugin.getNotifications().enableRepeatingMode() == Messages.YES) { | ||||
|             getEditor().setKeyRepeat(true); | ||||
|             keyRepeat.setEnabled(true); | ||||
|           } | ||||
| @@ -411,12 +413,6 @@ public class VimPlugin implements PersistentStateComponent<Element>, Disposable | ||||
|           keymap = manager.getKeymap(DefaultKeymap.getInstance().getDefaultKeymapName()); | ||||
|         } | ||||
|         assert keymap != null : "Default keymap not found"; | ||||
|         VimPlugin.getNotifications().specialKeymap(keymap, new NotificationListener.Adapter() { | ||||
|           @Override | ||||
|           protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent e) { | ||||
|             ShowSettingsUtil.getInstance().showSettingsDialog(null, VimEmulationConfigurable.class); | ||||
|           } | ||||
|         }); | ||||
|         manager.setActiveKeymap(keymap); | ||||
|       } | ||||
|       if (previousStateVersion > 0 && previousStateVersion < 4) { | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 The IdeaVim authors | ||||
|  * Copyright (C) 2003-2022 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-2021 The IdeaVim authors | ||||
|  * Copyright (C) 2003-2022 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 | ||||
| @@ -25,8 +25,12 @@ import com.intellij.openapi.editor.actionSystem.TypedActionHandler | ||||
| import com.intellij.openapi.editor.actionSystem.TypedActionHandlerEx | ||||
| import com.intellij.openapi.progress.ProcessCanceledException | ||||
| import com.maddyhome.idea.vim.helper.EditorDataContext | ||||
| import com.maddyhome.idea.vim.helper.inInsertMode | ||||
| import com.maddyhome.idea.vim.helper.isIdeaVimDisabledHere | ||||
| import com.maddyhome.idea.vim.vimscript.services.OptionService | ||||
| import com.maddyhome.idea.vim.key.KeyHandlerKeeper | ||||
| import com.maddyhome.idea.vim.newapi.vim | ||||
| import com.maddyhome.idea.vim.options.OptionConstants | ||||
| import com.maddyhome.idea.vim.options.OptionScope | ||||
| import java.awt.event.KeyAdapter | ||||
| import java.awt.event.KeyEvent | ||||
| import javax.swing.KeyStroke | ||||
| @@ -36,33 +40,43 @@ import javax.swing.KeyStroke | ||||
|  * | ||||
|  * IDE shortcut keys used by Vim commands are handled by [com.maddyhome.idea.vim.action.VimShortcutKeyAction]. | ||||
|  */ | ||||
| class VimTypedActionHandler(origHandler: TypedActionHandler?) : TypedActionHandlerEx { | ||||
| class VimTypedActionHandler(origHandler: TypedActionHandler) : TypedActionHandlerEx { | ||||
|   private val handler = KeyHandler.getInstance() | ||||
|   private val traceTime = VimPlugin.getOptionService().isSet(OptionService.Scope.GLOBAL, "ideatracetime") | ||||
|   private val traceTime = VimPlugin.getOptionService().isSet(OptionScope.GLOBAL, OptionConstants.ideatracetimeName) | ||||
|  | ||||
|   init { | ||||
|     handler.originalHandler = origHandler | ||||
|     KeyHandlerKeeper.getInstance().originalHandler = origHandler | ||||
|   } | ||||
|  | ||||
|   override fun beforeExecute(editor: Editor, charTyped: Char, context: DataContext, plan: ActionPlan) { | ||||
|     LOG.trace("Before execute for typed action") | ||||
|     if (editor.isIdeaVimDisabledHere) { | ||||
|       LOG.trace("IdeaVim disabled here, finish") | ||||
|       (handler.originalHandler as? TypedActionHandlerEx)?.beforeExecute(editor, charTyped, context, plan) | ||||
|       (KeyHandlerKeeper.getInstance().originalHandler as? TypedActionHandlerEx)?.beforeExecute(editor, charTyped, context, plan) | ||||
|       return | ||||
|     } | ||||
|  | ||||
|     LOG.trace("Executing before execute") | ||||
|     val modifiers = if (charTyped == ' ' && VimKeyListener.isSpaceShift) KeyEvent.SHIFT_DOWN_MASK else 0 | ||||
|     val keyStroke = KeyStroke.getKeyStroke(charTyped, modifiers) | ||||
|     handler.beforeHandleKey(editor, keyStroke, context, plan) | ||||
|  | ||||
|     /* Invoked before acquiring a write lock and actually handling the keystroke. | ||||
|      * | ||||
|      * Drafts an optional [ActionPlan] that will be used as a base for zero-latency rendering in editor. | ||||
|      */ | ||||
|     if (editor.inInsertMode) { | ||||
|       val originalHandler = KeyHandlerKeeper.getInstance().originalHandler | ||||
|       if (originalHandler is TypedActionHandlerEx) { | ||||
|         originalHandler.beforeExecute(editor, keyStroke.keyChar, context, plan) | ||||
|       } | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   override fun execute(editor: Editor, charTyped: Char, context: DataContext) { | ||||
|     LOG.trace("Execute for typed action") | ||||
|     if (editor.isIdeaVimDisabledHere) { | ||||
|       LOG.trace("IdeaVim disabled here, finish") | ||||
|       handler.originalHandler.execute(editor, charTyped, context) | ||||
|       KeyHandlerKeeper.getInstance().originalHandler.execute(editor, charTyped, context) | ||||
|       return | ||||
|     } | ||||
|  | ||||
| @@ -71,7 +85,7 @@ class VimTypedActionHandler(origHandler: TypedActionHandler?) : TypedActionHandl | ||||
|       val modifiers = if (charTyped == ' ' && VimKeyListener.isSpaceShift) KeyEvent.SHIFT_DOWN_MASK else 0 | ||||
|       val keyStroke = KeyStroke.getKeyStroke(charTyped, modifiers) | ||||
|       val startTime = if (traceTime) System.currentTimeMillis() else null | ||||
|       handler.handleKey(editor, keyStroke, EditorDataContext.init(editor, context)) | ||||
|       handler.handleKey(editor.vim, keyStroke, EditorDataContext.init(editor, context).vim) | ||||
|       if (startTime != null) { | ||||
|         val duration = System.currentTimeMillis() - startTime | ||||
|         LOG.info("VimTypedAction '$charTyped': $duration ms") | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 The IdeaVim authors | ||||
|  * Copyright (C) 2003-2022 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,9 +17,9 @@ | ||||
|  */ | ||||
| package com.maddyhome.idea.vim.action | ||||
|  | ||||
| import com.intellij.openapi.actionSystem.DataContext | ||||
| import com.intellij.openapi.editor.Editor | ||||
| import com.maddyhome.idea.vim.VimPlugin | ||||
| import com.maddyhome.idea.vim.api.ExecutionContext | ||||
| import com.maddyhome.idea.vim.api.VimEditor | ||||
| import com.maddyhome.idea.vim.command.Command | ||||
| import com.maddyhome.idea.vim.command.OperatorArguments | ||||
| import com.maddyhome.idea.vim.handler.VimActionHandler | ||||
| @@ -27,7 +27,7 @@ import com.maddyhome.idea.vim.handler.VimActionHandler | ||||
| class ExEntryAction : VimActionHandler.SingleExecution() { | ||||
|   override val type: Command.Type = Command.Type.OTHER_READONLY | ||||
|  | ||||
|   override fun execute(editor: Editor, context: DataContext, cmd: Command, operatorArguments: OperatorArguments): Boolean { | ||||
|   override fun execute(editor: VimEditor, context: ExecutionContext, cmd: Command, operatorArguments: OperatorArguments): Boolean { | ||||
|     VimPlugin.getProcess().startExCommand(editor, context, cmd) | ||||
|     return true | ||||
|   } | ||||
|   | ||||
| @@ -1,49 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
| package com.maddyhome.idea.vim.action | ||||
|  | ||||
| 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.command.Command | ||||
| import com.maddyhome.idea.vim.command.CommandState | ||||
| import com.maddyhome.idea.vim.command.OperatorArguments | ||||
| import com.maddyhome.idea.vim.group.MotionGroup | ||||
| import com.maddyhome.idea.vim.handler.VimActionHandler | ||||
| import com.maddyhome.idea.vim.helper.getTopLevelEditor | ||||
| import com.maddyhome.idea.vim.helper.mode | ||||
| import com.maddyhome.idea.vim.helper.vimForEachCaret | ||||
|  | ||||
| class ResetModeAction : VimActionHandler.SingleExecution() { | ||||
|   override val type: Command.Type = Command.Type.OTHER_WRITABLE | ||||
|  | ||||
|   override fun execute(editor: Editor, context: DataContext, cmd: Command, operatorArguments: OperatorArguments): Boolean { | ||||
|     val modeBeforeReset = editor.mode | ||||
|     KeyHandler.getInstance().fullReset(editor.getTopLevelEditor()) | ||||
|  | ||||
|     if (modeBeforeReset == CommandState.Mode.INSERT) { | ||||
|       editor.vimForEachCaret { caret -> | ||||
|         val position = VimPlugin.getMotion().getOffsetOfHorizontalMotion(editor, caret, -1, false) | ||||
|         MotionGroup.moveCaret(editor, caret, position) | ||||
|       } | ||||
|     } | ||||
|  | ||||
|     return true | ||||
|   } | ||||
| } | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 The IdeaVim authors | ||||
|  * Copyright (C) 2003-2022 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 | ||||
|  | ||||
| import com.intellij.openapi.actionSystem.ActionPlaces | ||||
| import com.intellij.openapi.actionSystem.ActionUpdateThread | ||||
| import com.intellij.openapi.actionSystem.AnActionEvent | ||||
| import com.intellij.openapi.project.DumbAwareToggleAction | ||||
| import com.maddyhome.idea.vim.VimPlugin | ||||
| @@ -42,4 +43,6 @@ class VimPluginToggleAction : DumbAwareToggleAction()/*, LightEditCompatible*/ { | ||||
|       if (VimPlugin.isEnabled()) MessageHelper.message("action.VimPluginToggle.enabled") else MessageHelper.message("action.VimPluginToggle.enable") | ||||
|     } else MessageHelper.message("action.VimPluginToggle.text") | ||||
|   } | ||||
|  | ||||
|   override fun getActionUpdateThread() = ActionUpdateThread.BGT | ||||
| } | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 The IdeaVim authors | ||||
|  * Copyright (C) 2003-2022 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 | ||||
| @@ -20,6 +20,7 @@ package com.maddyhome.idea.vim.action | ||||
| import com.google.common.collect.ImmutableSet | ||||
| import com.intellij.codeInsight.lookup.LookupManager | ||||
| import com.intellij.openapi.actionSystem.ActionManager | ||||
| import com.intellij.openapi.actionSystem.ActionUpdateThread | ||||
| import com.intellij.openapi.actionSystem.AnAction | ||||
| import com.intellij.openapi.actionSystem.AnActionEvent | ||||
| import com.intellij.openapi.actionSystem.EmptyAction | ||||
| @@ -34,10 +35,10 @@ import com.intellij.openapi.util.Key | ||||
| import com.intellij.ui.KeyStrokeAdapter | ||||
| import com.maddyhome.idea.vim.KeyHandler | ||||
| import com.maddyhome.idea.vim.VimPlugin | ||||
| import com.maddyhome.idea.vim.api.injector | ||||
| import com.maddyhome.idea.vim.helper.EditorDataContext | ||||
| import com.maddyhome.idea.vim.helper.EditorHelper | ||||
| import com.maddyhome.idea.vim.helper.HandlerInjector | ||||
| import com.maddyhome.idea.vim.helper.StringHelper | ||||
| import com.maddyhome.idea.vim.helper.inInsertMode | ||||
| import com.maddyhome.idea.vim.helper.inNormalMode | ||||
| import com.maddyhome.idea.vim.helper.isIdeaVimDisabledHere | ||||
| @@ -48,10 +49,14 @@ import com.maddyhome.idea.vim.key.ShortcutOwner | ||||
| import com.maddyhome.idea.vim.key.ShortcutOwnerInfo | ||||
| import com.maddyhome.idea.vim.listener.AceJumpService | ||||
| import com.maddyhome.idea.vim.listener.AppCodeTemplates.appCodeTemplateCaptured | ||||
| import com.maddyhome.idea.vim.newapi.IjVimEditor | ||||
| import com.maddyhome.idea.vim.newapi.vim | ||||
| import com.maddyhome.idea.vim.options.OptionChangeListener | ||||
| import com.maddyhome.idea.vim.options.OptionConstants | ||||
| import com.maddyhome.idea.vim.options.OptionScope | ||||
| import com.maddyhome.idea.vim.vimscript.model.datatypes.VimDataType | ||||
| import com.maddyhome.idea.vim.vimscript.model.datatypes.VimString | ||||
| import com.maddyhome.idea.vim.vimscript.model.options.OptionChangeListener | ||||
| import com.maddyhome.idea.vim.vimscript.services.OptionService | ||||
| import com.maddyhome.idea.vim.vimscript.services.IjVimOptionService | ||||
| import java.awt.event.InputEvent | ||||
| import java.awt.event.KeyEvent | ||||
| import javax.swing.KeyStroke | ||||
| @@ -63,7 +68,7 @@ import javax.swing.KeyStroke | ||||
|  * These keys are not passed to [com.maddyhome.idea.vim.VimTypedActionHandler] and should be handled by actions. | ||||
|  */ | ||||
| class VimShortcutKeyAction : AnAction(), DumbAware/*, LightEditCompatible*/ { | ||||
|   private val traceTime = VimPlugin.getOptionService().isSet(OptionService.Scope.GLOBAL, "ideatracetime") | ||||
|   private val traceTime = VimPlugin.getOptionService().isSet(OptionScope.GLOBAL, OptionConstants.ideatracetimeName) | ||||
|  | ||||
|   override fun actionPerformed(e: AnActionEvent) { | ||||
|     LOG.trace("Executing shortcut key action") | ||||
| @@ -77,7 +82,7 @@ class VimShortcutKeyAction : AnAction(), DumbAware/*, LightEditCompatible*/ { | ||||
|       // Should we use HelperKt.getTopLevelEditor(editor) here, as we did in former EditorKeyHandler? | ||||
|       try { | ||||
|         val start = if (traceTime) System.currentTimeMillis() else null | ||||
|         KeyHandler.getInstance().handleKey(editor, keyStroke, EditorDataContext.init(editor, e.dataContext)) | ||||
|         KeyHandler.getInstance().handleKey(editor.vim, keyStroke, EditorDataContext.init(editor, e.dataContext).vim) | ||||
|         if (start != null) { | ||||
|           val duration = System.currentTimeMillis() - start | ||||
|           LOG.info("VimShortcut update '$keyStroke': $duration ms") | ||||
| @@ -91,6 +96,10 @@ class VimShortcutKeyAction : AnAction(), DumbAware/*, LightEditCompatible*/ { | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   // There is a chance that we can use BGT, but we call for isCell inside the update. | ||||
|   // Not sure if can can use BGT with this call. Let's use EDT for now. | ||||
|   override fun getActionUpdateThread() = ActionUpdateThread.EDT | ||||
|  | ||||
|   override fun update(e: AnActionEvent) { | ||||
|     val start = if (traceTime) System.currentTimeMillis() else null | ||||
|     e.presentation.isEnabled = isEnabled(e) | ||||
| @@ -121,8 +130,8 @@ class VimShortcutKeyAction : AnAction(), DumbAware/*, LightEditCompatible*/ { | ||||
|  | ||||
|       val keyCode = keyStroke.keyCode | ||||
|  | ||||
|       if (HandlerInjector.notebookCommandMode()) { | ||||
|         LOG.trace("Python Notebook command mode") | ||||
|       if (HandlerInjector.notebookCommandMode(editor)) { | ||||
|         LOG.debug("Python Notebook command mode") | ||||
|         if (keyCode == KeyEvent.VK_RIGHT || keyCode == KeyEvent.VK_KP_RIGHT || keyCode == KeyEvent.VK_ENTER) { | ||||
|           invokeLater { editor.updateCaretsVisualAttributes() } | ||||
|         } | ||||
| @@ -145,6 +154,10 @@ class VimShortcutKeyAction : AnAction(), DumbAware/*, LightEditCompatible*/ { | ||||
|  | ||||
|       if ((keyCode == KeyEvent.VK_TAB || keyCode == KeyEvent.VK_ENTER) && editor.appCodeTemplateCaptured()) return false | ||||
|        | ||||
|       if (keyCode == KeyEvent.VK_LEFT || keyCode == KeyEvent.VK_RIGHT) return false | ||||
|       if (keyCode == KeyEvent.VK_UP || keyCode == KeyEvent.VK_DOWN) return false | ||||
|       if (keyCode == KeyEvent.VK_HOME || keyCode == KeyEvent.VK_END) return false | ||||
|  | ||||
|       if (editor.inInsertMode) { | ||||
|         if (keyCode == KeyEvent.VK_TAB) { | ||||
|           // TODO: This stops VimEditorTab seeing <Tab> in insert mode and correctly scrolling the view | ||||
| @@ -170,19 +183,7 @@ class VimShortcutKeyAction : AnAction(), DumbAware/*, LightEditCompatible*/ { | ||||
|  | ||||
|       val savedShortcutConflicts = VimPlugin.getKey().savedShortcutConflicts | ||||
|       val info = savedShortcutConflicts[keyStroke] | ||||
|       if (info is ShortcutOwner) { | ||||
|         return when (info) { | ||||
|           ShortcutOwner.VIM -> true | ||||
|           ShortcutOwner.IDE -> !isShortcutConflict(keyStroke) | ||||
|           else -> { | ||||
|             if (isShortcutConflict(keyStroke)) { | ||||
|               savedShortcutConflicts[keyStroke] = ShortcutOwnerInfo.allUndefined | ||||
|             } | ||||
|             true | ||||
|           } | ||||
|         } | ||||
|       } | ||||
|       return when ((info as? ShortcutOwnerInfo)?.forEditor(editor)) { | ||||
|       return when (info?.forEditor(editor.vim)) { | ||||
|         ShortcutOwner.VIM -> true | ||||
|         ShortcutOwner.IDE -> !isShortcutConflict(keyStroke) | ||||
|         else -> { | ||||
| @@ -197,10 +198,10 @@ class VimShortcutKeyAction : AnAction(), DumbAware/*, LightEditCompatible*/ { | ||||
|   } | ||||
|  | ||||
|   private fun isEnabledForEscape(editor: Editor): Boolean { | ||||
|     val ideaVimSupportValue = (VimPlugin.getOptionService().getOptionValue(OptionService.Scope.LOCAL(editor), "ideavimsupport") as VimString).value | ||||
|     val ideaVimSupportValue = (VimPlugin.getOptionService().getOptionValue(OptionScope.LOCAL(IjVimEditor(editor)), IjVimOptionService.ideavimsupportName) as VimString).value | ||||
|     return editor.isPrimaryEditor() || | ||||
|       EditorHelper.isFileEditor(editor) && !editor.inNormalMode || | ||||
|       ideaVimSupportValue.contains("dialog") && !editor.inNormalMode | ||||
|       ideaVimSupportValue.contains(IjVimOptionService.ideavimsupport_dialog) && !editor.inNormalMode | ||||
|   } | ||||
|  | ||||
|   private fun isShortcutConflict(keyStroke: KeyStroke): Boolean { | ||||
| @@ -246,7 +247,7 @@ class VimShortcutKeyAction : AnAction(), DumbAware/*, LightEditCompatible*/ { | ||||
|  | ||||
|     init { | ||||
|       VimPlugin.getOptionService().addListener( | ||||
|         "lookupkeys", | ||||
|         OptionConstants.lookupkeysName, | ||||
|         object : OptionChangeListener<VimDataType> { | ||||
|           override fun processGlobalValueChange(oldValue: VimDataType?) { | ||||
|             parsedLookupKeys = parseLookupKeys() | ||||
| @@ -257,9 +258,9 @@ class VimShortcutKeyAction : AnAction(), DumbAware/*, LightEditCompatible*/ { | ||||
|  | ||||
|     fun isEnabledForLookup(keyStroke: KeyStroke): Boolean = keyStroke !in parsedLookupKeys | ||||
|  | ||||
|     private fun parseLookupKeys() = (VimPlugin.getOptionService().getOptionValue(OptionService.Scope.GLOBAL, "lookupkeys") as VimString).value | ||||
|     private fun parseLookupKeys() = (VimPlugin.getOptionService().getOptionValue(OptionScope.GLOBAL, OptionConstants.lookupkeysName) as VimString).value | ||||
|       .split(",") | ||||
|       .map { StringHelper.parseKeys(it) } | ||||
|       .map { injector.parser.parseKeys(it) } | ||||
|       .filter { it.isNotEmpty() } | ||||
|       .map { it.first() } | ||||
|       .toSet() | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 The IdeaVim authors | ||||
|  * Copyright (C) 2003-2022 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,57 +17,109 @@ | ||||
|  */ | ||||
| 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.api.ExecutionContext | ||||
| import com.maddyhome.idea.vim.api.VimCaret | ||||
| import com.maddyhome.idea.vim.api.VimEditor | ||||
| import com.maddyhome.idea.vim.api.injector | ||||
| import com.maddyhome.idea.vim.command.Argument | ||||
| import com.maddyhome.idea.vim.command.Command | ||||
| import com.maddyhome.idea.vim.command.CommandFlags | ||||
| import com.maddyhome.idea.vim.command.OperatorArguments | ||||
| import com.maddyhome.idea.vim.command.SelectionType | ||||
| import com.maddyhome.idea.vim.common.TextRange | ||||
| import com.maddyhome.idea.vim.common.argumentCaptured | ||||
| import com.maddyhome.idea.vim.group.MotionGroup | ||||
| import com.maddyhome.idea.vim.group.visual.VimSelection | ||||
| import com.maddyhome.idea.vim.handler.VimActionHandler | ||||
| import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler | ||||
| import com.maddyhome.idea.vim.helper.MessageHelper | ||||
| import com.maddyhome.idea.vim.helper.commandState | ||||
| import com.maddyhome.idea.vim.helper.enumSetOf | ||||
| import com.maddyhome.idea.vim.helper.vimStateMachine | ||||
| import com.maddyhome.idea.vim.newapi.ij | ||||
| import java.util.* | ||||
|  | ||||
| private fun doOperatorAction(editor: VimEditor, context: ExecutionContext, textRange: TextRange, selectionType: SelectionType): Boolean { | ||||
|   val operatorFunction = injector.keyGroup.operatorFunction | ||||
|   if (operatorFunction == null) { | ||||
|     VimPlugin.showMessage(MessageHelper.message("E774")) | ||||
|     return false | ||||
|   } | ||||
|  | ||||
|   val saveRepeatHandler = VimRepeater.repeatHandler | ||||
|   VimPlugin.getMark().setChangeMarks(editor, textRange) | ||||
|   KeyHandler.getInstance().reset(editor) | ||||
|   val result = operatorFunction.apply(editor, context, selectionType) | ||||
|   VimRepeater.repeatHandler = saveRepeatHandler | ||||
|   return result | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * @author vlan | ||||
|  */ | ||||
| class OperatorAction : VimActionHandler.SingleExecution() { | ||||
|   override val type: Command.Type = Command.Type.OTHER_SELF_SYNCHRONIZED | ||||
|  | ||||
|   override val argumentType: Argument.Type = Argument.Type.MOTION | ||||
|  | ||||
|   override fun execute(editor: Editor, context: DataContext, cmd: Command, operatorArguments: OperatorArguments): Boolean { | ||||
|     val operatorFunction = VimPlugin.getKey().operatorFunction | ||||
|     if (operatorFunction != null) { | ||||
|       val argument = cmd.argument | ||||
|       if (argument != null) { | ||||
|         if (!editor.commandState.isDotRepeatInProgress) { | ||||
|           VimRepeater.Extension.argumentCaptured = argument | ||||
|         } | ||||
|         val saveRepeatHandler = VimRepeater.repeatHandler | ||||
|         val motion = argument.motion | ||||
|         val range = MotionGroup | ||||
|           .getMotionRange( | ||||
|             editor, | ||||
|             editor.caretModel.primaryCaret, | ||||
|             context, | ||||
|             argument, | ||||
|             operatorArguments | ||||
|           ) | ||||
|         if (range != null) { | ||||
|           VimPlugin.getMark().setChangeMarks(editor, range) | ||||
|           val selectionType = if (motion.isLinewiseMotion()) SelectionType.LINE_WISE else SelectionType.CHARACTER_WISE | ||||
|           KeyHandler.getInstance().reset(editor) | ||||
|           val result = operatorFunction.apply(editor, context, selectionType) | ||||
|           VimRepeater.repeatHandler = saveRepeatHandler | ||||
|           return result | ||||
|         } | ||||
|       } | ||||
|       return false | ||||
|   override fun execute(editor: VimEditor, context: ExecutionContext, cmd: Command, operatorArguments: OperatorArguments): Boolean { | ||||
|     val argument = cmd.argument ?: return false | ||||
|     if (!editor.vimStateMachine.isDotRepeatInProgress) { | ||||
|       argumentCaptured = argument | ||||
|     } | ||||
|     val range = getMotionRange(editor, context, argument, operatorArguments) | ||||
|  | ||||
|     if (range != null) { | ||||
|       val selectionType = if (argument.motion.isLinewiseMotion()) { | ||||
|         SelectionType.LINE_WISE | ||||
|       } else { | ||||
|         SelectionType.CHARACTER_WISE | ||||
|       } | ||||
|       return doOperatorAction(editor, context, range, selectionType) | ||||
|     } | ||||
|     VimPlugin.showMessage(MessageHelper.message("E774")) | ||||
|     return false | ||||
|   } | ||||
|  | ||||
|   private fun getMotionRange( | ||||
|     editor: VimEditor, | ||||
|     context: ExecutionContext, | ||||
|     argument: Argument, | ||||
|     operatorArguments: OperatorArguments | ||||
|   ): TextRange? { | ||||
|  | ||||
|     // Note that we're using getMotionRange2 in order to avoid normalising the linewise range into line start | ||||
|     // offsets that will be used to set the change marks. This affects things like the location of the caret in the | ||||
|     // Commentary extension | ||||
|     val ijEditor = editor.ij | ||||
|     return MotionGroup.getMotionRange2( | ||||
|       ijEditor, | ||||
|       ijEditor.caretModel.primaryCaret, | ||||
|       context.ij, | ||||
|       argument, | ||||
|       operatorArguments | ||||
|     )?.normalize()?.let { | ||||
|  | ||||
|       // If we're linewise, make sure the end offset isn't just the EOL char | ||||
|       if (argument.motion.isLinewiseMotion() && it.endOffset < editor.fileSize()) { | ||||
|         TextRange(it.startOffset, it.endOffset + 1) | ||||
|       } else { | ||||
|         it | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  | ||||
| class VisualOperatorAction : VisualOperatorActionHandler.ForEachCaret() { | ||||
|   override val type: Command.Type = Command.Type.OTHER_SELF_SYNCHRONIZED | ||||
|  | ||||
|   override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_EXIT_VISUAL) | ||||
|  | ||||
|   override fun executeAction( | ||||
|     editor: VimEditor, | ||||
|     caret: VimCaret, | ||||
|     context: ExecutionContext, | ||||
|     cmd: Command, | ||||
|     range: VimSelection, | ||||
|     operatorArguments: OperatorArguments, | ||||
|   ): Boolean { | ||||
|     return doOperatorAction(editor, context, range.toVimTextRange(), range.type) | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 The IdeaVim authors | ||||
|  * Copyright (C) 2003-2022 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,44 +17,49 @@ | ||||
|  */ | ||||
| package com.maddyhome.idea.vim.action.change | ||||
|  | ||||
| import com.intellij.openapi.actionSystem.DataContext | ||||
| import com.intellij.openapi.command.CommandProcessor | ||||
| import com.intellij.openapi.editor.Editor | ||||
| import com.maddyhome.idea.vim.KeyHandler | ||||
| import com.maddyhome.idea.vim.VimPlugin | ||||
| import com.maddyhome.idea.vim.command.Argument | ||||
| import com.maddyhome.idea.vim.api.ExecutionContext | ||||
| import com.maddyhome.idea.vim.api.VimEditor | ||||
| import com.maddyhome.idea.vim.api.injector | ||||
| import com.maddyhome.idea.vim.command.Command | ||||
| import com.maddyhome.idea.vim.command.OperatorArguments | ||||
| import com.maddyhome.idea.vim.extension.VimExtensionHandler | ||||
| import com.maddyhome.idea.vim.handler.VimActionHandler | ||||
| import com.maddyhome.idea.vim.helper.commandState | ||||
| import javax.swing.KeyStroke | ||||
| import com.maddyhome.idea.vim.helper.vimStateMachine | ||||
| import com.maddyhome.idea.vim.newapi.ij | ||||
|  | ||||
| class RepeatChangeAction : VimActionHandler.SingleExecution() { | ||||
|   override val type: Command.Type = Command.Type.OTHER_WRITABLE | ||||
|  | ||||
|   override fun execute(editor: Editor, context: DataContext, cmd: Command, operatorArguments: OperatorArguments): Boolean { | ||||
|     val state = editor.commandState | ||||
|   override fun execute(editor: VimEditor, context: ExecutionContext, cmd: Command, operatorArguments: OperatorArguments): Boolean { | ||||
|     val state = editor.vimStateMachine | ||||
|     val lastCommand = VimRepeater.lastChangeCommand | ||||
|  | ||||
|     if (lastCommand == null && VimRepeater.Extension.lastExtensionHandler == null) return false | ||||
|     if (lastCommand == null && Extension.lastExtensionHandler == null) return false | ||||
|  | ||||
|     // Save state | ||||
|     val save = state.executingCommand | ||||
|     val lastFTCmd = VimPlugin.getMotion().lastFTCmd | ||||
|     val lastFTChar = VimPlugin.getMotion().lastFTChar | ||||
|     val reg = VimPlugin.getRegister().currentRegister | ||||
|     val lastHandler = VimRepeater.Extension.lastExtensionHandler | ||||
|     val lastFTCmd = injector.motion.lastFTCmd | ||||
|     val lastFTChar = injector.motion.lastFTChar | ||||
|     val reg = injector.registerGroup.currentRegister | ||||
|     val lastHandler = Extension.lastExtensionHandler | ||||
|     val repeatHandler = VimRepeater.repeatHandler | ||||
|  | ||||
|     state.isDotRepeatInProgress = true | ||||
|     VimPlugin.getRegister().selectRegister(VimRepeater.lastChangeRegister) | ||||
|  | ||||
|     // A fancy 'redo-register' feature | ||||
|     // VIM-2643, :h redo-register | ||||
|     if (VimRepeater.lastChangeRegister in '1'..'8') { | ||||
|       VimRepeater.lastChangeRegister = VimRepeater.lastChangeRegister.inc() | ||||
|     } | ||||
|  | ||||
|     injector.registerGroup.selectRegister(VimRepeater.lastChangeRegister) | ||||
|  | ||||
|     try { | ||||
|       if (repeatHandler && lastHandler != null) { | ||||
|         val processor = CommandProcessor.getInstance() | ||||
|         processor.executeCommand( | ||||
|           editor.project, | ||||
|           editor.ij.project, | ||||
|           { lastHandler.execute(editor, context) }, | ||||
|           "Vim " + lastHandler.javaClass.simpleName, | ||||
|           null | ||||
| @@ -71,7 +76,7 @@ class RepeatChangeAction : VimActionHandler.SingleExecution() { | ||||
|         state.setExecutingCommand(lastCommand) | ||||
|  | ||||
|         val arguments = operatorArguments.copy(count0 = lastCommand.rawCount) | ||||
|         KeyHandler.executeVimAction(editor, lastCommand.action, context, arguments) | ||||
|         injector.actionExecutor.executeVimAction(editor, lastCommand.action, context, arguments) | ||||
|  | ||||
|         VimRepeater.saveLastChange(lastCommand) | ||||
|       } | ||||
| @@ -83,66 +88,10 @@ class RepeatChangeAction : VimActionHandler.SingleExecution() { | ||||
|     // Restore state | ||||
|     if (save != null) state.setExecutingCommand(save) | ||||
|     VimPlugin.getMotion().setLastFTCmd(lastFTCmd, lastFTChar) | ||||
|     if (lastHandler != null) VimRepeater.Extension.lastExtensionHandler = lastHandler | ||||
|     if (lastHandler != null) Extension.lastExtensionHandler = lastHandler | ||||
|     VimRepeater.repeatHandler = repeatHandler | ||||
|     VimRepeater.Extension.reset() | ||||
|     Extension.reset() | ||||
|     VimPlugin.getRegister().selectRegister(reg) | ||||
|     return true | ||||
|   } | ||||
| } | ||||
|  | ||||
| object VimRepeater { | ||||
|   var repeatHandler = false | ||||
|  | ||||
|   var lastChangeCommand: Command? = null | ||||
|     private set | ||||
|   var lastChangeRegister = VimPlugin.getRegister().defaultRegister | ||||
|     private set | ||||
|  | ||||
|   fun saveLastChange(command: Command) { | ||||
|     lastChangeCommand = command | ||||
|     lastChangeRegister = VimPlugin.getRegister().currentRegister | ||||
|   } | ||||
|  | ||||
|   object Extension { | ||||
|     var lastExtensionHandler: VimExtensionHandler? = null | ||||
|     var argumentCaptured: Argument? = null | ||||
|  | ||||
|     private val keyStrokes = mutableListOf<KeyStroke>() | ||||
|     private val strings = mutableListOf<String>() | ||||
|  | ||||
|     private var keystrokePointer = 0 | ||||
|     private var stringPointer = 0 | ||||
|  | ||||
|     fun addKeystroke(key: KeyStroke) = keyStrokes.add(key) | ||||
|     fun addString(key: String) = strings.add(key) | ||||
|  | ||||
|     fun consumeKeystroke(): KeyStroke? { | ||||
|       if (keystrokePointer in keyStrokes.indices) { | ||||
|         keystrokePointer += 1 | ||||
|         return keyStrokes[keystrokePointer - 1] | ||||
|       } | ||||
|       return null | ||||
|     } | ||||
|  | ||||
|     fun consumeString(): String? { | ||||
|       if (stringPointer in strings.indices) { | ||||
|         stringPointer += 1 | ||||
|         return strings[stringPointer - 1] | ||||
|       } | ||||
|       return null | ||||
|     } | ||||
|  | ||||
|     fun reset() { | ||||
|       keystrokePointer = 0 | ||||
|       stringPointer = 0 | ||||
|     } | ||||
|  | ||||
|     fun clean() { | ||||
|       keyStrokes.clear() | ||||
|       strings.clear() | ||||
|       keystrokePointer = 0 | ||||
|       stringPointer = 0 | ||||
|     } | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -1,48 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
| 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.command.Argument | ||||
| import com.maddyhome.idea.vim.command.Command | ||||
| import com.maddyhome.idea.vim.command.CommandFlags | ||||
| import com.maddyhome.idea.vim.command.OperatorArguments | ||||
| import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler | ||||
| import com.maddyhome.idea.vim.helper.enumSetOf | ||||
| import java.util.* | ||||
|  | ||||
| class ChangeCharacterAction : ChangeEditorActionHandler.ForEachCaret() { | ||||
|   override val type: Command.Type = Command.Type.CHANGE | ||||
|  | ||||
|   override val argumentType: Argument.Type = Argument.Type.DIGRAPH | ||||
|  | ||||
|   override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_ALLOW_DIGRAPH) | ||||
|  | ||||
|   override fun execute( | ||||
|     editor: Editor, | ||||
|     caret: Caret, | ||||
|     context: DataContext, | ||||
|     argument: Argument?, | ||||
|     operatorArguments: OperatorArguments, | ||||
|   ): Boolean { | ||||
|     return argument != null && VimPlugin.getChange().changeCharacter(editor, caret, operatorArguments.count1, argument.character) | ||||
|   } | ||||
| } | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 The IdeaVim authors | ||||
|  * Copyright (C) 2003-2022 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,38 +17,38 @@ | ||||
|  */ | ||||
| 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.util.Ref | ||||
| import com.maddyhome.idea.vim.VimPlugin | ||||
| import com.maddyhome.idea.vim.api.ExecutionContext | ||||
| import com.maddyhome.idea.vim.api.VimCaret | ||||
| import com.maddyhome.idea.vim.api.VimEditor | ||||
| import com.maddyhome.idea.vim.api.injector | ||||
| import com.maddyhome.idea.vim.command.Argument | ||||
| import com.maddyhome.idea.vim.command.Command | ||||
| import com.maddyhome.idea.vim.command.OperatorArguments | ||||
| import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler | ||||
| import com.maddyhome.idea.vim.vimscript.services.OptionService | ||||
| import com.maddyhome.idea.vim.options.OptionScope | ||||
| import com.maddyhome.idea.vim.vimscript.services.IjVimOptionService | ||||
|  | ||||
| class DeleteJoinLinesAction : ChangeEditorActionHandler.SingleExecution() { | ||||
|   override val type: Command.Type = Command.Type.DELETE | ||||
|  | ||||
|   override fun execute( | ||||
|     editor: Editor, | ||||
|     context: DataContext, | ||||
|     editor: VimEditor, | ||||
|     context: ExecutionContext, | ||||
|     argument: Argument?, | ||||
|     operatorArguments: OperatorArguments, | ||||
|   ): Boolean { | ||||
|     if (editor.isOneLineMode) return false | ||||
|     if (VimPlugin.getOptionService().isSet(OptionService.Scope.LOCAL(editor), "ideajoin")) { | ||||
|       return VimPlugin.getChange().joinViaIdeaByCount(editor, context, operatorArguments.count1) | ||||
|     if (editor.isOneLineMode()) return false | ||||
|     if (injector.optionService.isSet(OptionScope.LOCAL(editor), IjVimOptionService.ideajoinName)) { | ||||
|       return injector.changeGroup.joinViaIdeaByCount(editor, context, operatorArguments.count1) | ||||
|     } | ||||
|     VimPlugin.getEditor().notifyIdeaJoin(editor.project) | ||||
|     val res = Ref.create(true) | ||||
|     editor.caretModel.runForEachCaret( | ||||
|       { caret: Caret -> | ||||
|         if (!VimPlugin.getChange().deleteJoinLines(editor, caret, operatorArguments.count1, false)) res.set(false) | ||||
|     injector.editorGroup.notifyIdeaJoin(editor) | ||||
|     val res = arrayOf(true) | ||||
|     editor.forEachNativeCaret( | ||||
|       { caret: VimCaret -> | ||||
|         if (!injector.changeGroup.deleteJoinLines(editor, caret, operatorArguments.count1, false, operatorArguments)) res[0] = false | ||||
|       }, | ||||
|       true | ||||
|     ) | ||||
|     return res.get() | ||||
|     return res[0] | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 The IdeaVim authors | ||||
|  * Copyright (C) 2003-2022 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,38 +17,38 @@ | ||||
|  */ | ||||
| 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.util.Ref | ||||
| import com.maddyhome.idea.vim.VimPlugin | ||||
| import com.maddyhome.idea.vim.api.ExecutionContext | ||||
| import com.maddyhome.idea.vim.api.VimCaret | ||||
| import com.maddyhome.idea.vim.api.VimEditor | ||||
| import com.maddyhome.idea.vim.api.injector | ||||
| import com.maddyhome.idea.vim.command.Argument | ||||
| import com.maddyhome.idea.vim.command.Command | ||||
| import com.maddyhome.idea.vim.command.OperatorArguments | ||||
| import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler | ||||
| import com.maddyhome.idea.vim.vimscript.services.OptionService | ||||
| import com.maddyhome.idea.vim.options.OptionScope | ||||
| import com.maddyhome.idea.vim.vimscript.services.IjVimOptionService | ||||
|  | ||||
| class DeleteJoinLinesSpacesAction : ChangeEditorActionHandler.SingleExecution() { | ||||
|   override val type: Command.Type = Command.Type.DELETE | ||||
|  | ||||
|   override fun execute( | ||||
|     editor: Editor, | ||||
|     context: DataContext, | ||||
|     editor: VimEditor, | ||||
|     context: ExecutionContext, | ||||
|     argument: Argument?, | ||||
|     operatorArguments: OperatorArguments, | ||||
|   ): Boolean { | ||||
|     if (editor.isOneLineMode) return false | ||||
|     if (VimPlugin.getOptionService().isSet(OptionService.Scope.LOCAL(editor), "ideajoin")) { | ||||
|       return VimPlugin.getChange().joinViaIdeaByCount(editor, context, operatorArguments.count1) | ||||
|     if (editor.isOneLineMode()) return false | ||||
|     if (injector.optionService.isSet(OptionScope.LOCAL(editor), IjVimOptionService.ideajoinName)) { | ||||
|       return injector.changeGroup.joinViaIdeaByCount(editor, context, operatorArguments.count1) | ||||
|     } | ||||
|     VimPlugin.getEditor().notifyIdeaJoin(editor.project) | ||||
|     val res = Ref.create(true) | ||||
|     editor.caretModel.runForEachCaret( | ||||
|       { caret: Caret -> | ||||
|         if (!VimPlugin.getChange().deleteJoinLines(editor, caret, operatorArguments.count1, true)) res.set(false) | ||||
|     injector.editorGroup.notifyIdeaJoin(editor) | ||||
|     val res = arrayOf(true) | ||||
|     editor.forEachNativeCaret( | ||||
|       { caret: VimCaret -> | ||||
|         if (!injector.changeGroup.deleteJoinLines(editor, caret, operatorArguments.count1, true, operatorArguments)) res[0] = false | ||||
|       }, | ||||
|       true | ||||
|     ) | ||||
|     return res.get() | ||||
|     return res[0] | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 The IdeaVim authors | ||||
|  * Copyright (C) 2003-2022 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,18 +17,18 @@ | ||||
|  */ | ||||
| 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.util.Ref | ||||
| import com.maddyhome.idea.vim.VimPlugin | ||||
| import com.maddyhome.idea.vim.api.ExecutionContext | ||||
| import com.maddyhome.idea.vim.api.VimCaret | ||||
| import com.maddyhome.idea.vim.api.VimEditor | ||||
| import com.maddyhome.idea.vim.api.injector | ||||
| import com.maddyhome.idea.vim.command.Command | ||||
| import com.maddyhome.idea.vim.command.CommandFlags | ||||
| import com.maddyhome.idea.vim.command.OperatorArguments | ||||
| import com.maddyhome.idea.vim.group.visual.VimSelection | ||||
| import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler | ||||
| import com.maddyhome.idea.vim.helper.enumSetOf | ||||
| import com.maddyhome.idea.vim.vimscript.services.OptionService | ||||
| import com.maddyhome.idea.vim.options.OptionScope | ||||
| import com.maddyhome.idea.vim.vimscript.services.IjVimOptionService | ||||
| import java.util.* | ||||
|  | ||||
| /** | ||||
| @@ -40,28 +40,35 @@ class DeleteJoinVisualLinesAction : VisualOperatorActionHandler.SingleExecution( | ||||
|   override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_EXIT_VISUAL) | ||||
|  | ||||
|   override fun executeForAllCarets( | ||||
|     editor: Editor, | ||||
|     context: DataContext, | ||||
|     editor: VimEditor, | ||||
|     context: ExecutionContext, | ||||
|     cmd: Command, | ||||
|     caretsAndSelections: Map<Caret, VimSelection>, | ||||
|     caretsAndSelections: Map<VimCaret, VimSelection>, | ||||
|     operatorArguments: OperatorArguments, | ||||
|   ): Boolean { | ||||
|     if (editor.isOneLineMode) return false | ||||
|     if (VimPlugin.getOptionService().isSet(OptionService.Scope.LOCAL(editor), "ideajoin")) { | ||||
|       VimPlugin.getChange().joinViaIdeaBySelections(editor, context, caretsAndSelections) | ||||
|     if (editor.isOneLineMode()) return false | ||||
|     if (injector.optionService.isSet(OptionScope.LOCAL(editor), IjVimOptionService.ideajoinName)) { | ||||
|       injector.changeGroup.joinViaIdeaBySelections(editor, context, caretsAndSelections) | ||||
|       return true | ||||
|     } | ||||
|     val res = Ref.create(true) | ||||
|     editor.caretModel.runForEachCaret( | ||||
|       { caret: Caret -> | ||||
|         if (!caret.isValid) return@runForEachCaret | ||||
|         val range = caretsAndSelections[caret] ?: return@runForEachCaret | ||||
|         if (!VimPlugin.getChange().deleteJoinRange(editor, caret, range.toVimTextRange(true).normalize(), false)) { | ||||
|           res.set(false) | ||||
|     val res = arrayOf(true) | ||||
|     editor.forEachNativeCaret( | ||||
|       { | ||||
|         caret: VimCaret -> | ||||
|         if (!caret.isValid) return@forEachNativeCaret | ||||
|         val range = caretsAndSelections[caret] ?: return@forEachNativeCaret | ||||
|         if (!injector.changeGroup.deleteJoinRange( | ||||
|             editor, | ||||
|             caret, | ||||
|             range.toVimTextRange(true).normalize(), | ||||
|             false, | ||||
|             operatorArguments | ||||
|           ) | ||||
|         ) { | ||||
|           res[0] = false | ||||
|         } | ||||
|       }, | ||||
|       true | ||||
|       }, true | ||||
|     ) | ||||
|     return res.get() | ||||
|     return res[0] | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 The IdeaVim authors | ||||
|  * Copyright (C) 2003-2022 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,18 +17,18 @@ | ||||
|  */ | ||||
| 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.util.Ref | ||||
| import com.maddyhome.idea.vim.VimPlugin | ||||
| import com.maddyhome.idea.vim.api.ExecutionContext | ||||
| import com.maddyhome.idea.vim.api.VimCaret | ||||
| import com.maddyhome.idea.vim.api.VimEditor | ||||
| import com.maddyhome.idea.vim.api.injector | ||||
| import com.maddyhome.idea.vim.command.Command | ||||
| import com.maddyhome.idea.vim.command.CommandFlags | ||||
| import com.maddyhome.idea.vim.command.OperatorArguments | ||||
| import com.maddyhome.idea.vim.group.visual.VimSelection | ||||
| import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler | ||||
| import com.maddyhome.idea.vim.helper.enumSetOf | ||||
| import com.maddyhome.idea.vim.vimscript.services.OptionService | ||||
| import com.maddyhome.idea.vim.options.OptionScope | ||||
| import com.maddyhome.idea.vim.vimscript.services.IjVimOptionService | ||||
| import java.util.* | ||||
|  | ||||
| /** | ||||
| @@ -40,28 +40,35 @@ class DeleteJoinVisualLinesSpacesAction : VisualOperatorActionHandler.SingleExec | ||||
|   override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_EXIT_VISUAL) | ||||
|  | ||||
|   override fun executeForAllCarets( | ||||
|     editor: Editor, | ||||
|     context: DataContext, | ||||
|     editor: VimEditor, | ||||
|     context: ExecutionContext, | ||||
|     cmd: Command, | ||||
|     caretsAndSelections: Map<Caret, VimSelection>, | ||||
|     caretsAndSelections: Map<VimCaret, VimSelection>, | ||||
|     operatorArguments: OperatorArguments, | ||||
|   ): Boolean { | ||||
|     if (editor.isOneLineMode) return false | ||||
|     if (VimPlugin.getOptionService().isSet(OptionService.Scope.LOCAL(editor), "ideajoin")) { | ||||
|       VimPlugin.getChange().joinViaIdeaBySelections(editor, context, caretsAndSelections) | ||||
|     if (editor.isOneLineMode()) return false | ||||
|     if (injector.optionService.isSet(OptionScope.LOCAL(editor), IjVimOptionService.ideajoinName)) { | ||||
|       injector.changeGroup.joinViaIdeaBySelections(editor, context, caretsAndSelections) | ||||
|       return true | ||||
|     } | ||||
|     val res = Ref.create(true) | ||||
|     editor.caretModel.runForEachCaret( | ||||
|       { caret: Caret -> | ||||
|         if (!caret.isValid) return@runForEachCaret | ||||
|         val range = caretsAndSelections[caret] ?: return@runForEachCaret | ||||
|         if (!VimPlugin.getChange().deleteJoinRange(editor, caret, range.toVimTextRange(true).normalize(), true)) { | ||||
|           res.set(false) | ||||
|     val res = arrayOf(true) | ||||
|     editor.forEachNativeCaret( | ||||
|       { caret: VimCaret -> | ||||
|         if (!caret.isValid) return@forEachNativeCaret | ||||
|         val range = caretsAndSelections[caret] ?: return@forEachNativeCaret | ||||
|         if (!injector.changeGroup.deleteJoinRange( | ||||
|             editor, | ||||
|             caret, | ||||
|             range.toVimTextRange(true).normalize(), | ||||
|             true, | ||||
|             operatorArguments | ||||
|           ) | ||||
|         ) { | ||||
|           res[0] = false | ||||
|         } | ||||
|       }, | ||||
|       true | ||||
|     ) | ||||
|     return res.get() | ||||
|     return res[0] | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -1,43 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
| 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.maddyhome.idea.vim.VimPlugin | ||||
| import com.maddyhome.idea.vim.command.Argument | ||||
| import com.maddyhome.idea.vim.command.Command | ||||
| import com.maddyhome.idea.vim.command.OperatorArguments | ||||
| import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler | ||||
|  | ||||
| class InsertCharacterAboveCursorAction : ChangeEditorActionHandler.ForEachCaret() { | ||||
|   override val type: Command.Type = Command.Type.INSERT | ||||
|  | ||||
|   override fun execute( | ||||
|     editor: Editor, | ||||
|     caret: Caret, | ||||
|     context: DataContext, | ||||
|     argument: Argument?, | ||||
|     operatorArguments: OperatorArguments, | ||||
|   ): Boolean { | ||||
|     return if (editor.isOneLineMode) { | ||||
|       false | ||||
|     } else VimPlugin.getChange().insertCharacterAroundCursor(editor, caret, -1) | ||||
|   } | ||||
| } | ||||
| @@ -1,43 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
| 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.maddyhome.idea.vim.VimPlugin | ||||
| import com.maddyhome.idea.vim.command.Argument | ||||
| import com.maddyhome.idea.vim.command.Command | ||||
| import com.maddyhome.idea.vim.command.OperatorArguments | ||||
| import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler | ||||
|  | ||||
| class InsertCharacterBelowCursorAction : ChangeEditorActionHandler.ForEachCaret() { | ||||
|   override val type: Command.Type = Command.Type.INSERT | ||||
|  | ||||
|   override fun execute( | ||||
|     editor: Editor, | ||||
|     caret: Caret, | ||||
|     context: DataContext, | ||||
|     argument: Argument?, | ||||
|     operatorArguments: OperatorArguments, | ||||
|   ): Boolean { | ||||
|     return if (editor.isOneLineMode) { | ||||
|       false | ||||
|     } else VimPlugin.getChange().insertCharacterAroundCursor(editor, caret, 1) | ||||
|   } | ||||
| } | ||||
| @@ -1,46 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
| 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.maddyhome.idea.vim.VimPlugin | ||||
| import com.maddyhome.idea.vim.command.Argument | ||||
| import com.maddyhome.idea.vim.command.Command | ||||
| import com.maddyhome.idea.vim.command.CommandFlags | ||||
| import com.maddyhome.idea.vim.command.OperatorArguments | ||||
| import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler | ||||
| import com.maddyhome.idea.vim.helper.enumSetOf | ||||
| import java.util.* | ||||
|  | ||||
| class InsertDeleteInsertedTextAction : ChangeEditorActionHandler.ForEachCaret() { | ||||
|   override val type: Command.Type = Command.Type.INSERT | ||||
|  | ||||
|   override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_CLEAR_STROKES) | ||||
|  | ||||
|   override fun execute( | ||||
|     editor: Editor, | ||||
|     caret: Caret, | ||||
|     context: DataContext, | ||||
|     argument: Argument?, | ||||
|     operatorArguments: OperatorArguments, | ||||
|   ): Boolean { | ||||
|     return VimPlugin.getChange().insertDeleteInsertedText(editor, caret) | ||||
|   } | ||||
| } | ||||
| @@ -1,46 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
| 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.maddyhome.idea.vim.VimPlugin | ||||
| import com.maddyhome.idea.vim.command.Argument | ||||
| import com.maddyhome.idea.vim.command.Command | ||||
| import com.maddyhome.idea.vim.command.CommandFlags | ||||
| import com.maddyhome.idea.vim.command.OperatorArguments | ||||
| import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler | ||||
| import com.maddyhome.idea.vim.helper.enumSetOf | ||||
| import java.util.* | ||||
|  | ||||
| class InsertDeletePreviousWordAction : ChangeEditorActionHandler.ForEachCaret() { | ||||
|   override val type: Command.Type = Command.Type.INSERT | ||||
|  | ||||
|   override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_CLEAR_STROKES) | ||||
|  | ||||
|   override fun execute( | ||||
|     editor: Editor, | ||||
|     caret: Caret, | ||||
|     context: DataContext, | ||||
|     argument: Argument?, | ||||
|     operatorArguments: OperatorArguments, | ||||
|   ): Boolean { | ||||
|     return VimPlugin.getChange().insertDeletePreviousWord(editor, caret) | ||||
|   } | ||||
| } | ||||
| @@ -1,42 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
| package com.maddyhome.idea.vim.action.change.insert | ||||
|  | ||||
| import com.intellij.openapi.actionSystem.DataContext | ||||
| import com.intellij.openapi.editor.Editor | ||||
| import com.maddyhome.idea.vim.VimPlugin | ||||
| import com.maddyhome.idea.vim.command.Command | ||||
| import com.maddyhome.idea.vim.command.CommandFlags | ||||
| import com.maddyhome.idea.vim.command.OperatorArguments | ||||
| import com.maddyhome.idea.vim.group.MotionGroup | ||||
| import com.maddyhome.idea.vim.handler.VimActionHandler | ||||
| import com.maddyhome.idea.vim.helper.enumSetOf | ||||
| import com.maddyhome.idea.vim.helper.getTopLevelEditor | ||||
| import java.util.* | ||||
|  | ||||
| class InsertEnterAction : VimActionHandler.SingleExecution() { | ||||
|   override val type: Command.Type = Command.Type.INSERT | ||||
|  | ||||
|   override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_SAVE_STROKE) | ||||
|  | ||||
|   override fun execute(editor: Editor, context: DataContext, cmd: Command, operatorArguments: OperatorArguments): Boolean { | ||||
|     VimPlugin.getChange().processEnter(editor.getTopLevelEditor(), context) | ||||
|     MotionGroup.scrollCaretIntoView(editor) | ||||
|     return true | ||||
|   } | ||||
| } | ||||
| @@ -1,46 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
| package com.maddyhome.idea.vim.action.change.insert | ||||
|  | ||||
| import com.intellij.openapi.actionSystem.DataContext | ||||
| import com.intellij.openapi.editor.Editor | ||||
| 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.command.CommandFlags | ||||
| import com.maddyhome.idea.vim.command.OperatorArguments | ||||
| import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler | ||||
| import com.maddyhome.idea.vim.helper.enumSetOf | ||||
| import java.util.* | ||||
|  | ||||
| class InsertNewLineAboveAction : ChangeEditorActionHandler.SingleExecution() { | ||||
|   override val type: Command.Type = Command.Type.INSERT | ||||
|  | ||||
|   override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_MULTIKEY_UNDO) | ||||
|  | ||||
|   override fun execute( | ||||
|     editor: Editor, | ||||
|     context: DataContext, | ||||
|     argument: Argument?, | ||||
|     operatorArguments: OperatorArguments, | ||||
|   ): Boolean { | ||||
|     if (editor.isOneLineMode) return false | ||||
|     VimPlugin.getChange().insertNewLineAbove(editor, context) | ||||
|     return true | ||||
|   } | ||||
| } | ||||
| @@ -1,40 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
| package com.maddyhome.idea.vim.action.change.insert | ||||
|  | ||||
| import com.intellij.openapi.actionSystem.DataContext | ||||
| import com.intellij.openapi.editor.Editor | ||||
| 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.command.OperatorArguments | ||||
| import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler | ||||
|  | ||||
| class InsertPreviousInsertAction : ChangeEditorActionHandler.SingleExecution() { | ||||
|   override val type: Command.Type = Command.Type.INSERT | ||||
|  | ||||
|   override fun execute( | ||||
|     editor: Editor, | ||||
|     context: DataContext, | ||||
|     argument: Argument?, | ||||
|     operatorArguments: OperatorArguments, | ||||
|   ): Boolean { | ||||
|     VimPlugin.getChange().insertPreviousInsert(editor, context, false, operatorArguments) | ||||
|     return true | ||||
|   } | ||||
| } | ||||
| @@ -1,70 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
| package com.maddyhome.idea.vim.action.change.insert | ||||
|  | ||||
| import com.intellij.openapi.actionSystem.DataContext | ||||
| import com.intellij.openapi.application.ApplicationManager | ||||
| import com.intellij.openapi.components.ServiceManager | ||||
| import com.intellij.openapi.editor.Editor | ||||
| 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.command.OperatorArguments | ||||
| import com.maddyhome.idea.vim.ex.ExException | ||||
| import com.maddyhome.idea.vim.handler.VimActionHandler | ||||
| import com.maddyhome.idea.vim.helper.CommandLineHelper | ||||
| import com.maddyhome.idea.vim.vimscript.model.Script | ||||
| import com.maddyhome.idea.vim.vimscript.parser.VimscriptParser | ||||
|  | ||||
| class InsertRegisterAction : VimActionHandler.SingleExecution() { | ||||
|   override val type: Command.Type = Command.Type.INSERT | ||||
|  | ||||
|   override val argumentType: Argument.Type = Argument.Type.CHARACTER | ||||
|  | ||||
|   override fun execute(editor: Editor, context: DataContext, cmd: Command, operatorArguments: OperatorArguments): Boolean { | ||||
|     val argument = cmd.argument | ||||
|  | ||||
|     if (argument?.character == '=') { | ||||
|       ApplicationManager.getApplication().invokeLater { | ||||
|         try { | ||||
|           val expression = readExpression(editor) | ||||
|           if (expression != null) { | ||||
|             if (expression.isNotEmpty()) { | ||||
|               val expressionValue = VimscriptParser.parseExpression(expression)?.evaluate(editor, context, Script(listOf())) | ||||
|                 ?: throw ExException("E15: Invalid expression: $expression") | ||||
|               val textToStore = expressionValue.toInsertableString() | ||||
|               VimPlugin.getRegister().storeTextSpecial('=', textToStore) | ||||
|             } | ||||
|             VimPlugin.getChange().insertRegister(editor, context, argument.character) | ||||
|           } | ||||
|         } catch (e: ExException) { | ||||
|           VimPlugin.indicateError() | ||||
|           VimPlugin.showMessage(e.message) | ||||
|         } | ||||
|       } | ||||
|       return true | ||||
|     } else { | ||||
|       return argument != null && VimPlugin.getChange().insertRegister(editor, context, argument.character) | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   @SuppressWarnings("deprecation") // [VERSION UPDATE] 212+ getService | ||||
|   private fun readExpression(editor: Editor): String? { | ||||
|     return ServiceManager.getService(CommandLineHelper::class.java).inputString(editor, "=", null) | ||||
|   } | ||||
| } | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 The IdeaVim authors | ||||
|  * Copyright (C) 2003-2022 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 | ||||
| @@ -18,11 +18,11 @@ | ||||
|  | ||||
| package com.maddyhome.idea.vim.action.editor | ||||
|  | ||||
| import com.intellij.openapi.actionSystem.DataContext | ||||
| import com.intellij.openapi.actionSystem.IdeActions | ||||
| import com.intellij.openapi.editor.Editor | ||||
| import com.maddyhome.idea.vim.KeyHandler | ||||
| import com.maddyhome.idea.vim.action.ComplicatedKeysAction | ||||
| import com.maddyhome.idea.vim.api.ExecutionContext | ||||
| import com.maddyhome.idea.vim.api.VimEditor | ||||
| import com.maddyhome.idea.vim.api.injector | ||||
| import com.maddyhome.idea.vim.command.Command | ||||
| import com.maddyhome.idea.vim.command.CommandFlags | ||||
| import com.maddyhome.idea.vim.command.OperatorArguments | ||||
| @@ -79,8 +79,8 @@ class VimEditorUp : IdeActionHandler(IdeActions.ACTION_EDITOR_MOVE_CARET_UP), Co | ||||
| class VimQuickJavaDoc : VimActionHandler.SingleExecution() { | ||||
|   override val type: Command.Type = Command.Type.OTHER_READONLY | ||||
|  | ||||
|   override fun execute(editor: Editor, context: DataContext, cmd: Command, operatorArguments: OperatorArguments): Boolean { | ||||
|     KeyHandler.executeAction(IdeActions.ACTION_QUICK_JAVADOC, context) | ||||
|   override fun execute(editor: VimEditor, context: ExecutionContext, cmd: Command, operatorArguments: OperatorArguments): Boolean { | ||||
|     injector.actionExecutor.executeAction(IdeActions.ACTION_QUICK_JAVADOC, context) | ||||
|     return true | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 The IdeaVim authors | ||||
|  * Copyright (C) 2003-2022 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,10 +17,10 @@ | ||||
|  */ | ||||
| package com.maddyhome.idea.vim.action.ex | ||||
|  | ||||
| import com.intellij.openapi.actionSystem.DataContext | ||||
| import com.intellij.openapi.editor.Editor | ||||
| import com.maddyhome.idea.vim.VimPlugin | ||||
| import com.maddyhome.idea.vim.action.ComplicatedKeysAction | ||||
| import com.maddyhome.idea.vim.api.ExecutionContext | ||||
| import com.maddyhome.idea.vim.api.VimEditor | ||||
| import com.maddyhome.idea.vim.command.Command | ||||
| import com.maddyhome.idea.vim.command.CommandFlags | ||||
| import com.maddyhome.idea.vim.command.OperatorArguments | ||||
| @@ -41,7 +41,7 @@ class ProcessExEntryAction : VimActionHandler.SingleExecution(), ComplicatedKeys | ||||
|  | ||||
|   override val flags: EnumSet<CommandFlags> = EnumSet.of(CommandFlags.FLAG_COMPLETE_EX) | ||||
|  | ||||
|   override fun execute(editor: Editor, context: DataContext, cmd: Command, operatorArguments: OperatorArguments): Boolean { | ||||
|   override fun execute(editor: VimEditor, context: ExecutionContext, cmd: Command, operatorArguments: OperatorArguments): Boolean { | ||||
|     return VimPlugin.getProcess().processExEntry(editor, context) | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 The IdeaVim authors | ||||
|  * Copyright (C) 2003-2022 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 | ||||
| @@ -18,6 +18,7 @@ | ||||
| package com.maddyhome.idea.vim.action.internal | ||||
|  | ||||
| import com.intellij.ide.ui.AntialiasingType | ||||
| import com.intellij.ide.ui.UISettings | ||||
| import com.intellij.openapi.actionSystem.AnAction | ||||
| import com.intellij.openapi.actionSystem.AnActionEvent | ||||
| import com.intellij.openapi.actionSystem.CommonDataKeys | ||||
| @@ -124,7 +125,7 @@ class AddBlockInlaysAction : AnAction() { | ||||
|         val editorContext = FontInfo.getFontRenderContext(editor.contentComponent) | ||||
|         return FontRenderContext( | ||||
|           editorContext.transform, AntialiasingType.getKeyForCurrentScope(false), | ||||
|           if (editor is EditorImpl) editor.myFractionalMetricsHintValue else RenderingHints.VALUE_FRACTIONALMETRICS_OFF | ||||
|           if (editor is EditorImpl) UISettings.editorFractionalMetricsHint else RenderingHints.VALUE_FRACTIONALMETRICS_OFF | ||||
|         ) | ||||
|       } | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 The IdeaVim authors | ||||
|  * Copyright (C) 2003-2022 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,46 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
| package com.maddyhome.idea.vim.action.motion.gn | ||||
|  | ||||
| import com.intellij.openapi.actionSystem.DataContext | ||||
| import com.intellij.openapi.editor.Editor | ||||
| import com.maddyhome.idea.vim.VimPlugin | ||||
| import com.maddyhome.idea.vim.command.Argument | ||||
| import com.maddyhome.idea.vim.command.CommandFlags | ||||
| import com.maddyhome.idea.vim.command.MotionType | ||||
| import com.maddyhome.idea.vim.command.OperatorArguments | ||||
| import com.maddyhome.idea.vim.handler.Motion | ||||
| import com.maddyhome.idea.vim.handler.MotionActionHandler | ||||
| import com.maddyhome.idea.vim.handler.toMotionOrError | ||||
| import com.maddyhome.idea.vim.helper.noneOfEnum | ||||
| import java.util.* | ||||
|  | ||||
| class VisualSelectNextSearch : MotionActionHandler.SingleExecution() { | ||||
|   override val flags: EnumSet<CommandFlags> = noneOfEnum() | ||||
|  | ||||
|   override fun getOffset( | ||||
|     editor: Editor, | ||||
|     context: DataContext, | ||||
|     argument: Argument?, | ||||
|     operatorArguments: OperatorArguments, | ||||
|   ): Motion { | ||||
|     return VimPlugin.getMotion().selectNextSearch(editor, operatorArguments.count1, true).toMotionOrError() | ||||
|   } | ||||
|  | ||||
|   override val motionType: MotionType = MotionType.EXCLUSIVE | ||||
| } | ||||
| @@ -1,43 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
| package com.maddyhome.idea.vim.action.motion.leftright | ||||
|  | ||||
| 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.command.Argument | ||||
| import com.maddyhome.idea.vim.command.MotionType | ||||
| import com.maddyhome.idea.vim.command.OperatorArguments | ||||
| import com.maddyhome.idea.vim.handler.Motion | ||||
| import com.maddyhome.idea.vim.handler.MotionActionHandler | ||||
|  | ||||
| class MotionLastMatchCharAction : MotionActionHandler.ForEachCaret() { | ||||
|   override fun getOffset( | ||||
|     editor: Editor, | ||||
|     caret: Caret, | ||||
|     context: DataContext, | ||||
|     argument: Argument?, | ||||
|     operatorArguments: OperatorArguments, | ||||
|   ): Motion { | ||||
|     val repeatLastMatchChar = VimPlugin.getMotion().repeatLastMatchChar(editor, caret, operatorArguments.count1) | ||||
|     return if (repeatLastMatchChar < 0) Motion.Error else Motion.AbsoluteOffset(repeatLastMatchChar) | ||||
|   } | ||||
|  | ||||
|   override val motionType: MotionType = MotionType.EXCLUSIVE | ||||
| } | ||||
| @@ -1,43 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
| package com.maddyhome.idea.vim.action.motion.leftright | ||||
|  | ||||
| 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.command.Argument | ||||
| import com.maddyhome.idea.vim.command.MotionType | ||||
| import com.maddyhome.idea.vim.command.OperatorArguments | ||||
| import com.maddyhome.idea.vim.handler.Motion | ||||
| import com.maddyhome.idea.vim.handler.MotionActionHandler | ||||
| import com.maddyhome.idea.vim.handler.toMotionOrError | ||||
|  | ||||
| class MotionRightWrapAction : MotionActionHandler.ForEachCaret() { | ||||
|   override fun getOffset( | ||||
|     editor: Editor, | ||||
|     caret: Caret, | ||||
|     context: DataContext, | ||||
|     argument: Argument?, | ||||
|     operatorArguments: OperatorArguments, | ||||
|   ): Motion { | ||||
|     return VimPlugin.getMotion().moveCaretHorizontalWrap(editor, caret, operatorArguments.count1).toMotionOrError() | ||||
|   } | ||||
|  | ||||
|   override val motionType: MotionType = MotionType.EXCLUSIVE | ||||
| } | ||||
| @@ -1,44 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
|  | ||||
| package com.maddyhome.idea.vim.action.motion.`object` | ||||
|  | ||||
| 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.command.Argument | ||||
| import com.maddyhome.idea.vim.command.TextObjectVisualType | ||||
| import com.maddyhome.idea.vim.common.TextRange | ||||
| import com.maddyhome.idea.vim.handler.TextObjectActionHandler | ||||
|  | ||||
| class MotionInnerBigWordAction : TextObjectActionHandler() { | ||||
|  | ||||
|   override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE | ||||
|  | ||||
|   override fun getRange( | ||||
|     editor: Editor, | ||||
|     caret: Caret, | ||||
|     context: DataContext, | ||||
|     count: Int, | ||||
|     rawCount: Int, | ||||
|     argument: Argument?, | ||||
|   ): TextRange { | ||||
|     return VimPlugin.getMotion().getWordRange(editor, caret, count, false, true) | ||||
|   } | ||||
| } | ||||
| @@ -1,49 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
|  | ||||
| package com.maddyhome.idea.vim.action.motion.`object` | ||||
|  | ||||
| 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.command.Argument | ||||
| import com.maddyhome.idea.vim.command.CommandFlags | ||||
| import com.maddyhome.idea.vim.command.TextObjectVisualType | ||||
| import com.maddyhome.idea.vim.common.TextRange | ||||
| import com.maddyhome.idea.vim.handler.TextObjectActionHandler | ||||
| import com.maddyhome.idea.vim.helper.enumSetOf | ||||
| import java.util.* | ||||
|  | ||||
| class MotionInnerBlockAngleAction : TextObjectActionHandler() { | ||||
|  | ||||
|   override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_TEXT_BLOCK) | ||||
|  | ||||
|   override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE | ||||
|  | ||||
|   override fun getRange( | ||||
|     editor: Editor, | ||||
|     caret: Caret, | ||||
|     context: DataContext, | ||||
|     count: Int, | ||||
|     rawCount: Int, | ||||
|     argument: Argument?, | ||||
|   ): TextRange? { | ||||
|     return VimPlugin.getMotion().getBlockRange(editor, caret, count, false, '<') | ||||
|   } | ||||
| } | ||||
| @@ -1,49 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
|  | ||||
| package com.maddyhome.idea.vim.action.motion.`object` | ||||
|  | ||||
| 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.command.Argument | ||||
| import com.maddyhome.idea.vim.command.CommandFlags | ||||
| import com.maddyhome.idea.vim.command.TextObjectVisualType | ||||
| import com.maddyhome.idea.vim.common.TextRange | ||||
| import com.maddyhome.idea.vim.handler.TextObjectActionHandler | ||||
| import com.maddyhome.idea.vim.helper.enumSetOf | ||||
| import java.util.* | ||||
|  | ||||
| class MotionInnerBlockBackQuoteAction : TextObjectActionHandler() { | ||||
|  | ||||
|   override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_TEXT_BLOCK) | ||||
|  | ||||
|   override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE | ||||
|  | ||||
|   override fun getRange( | ||||
|     editor: Editor, | ||||
|     caret: Caret, | ||||
|     context: DataContext, | ||||
|     count: Int, | ||||
|     rawCount: Int, | ||||
|     argument: Argument?, | ||||
|   ): TextRange? { | ||||
|     return VimPlugin.getMotion().getBlockQuoteRange(editor, caret, '`', false) | ||||
|   } | ||||
| } | ||||
| @@ -1,49 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
|  | ||||
| package com.maddyhome.idea.vim.action.motion.`object` | ||||
|  | ||||
| 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.command.Argument | ||||
| import com.maddyhome.idea.vim.command.CommandFlags | ||||
| import com.maddyhome.idea.vim.command.TextObjectVisualType | ||||
| import com.maddyhome.idea.vim.common.TextRange | ||||
| import com.maddyhome.idea.vim.handler.TextObjectActionHandler | ||||
| import com.maddyhome.idea.vim.helper.enumSetOf | ||||
| import java.util.* | ||||
|  | ||||
| class MotionInnerBlockBraceAction : TextObjectActionHandler() { | ||||
|  | ||||
|   override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_TEXT_BLOCK) | ||||
|  | ||||
|   override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE | ||||
|  | ||||
|   override fun getRange( | ||||
|     editor: Editor, | ||||
|     caret: Caret, | ||||
|     context: DataContext, | ||||
|     count: Int, | ||||
|     rawCount: Int, | ||||
|     argument: Argument?, | ||||
|   ): TextRange? { | ||||
|     return VimPlugin.getMotion().getBlockRange(editor, caret, count, false, '{') | ||||
|   } | ||||
| } | ||||
| @@ -1,49 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
|  | ||||
| package com.maddyhome.idea.vim.action.motion.`object` | ||||
|  | ||||
| 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.command.Argument | ||||
| import com.maddyhome.idea.vim.command.CommandFlags | ||||
| import com.maddyhome.idea.vim.command.TextObjectVisualType | ||||
| import com.maddyhome.idea.vim.common.TextRange | ||||
| import com.maddyhome.idea.vim.handler.TextObjectActionHandler | ||||
| import com.maddyhome.idea.vim.helper.enumSetOf | ||||
| import java.util.* | ||||
|  | ||||
| class MotionInnerBlockBracketAction : TextObjectActionHandler() { | ||||
|  | ||||
|   override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_TEXT_BLOCK) | ||||
|  | ||||
|   override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE | ||||
|  | ||||
|   override fun getRange( | ||||
|     editor: Editor, | ||||
|     caret: Caret, | ||||
|     context: DataContext, | ||||
|     count: Int, | ||||
|     rawCount: Int, | ||||
|     argument: Argument?, | ||||
|   ): TextRange? { | ||||
|     return VimPlugin.getMotion().getBlockRange(editor, caret, count, false, '[') | ||||
|   } | ||||
| } | ||||
| @@ -1,49 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
|  | ||||
| package com.maddyhome.idea.vim.action.motion.`object` | ||||
|  | ||||
| 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.command.Argument | ||||
| import com.maddyhome.idea.vim.command.CommandFlags | ||||
| import com.maddyhome.idea.vim.command.TextObjectVisualType | ||||
| import com.maddyhome.idea.vim.common.TextRange | ||||
| import com.maddyhome.idea.vim.handler.TextObjectActionHandler | ||||
| import com.maddyhome.idea.vim.helper.enumSetOf | ||||
| import java.util.* | ||||
|  | ||||
| class MotionInnerBlockDoubleQuoteAction : TextObjectActionHandler() { | ||||
|  | ||||
|   override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_TEXT_BLOCK) | ||||
|  | ||||
|   override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE | ||||
|  | ||||
|   override fun getRange( | ||||
|     editor: Editor, | ||||
|     caret: Caret, | ||||
|     context: DataContext, | ||||
|     count: Int, | ||||
|     rawCount: Int, | ||||
|     argument: Argument?, | ||||
|   ): TextRange? { | ||||
|     return VimPlugin.getMotion().getBlockQuoteRange(editor, caret, '"', false) | ||||
|   } | ||||
| } | ||||
| @@ -1,49 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
|  | ||||
| package com.maddyhome.idea.vim.action.motion.`object` | ||||
|  | ||||
| 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.command.Argument | ||||
| import com.maddyhome.idea.vim.command.CommandFlags | ||||
| import com.maddyhome.idea.vim.command.TextObjectVisualType | ||||
| import com.maddyhome.idea.vim.common.TextRange | ||||
| import com.maddyhome.idea.vim.handler.TextObjectActionHandler | ||||
| import com.maddyhome.idea.vim.helper.enumSetOf | ||||
| import java.util.* | ||||
|  | ||||
| class MotionInnerBlockParenAction : TextObjectActionHandler() { | ||||
|  | ||||
|   override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_TEXT_BLOCK) | ||||
|  | ||||
|   override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE | ||||
|  | ||||
|   override fun getRange( | ||||
|     editor: Editor, | ||||
|     caret: Caret, | ||||
|     context: DataContext, | ||||
|     count: Int, | ||||
|     rawCount: Int, | ||||
|     argument: Argument?, | ||||
|   ): TextRange? { | ||||
|     return VimPlugin.getMotion().getBlockRange(editor, caret, count, false, '(') | ||||
|   } | ||||
| } | ||||
| @@ -1,49 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
|  | ||||
| package com.maddyhome.idea.vim.action.motion.`object` | ||||
|  | ||||
| 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.command.Argument | ||||
| import com.maddyhome.idea.vim.command.CommandFlags | ||||
| import com.maddyhome.idea.vim.command.TextObjectVisualType | ||||
| import com.maddyhome.idea.vim.common.TextRange | ||||
| import com.maddyhome.idea.vim.handler.TextObjectActionHandler | ||||
| import com.maddyhome.idea.vim.helper.enumSetOf | ||||
| import java.util.* | ||||
|  | ||||
| class MotionInnerBlockSingleQuoteAction : TextObjectActionHandler() { | ||||
|  | ||||
|   override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_TEXT_BLOCK) | ||||
|  | ||||
|   override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE | ||||
|  | ||||
|   override fun getRange( | ||||
|     editor: Editor, | ||||
|     caret: Caret, | ||||
|     context: DataContext, | ||||
|     count: Int, | ||||
|     rawCount: Int, | ||||
|     argument: Argument?, | ||||
|   ): TextRange? { | ||||
|     return VimPlugin.getMotion().getBlockQuoteRange(editor, caret, '\'', false) | ||||
|   } | ||||
| } | ||||
| @@ -1,44 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
|  | ||||
| package com.maddyhome.idea.vim.action.motion.`object` | ||||
|  | ||||
| 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.command.Argument | ||||
| import com.maddyhome.idea.vim.command.TextObjectVisualType | ||||
| import com.maddyhome.idea.vim.common.TextRange | ||||
| import com.maddyhome.idea.vim.handler.TextObjectActionHandler | ||||
|  | ||||
| class MotionInnerWordAction : TextObjectActionHandler() { | ||||
|  | ||||
|   override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE | ||||
|  | ||||
|   override fun getRange( | ||||
|     editor: Editor, | ||||
|     caret: Caret, | ||||
|     context: DataContext, | ||||
|     count: Int, | ||||
|     rawCount: Int, | ||||
|     argument: Argument?, | ||||
|   ): TextRange { | ||||
|     return VimPlugin.getMotion().getWordRange(editor, caret, count, false, false) | ||||
|   } | ||||
| } | ||||
| @@ -1,44 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
|  | ||||
| package com.maddyhome.idea.vim.action.motion.`object` | ||||
|  | ||||
| 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.command.Argument | ||||
| import com.maddyhome.idea.vim.command.TextObjectVisualType | ||||
| import com.maddyhome.idea.vim.common.TextRange | ||||
| import com.maddyhome.idea.vim.handler.TextObjectActionHandler | ||||
|  | ||||
| class MotionOuterBigWordAction : TextObjectActionHandler() { | ||||
|  | ||||
|   override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE | ||||
|  | ||||
|   override fun getRange( | ||||
|     editor: Editor, | ||||
|     caret: Caret, | ||||
|     context: DataContext, | ||||
|     count: Int, | ||||
|     rawCount: Int, | ||||
|     argument: Argument?, | ||||
|   ): TextRange { | ||||
|     return VimPlugin.getMotion().getWordRange(editor, caret, count, true, true) | ||||
|   } | ||||
| } | ||||
| @@ -1,49 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
|  | ||||
| package com.maddyhome.idea.vim.action.motion.`object` | ||||
|  | ||||
| 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.command.Argument | ||||
| import com.maddyhome.idea.vim.command.CommandFlags | ||||
| import com.maddyhome.idea.vim.command.TextObjectVisualType | ||||
| import com.maddyhome.idea.vim.common.TextRange | ||||
| import com.maddyhome.idea.vim.handler.TextObjectActionHandler | ||||
| import com.maddyhome.idea.vim.helper.enumSetOf | ||||
| import java.util.* | ||||
|  | ||||
| class MotionOuterBlockAngleAction : TextObjectActionHandler() { | ||||
|  | ||||
|   override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_TEXT_BLOCK) | ||||
|  | ||||
|   override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE | ||||
|  | ||||
|   override fun getRange( | ||||
|     editor: Editor, | ||||
|     caret: Caret, | ||||
|     context: DataContext, | ||||
|     count: Int, | ||||
|     rawCount: Int, | ||||
|     argument: Argument?, | ||||
|   ): TextRange? { | ||||
|     return VimPlugin.getMotion().getBlockRange(editor, caret, count, true, '<') | ||||
|   } | ||||
| } | ||||
| @@ -1,49 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
|  | ||||
| package com.maddyhome.idea.vim.action.motion.`object` | ||||
|  | ||||
| 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.command.Argument | ||||
| import com.maddyhome.idea.vim.command.CommandFlags | ||||
| import com.maddyhome.idea.vim.command.TextObjectVisualType | ||||
| import com.maddyhome.idea.vim.common.TextRange | ||||
| import com.maddyhome.idea.vim.handler.TextObjectActionHandler | ||||
| import com.maddyhome.idea.vim.helper.enumSetOf | ||||
| import java.util.* | ||||
|  | ||||
| class MotionOuterBlockBackQuoteAction : TextObjectActionHandler() { | ||||
|  | ||||
|   override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_TEXT_BLOCK) | ||||
|  | ||||
|   override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE | ||||
|  | ||||
|   override fun getRange( | ||||
|     editor: Editor, | ||||
|     caret: Caret, | ||||
|     context: DataContext, | ||||
|     count: Int, | ||||
|     rawCount: Int, | ||||
|     argument: Argument?, | ||||
|   ): TextRange? { | ||||
|     return VimPlugin.getMotion().getBlockQuoteRange(editor, caret, '`', true) | ||||
|   } | ||||
| } | ||||
| @@ -1,49 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
|  | ||||
| package com.maddyhome.idea.vim.action.motion.`object` | ||||
|  | ||||
| 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.command.Argument | ||||
| import com.maddyhome.idea.vim.command.CommandFlags | ||||
| import com.maddyhome.idea.vim.command.TextObjectVisualType | ||||
| import com.maddyhome.idea.vim.common.TextRange | ||||
| import com.maddyhome.idea.vim.handler.TextObjectActionHandler | ||||
| import com.maddyhome.idea.vim.helper.enumSetOf | ||||
| import java.util.* | ||||
|  | ||||
| class MotionOuterBlockBraceAction : TextObjectActionHandler() { | ||||
|  | ||||
|   override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_TEXT_BLOCK) | ||||
|  | ||||
|   override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE | ||||
|  | ||||
|   override fun getRange( | ||||
|     editor: Editor, | ||||
|     caret: Caret, | ||||
|     context: DataContext, | ||||
|     count: Int, | ||||
|     rawCount: Int, | ||||
|     argument: Argument?, | ||||
|   ): TextRange? { | ||||
|     return VimPlugin.getMotion().getBlockRange(editor, caret, count, true, '{') | ||||
|   } | ||||
| } | ||||
| @@ -1,49 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
|  | ||||
| package com.maddyhome.idea.vim.action.motion.`object` | ||||
|  | ||||
| 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.command.Argument | ||||
| import com.maddyhome.idea.vim.command.CommandFlags | ||||
| import com.maddyhome.idea.vim.command.TextObjectVisualType | ||||
| import com.maddyhome.idea.vim.common.TextRange | ||||
| import com.maddyhome.idea.vim.handler.TextObjectActionHandler | ||||
| import com.maddyhome.idea.vim.helper.enumSetOf | ||||
| import java.util.* | ||||
|  | ||||
| class MotionOuterBlockBracketAction : TextObjectActionHandler() { | ||||
|  | ||||
|   override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_TEXT_BLOCK) | ||||
|  | ||||
|   override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE | ||||
|  | ||||
|   override fun getRange( | ||||
|     editor: Editor, | ||||
|     caret: Caret, | ||||
|     context: DataContext, | ||||
|     count: Int, | ||||
|     rawCount: Int, | ||||
|     argument: Argument?, | ||||
|   ): TextRange? { | ||||
|     return VimPlugin.getMotion().getBlockRange(editor, caret, count, true, '[') | ||||
|   } | ||||
| } | ||||
| @@ -1,49 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
|  | ||||
| package com.maddyhome.idea.vim.action.motion.`object` | ||||
|  | ||||
| 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.command.Argument | ||||
| import com.maddyhome.idea.vim.command.CommandFlags | ||||
| import com.maddyhome.idea.vim.command.TextObjectVisualType | ||||
| import com.maddyhome.idea.vim.common.TextRange | ||||
| import com.maddyhome.idea.vim.handler.TextObjectActionHandler | ||||
| import com.maddyhome.idea.vim.helper.enumSetOf | ||||
| import java.util.* | ||||
|  | ||||
| class MotionOuterBlockDoubleQuoteAction : TextObjectActionHandler() { | ||||
|  | ||||
|   override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_TEXT_BLOCK) | ||||
|  | ||||
|   override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE | ||||
|  | ||||
|   override fun getRange( | ||||
|     editor: Editor, | ||||
|     caret: Caret, | ||||
|     context: DataContext, | ||||
|     count: Int, | ||||
|     rawCount: Int, | ||||
|     argument: Argument?, | ||||
|   ): TextRange? { | ||||
|     return VimPlugin.getMotion().getBlockQuoteRange(editor, caret, '"', true) | ||||
|   } | ||||
| } | ||||
| @@ -1,49 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
|  | ||||
| package com.maddyhome.idea.vim.action.motion.`object` | ||||
|  | ||||
| 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.command.Argument | ||||
| import com.maddyhome.idea.vim.command.CommandFlags | ||||
| import com.maddyhome.idea.vim.command.TextObjectVisualType | ||||
| import com.maddyhome.idea.vim.common.TextRange | ||||
| import com.maddyhome.idea.vim.handler.TextObjectActionHandler | ||||
| import com.maddyhome.idea.vim.helper.enumSetOf | ||||
| import java.util.* | ||||
|  | ||||
| class MotionOuterBlockParenAction : TextObjectActionHandler() { | ||||
|  | ||||
|   override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_TEXT_BLOCK) | ||||
|  | ||||
|   override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE | ||||
|  | ||||
|   override fun getRange( | ||||
|     editor: Editor, | ||||
|     caret: Caret, | ||||
|     context: DataContext, | ||||
|     count: Int, | ||||
|     rawCount: Int, | ||||
|     argument: Argument?, | ||||
|   ): TextRange? { | ||||
|     return VimPlugin.getMotion().getBlockRange(editor, caret, count, true, '(') | ||||
|   } | ||||
| } | ||||
| @@ -1,49 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
|  | ||||
| package com.maddyhome.idea.vim.action.motion.`object` | ||||
|  | ||||
| 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.command.Argument | ||||
| import com.maddyhome.idea.vim.command.CommandFlags | ||||
| import com.maddyhome.idea.vim.command.TextObjectVisualType | ||||
| import com.maddyhome.idea.vim.common.TextRange | ||||
| import com.maddyhome.idea.vim.handler.TextObjectActionHandler | ||||
| import com.maddyhome.idea.vim.helper.enumSetOf | ||||
| import java.util.* | ||||
|  | ||||
| class MotionOuterBlockSingleQuoteAction : TextObjectActionHandler() { | ||||
|  | ||||
|   override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_TEXT_BLOCK) | ||||
|  | ||||
|   override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE | ||||
|  | ||||
|   override fun getRange( | ||||
|     editor: Editor, | ||||
|     caret: Caret, | ||||
|     context: DataContext, | ||||
|     count: Int, | ||||
|     rawCount: Int, | ||||
|     argument: Argument?, | ||||
|   ): TextRange? { | ||||
|     return VimPlugin.getMotion().getBlockQuoteRange(editor, caret, '\'', true) | ||||
|   } | ||||
| } | ||||
| @@ -1,49 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
|  | ||||
| package com.maddyhome.idea.vim.action.motion.`object` | ||||
|  | ||||
| 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.command.Argument | ||||
| import com.maddyhome.idea.vim.command.CommandFlags | ||||
| import com.maddyhome.idea.vim.command.TextObjectVisualType | ||||
| import com.maddyhome.idea.vim.common.TextRange | ||||
| import com.maddyhome.idea.vim.handler.TextObjectActionHandler | ||||
| import com.maddyhome.idea.vim.helper.enumSetOf | ||||
| import java.util.* | ||||
|  | ||||
| class MotionOuterBlockTagAction : TextObjectActionHandler() { | ||||
|  | ||||
|   override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_TEXT_BLOCK) | ||||
|  | ||||
|   override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE | ||||
|  | ||||
|   override fun getRange( | ||||
|     editor: Editor, | ||||
|     caret: Caret, | ||||
|     context: DataContext, | ||||
|     count: Int, | ||||
|     rawCount: Int, | ||||
|     argument: Argument?, | ||||
|   ): TextRange? { | ||||
|     return VimPlugin.getMotion().getBlockTagRange(editor, caret, count, true) | ||||
|   } | ||||
| } | ||||
| @@ -1,49 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
|  | ||||
| package com.maddyhome.idea.vim.action.motion.`object` | ||||
|  | ||||
| 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.command.Argument | ||||
| import com.maddyhome.idea.vim.command.CommandFlags | ||||
| import com.maddyhome.idea.vim.command.TextObjectVisualType | ||||
| import com.maddyhome.idea.vim.common.TextRange | ||||
| import com.maddyhome.idea.vim.handler.TextObjectActionHandler | ||||
| import com.maddyhome.idea.vim.helper.enumSetOf | ||||
| import java.util.* | ||||
|  | ||||
| class MotionOuterParagraphAction : TextObjectActionHandler() { | ||||
|  | ||||
|   override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_TEXT_BLOCK) | ||||
|  | ||||
|   override val visualType: TextObjectVisualType = TextObjectVisualType.LINE_WISE | ||||
|  | ||||
|   override fun getRange( | ||||
|     editor: Editor, | ||||
|     caret: Caret, | ||||
|     context: DataContext, | ||||
|     count: Int, | ||||
|     rawCount: Int, | ||||
|     argument: Argument?, | ||||
|   ): TextRange? { | ||||
|     return VimPlugin.getMotion().getParagraphRange(editor, caret, count, true) | ||||
|   } | ||||
| } | ||||
| @@ -1,49 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
|  | ||||
| package com.maddyhome.idea.vim.action.motion.`object` | ||||
|  | ||||
| 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.command.Argument | ||||
| import com.maddyhome.idea.vim.command.CommandFlags | ||||
| import com.maddyhome.idea.vim.command.TextObjectVisualType | ||||
| import com.maddyhome.idea.vim.common.TextRange | ||||
| import com.maddyhome.idea.vim.handler.TextObjectActionHandler | ||||
| import com.maddyhome.idea.vim.helper.enumSetOf | ||||
| import java.util.* | ||||
|  | ||||
| class MotionOuterSentenceAction : TextObjectActionHandler() { | ||||
|  | ||||
|   override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_TEXT_BLOCK) | ||||
|  | ||||
|   override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE | ||||
|  | ||||
|   override fun getRange( | ||||
|     editor: Editor, | ||||
|     caret: Caret, | ||||
|     context: DataContext, | ||||
|     count: Int, | ||||
|     rawCount: Int, | ||||
|     argument: Argument?, | ||||
|   ): TextRange { | ||||
|     return VimPlugin.getMotion().getSentenceRange(editor, caret, count, true) | ||||
|   } | ||||
| } | ||||
| @@ -1,44 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
|  | ||||
| package com.maddyhome.idea.vim.action.motion.`object` | ||||
|  | ||||
| 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.command.Argument | ||||
| import com.maddyhome.idea.vim.command.TextObjectVisualType | ||||
| import com.maddyhome.idea.vim.common.TextRange | ||||
| import com.maddyhome.idea.vim.handler.TextObjectActionHandler | ||||
|  | ||||
| class MotionOuterWordAction : TextObjectActionHandler() { | ||||
|  | ||||
|   override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE | ||||
|  | ||||
|   override fun getRange( | ||||
|     editor: Editor, | ||||
|     caret: Caret, | ||||
|     context: DataContext, | ||||
|     count: Int, | ||||
|     rawCount: Int, | ||||
|     argument: Argument?, | ||||
|   ): TextRange { | ||||
|     return VimPlugin.getMotion().getWordRange(editor, caret, count, true, false) | ||||
|   } | ||||
| } | ||||
| @@ -1,38 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
| package com.maddyhome.idea.vim.action.motion.scroll | ||||
|  | ||||
| import com.intellij.openapi.actionSystem.DataContext | ||||
| import com.intellij.openapi.editor.Editor | ||||
| import com.maddyhome.idea.vim.VimPlugin | ||||
| import com.maddyhome.idea.vim.command.Command | ||||
| import com.maddyhome.idea.vim.command.CommandFlags | ||||
| import com.maddyhome.idea.vim.command.OperatorArguments | ||||
| import com.maddyhome.idea.vim.handler.VimActionHandler | ||||
| import com.maddyhome.idea.vim.helper.enumSetOf | ||||
| import java.util.* | ||||
|  | ||||
| class MotionScrollLineUpAction : VimActionHandler.SingleExecution() { | ||||
|   override val type: Command.Type = Command.Type.OTHER_READONLY | ||||
|  | ||||
|   override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_IGNORE_SCROLL_JUMP) | ||||
|  | ||||
|   override fun execute(editor: Editor, context: DataContext, cmd: Command, operatorArguments: OperatorArguments): Boolean { | ||||
|     return VimPlugin.getMotion().scrollLine(editor, -cmd.count) | ||||
|   } | ||||
| } | ||||
| @@ -1,38 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
| package com.maddyhome.idea.vim.action.motion.scroll | ||||
|  | ||||
| import com.intellij.openapi.actionSystem.DataContext | ||||
| import com.intellij.openapi.editor.Editor | ||||
| import com.maddyhome.idea.vim.VimPlugin | ||||
| import com.maddyhome.idea.vim.command.Command | ||||
| import com.maddyhome.idea.vim.command.CommandFlags | ||||
| import com.maddyhome.idea.vim.command.OperatorArguments | ||||
| import com.maddyhome.idea.vim.handler.VimActionHandler | ||||
| import com.maddyhome.idea.vim.helper.enumSetOf | ||||
| import java.util.* | ||||
|  | ||||
| class MotionScrollMiddleScreenLineAction : VimActionHandler.SingleExecution() { | ||||
|   override val type: Command.Type = Command.Type.OTHER_READONLY | ||||
|  | ||||
|   override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_IGNORE_SCROLL_JUMP) | ||||
|  | ||||
|   override fun execute(editor: Editor, context: DataContext, cmd: Command, operatorArguments: OperatorArguments): Boolean { | ||||
|     return VimPlugin.getMotion().scrollLineToMiddleScreenLine(editor, cmd.rawCount, false) | ||||
|   } | ||||
| } | ||||
| @@ -1,42 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
| package com.maddyhome.idea.vim.action.motion.text | ||||
|  | ||||
| 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.command.Argument | ||||
| import com.maddyhome.idea.vim.command.MotionType | ||||
| import com.maddyhome.idea.vim.command.OperatorArguments | ||||
| import com.maddyhome.idea.vim.handler.Motion | ||||
| import com.maddyhome.idea.vim.handler.MotionActionHandler | ||||
|  | ||||
| class MotionBigWordEndLeftAction : MotionActionHandler.ForEachCaret() { | ||||
|   override fun getOffset( | ||||
|     editor: Editor, | ||||
|     caret: Caret, | ||||
|     context: DataContext, | ||||
|     argument: Argument?, | ||||
|     operatorArguments: OperatorArguments, | ||||
|   ): Motion { | ||||
|     return VimPlugin.getMotion().moveCaretToNextWordEnd(editor, caret, -operatorArguments.count1, true) | ||||
|   } | ||||
|  | ||||
|   override val motionType: MotionType = MotionType.EXCLUSIVE | ||||
| } | ||||
| @@ -1,42 +0,0 @@ | ||||
| /* | ||||
|  * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform | ||||
|  * Copyright (C) 2003-2021 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 <https://www.gnu.org/licenses/>. | ||||
|  */ | ||||
| package com.maddyhome.idea.vim.action.motion.text | ||||
|  | ||||
| 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.command.Argument | ||||
| import com.maddyhome.idea.vim.command.MotionType | ||||
| import com.maddyhome.idea.vim.command.OperatorArguments | ||||
| import com.maddyhome.idea.vim.handler.Motion | ||||
| import com.maddyhome.idea.vim.handler.MotionActionHandler | ||||
|  | ||||
| class MotionBigWordEndRightAction : MotionActionHandler.ForEachCaret() { | ||||
|   override fun getOffset( | ||||
|     editor: Editor, | ||||
|     caret: Caret, | ||||
|     context: DataContext, | ||||
|     argument: Argument?, | ||||
|     operatorArguments: OperatorArguments, | ||||
|   ): Motion { | ||||
|     return VimPlugin.getMotion().moveCaretToNextWordEnd(editor, caret, operatorArguments.count1, true) | ||||
|   } | ||||
|  | ||||
|   override val motionType: MotionType = MotionType.INCLUSIVE | ||||
| } | ||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user