mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2025-08-18 10:31:44 +02:00
Compare commits
77 Commits
0.53
...
0.53.1-EAP
Author | SHA1 | Date | |
---|---|---|---|
![]() |
d041712bd8 | ||
![]() |
ef0f2024c2 | ||
![]() |
bef3b3ba62 | ||
![]() |
037aee7c59 | ||
![]() |
0e3c13099b | ||
![]() |
8e3515bc34 | ||
![]() |
c736de7875 | ||
![]() |
42375d143e | ||
![]() |
7e6d7aed20 | ||
![]() |
ea68d0c28f | ||
![]() |
9cc82aedf2 | ||
![]() |
c52abce656 | ||
![]() |
65d8368ad4 | ||
![]() |
cf2f223ad4 | ||
![]() |
daae1aec6c | ||
![]() |
59bcd24c47 | ||
![]() |
44e224489b | ||
![]() |
8134e0223f | ||
![]() |
482249a05b | ||
![]() |
d0998dc093 | ||
![]() |
848bb01c10 | ||
![]() |
e39eb76aca | ||
![]() |
d6d2a55747 | ||
![]() |
355fa1a622 | ||
![]() |
fb007b8835 | ||
![]() |
256f5fcd0e | ||
![]() |
e698c950a3 | ||
![]() |
d0b9c3c118 | ||
![]() |
24358ca1a9 | ||
![]() |
6a21c94a0c | ||
![]() |
2d39a1e4b8 | ||
![]() |
e97a8da721 | ||
![]() |
665aaa3af9 | ||
![]() |
17fe1da4ed | ||
![]() |
cb6c94b4f9 | ||
![]() |
6fd6765bee | ||
![]() |
66b7019da9 | ||
![]() |
2c11624e32 | ||
![]() |
e44d7e6d49 | ||
![]() |
261911f6de | ||
![]() |
fe714a9003 | ||
![]() |
e8501a658b | ||
![]() |
3fb4830456 | ||
![]() |
39982b507a | ||
![]() |
4bd4f3ac68 | ||
![]() |
8533ef7739 | ||
![]() |
bd6d61c8c7 | ||
![]() |
7045ffbdb8 | ||
![]() |
9e47f4a7c3 | ||
![]() |
c886e49682 | ||
![]() |
8fdec8e816 | ||
![]() |
131387d0ff | ||
![]() |
f4a2b83afc | ||
![]() |
1c02ad6b4c | ||
![]() |
d93890ddcb | ||
![]() |
ca530159bb | ||
![]() |
b76b747235 | ||
![]() |
67896b7d3a | ||
![]() |
3b598a6f45 | ||
![]() |
62466123ff | ||
![]() |
14163a0791 | ||
![]() |
52a8a175a6 | ||
![]() |
0a83b0826a | ||
![]() |
d854cd7024 | ||
![]() |
7ac8d7a43a | ||
![]() |
b012618968 | ||
![]() |
fba59ff347 | ||
![]() |
27d2742386 | ||
![]() |
5ef25cfa6f | ||
![]() |
17e3dfe2bb | ||
![]() |
a334ff33cd | ||
![]() |
b0c1ecfdc5 | ||
![]() |
b4d5dcbf57 | ||
![]() |
3161ba8983 | ||
![]() |
92125b49f0 | ||
![]() |
a6e0fbd5e6 | ||
![]() |
c07d0353f0 |
324
AUTHORS.md
324
AUTHORS.md
@@ -3,77 +3,273 @@ IdeaVim Authors
|
|||||||
|
|
||||||
The original author:
|
The original author:
|
||||||
|
|
||||||
* [Rick Maddy](mailto:rmaddy@maddyhome.com)
|
* [![icon][mail]](mailto:rmaddy@maddyhome.com)
|
||||||
|
[![icon][github-off]](#)
|
||||||
|
|
||||||
|
Rick Maddy
|
||||||
|
|
||||||
The current maintainers:
|
The current maintainers:
|
||||||
|
|
||||||
* [Andrey Vlasovskikh](mailto:andrey.vlasovskikh@gmail.com)
|
* [![icon][mail]](mailto:andrey.vlasovskikh@gmail.com)
|
||||||
* [Alex Plate](mailto:alexpl292@gmail.com)
|
[![icon][github]](https://github.com/vlasovskikh)
|
||||||
|
|
||||||
|
Andrey Vlasovskikh
|
||||||
|
* [![icon][mail]](mailto:alexpl292@gmail.com)
|
||||||
|
[![icon][github]](https://github.com/AlexPl292)
|
||||||
|
|
||||||
|
Alex Plate
|
||||||
|
|
||||||
Previous maintainers:
|
Previous maintainers:
|
||||||
|
|
||||||
* [Oleg Shpynov](mailto:oleg.shpynov@jetbrains.com)
|
* [![icon][mail]](mailto:oleg.shpynov@jetbrains.com)
|
||||||
|
[![icon][github]](https://github.com/olegs)
|
||||||
|
|
||||||
|
Oleg Shpynov
|
||||||
|
|
||||||
Contributors:
|
Contributors:
|
||||||
|
* [![icon][mail]](mailto:yole@jetbrains.com)
|
||||||
* [Dmitry Jemerov](mailto:yole@jetbrains.com)
|
[![icon][github]](https://github.com/yole)
|
||||||
* [Marquis Wang](mailto:marquis@marquiswang.com)
|
|
||||||
* [Julien Hoarau](mailto:madgnome@gmail.com)
|
Dmitry Jemerov
|
||||||
* [Masanobu Imai](mailto:masanobu.imai@gmail.com)
|
* [![icon][mail]](mailto:marquis@marquiswang.com)
|
||||||
* [poxu](mailto:poxvuibr@gmail.com)
|
[![icon][github]](https://github.com/marquiswang)
|
||||||
* [Alexander Zolotov](mailto:alexander.zolotov@jetbrains.com)
|
|
||||||
* [John Lindquist](mailto:johnlindquist@gmail.com)
|
Marquis Wang
|
||||||
* [Ira Klotzko](mailto:iklotzko@ltech.com)
|
* [![icon][mail]](mailto:madgnome@gmail.com)
|
||||||
* [Alex Selesse](mailto:alex@selesse.com)
|
[![icon][github-off]](#)
|
||||||
* [Dathan Bennett](mailto:dbennett@palantir.com)
|
|
||||||
* [salaam](mailto:kphayen@gmail.com)
|
Julien Hoarau
|
||||||
* [Alexey Shmalko](mailto:rasen.dubi@gmail.com)
|
* [![icon][mail]](mailto:masanobu.imai@gmail.com)
|
||||||
* [Andrew Brookins](mailto:a.m.brookins@gmail.com)
|
[![icon][github-off]](#)
|
||||||
* [Chang Wang](mailto:changwang83@gmail.com)
|
|
||||||
* [Jaime Sanchez](mailto:josejaime.sanchez@gmail.com)
|
Masanobu Imai
|
||||||
* [Thomas B Homburg](mailto:thomas@homburg.dk)
|
* [![icon][mail]](mailto:poxvuibr@gmail.com)
|
||||||
* [smartbomb](mailto:smartbomb@server.fake)
|
[![icon][github]](https://github.com/poxu)
|
||||||
* [Tuomas Tynkkynen](mailto:tuomas.tynkkynen@iki.fi)
|
|
||||||
* [Jackson Popkin](mailto:jackson@donorschoose.org)
|
poxu
|
||||||
* [Teruo Kunihiro](mailto:yuyuyu1999@gmail.com)
|
* [![icon][mail]](mailto:alexander.zolotov@jetbrains.com)
|
||||||
* [Liubov Paina](mailto:lubashka.994@mail.ru)
|
[![icon][github]](https://github.com/zolotov)
|
||||||
* [Daniel Leong](mailto:me@dhleong.net)
|
|
||||||
* [Aleksey Lagoshin](mailto:aleksey@pri-num.com)
|
Alexander Zolotov
|
||||||
* [Paulo Bu](mailto:pbu_98@yahoo.com)
|
* [![icon][mail]](mailto:johnlindquist@gmail.com)
|
||||||
* [Giorgos Gaganis](mailto:gaganis@yahoo.com)
|
[![icon][github]](https://github.com/johnlindquist)
|
||||||
* [Pavel Fatin](mailto:pavel.fatin@jetbrains.com)
|
|
||||||
* [tieTYT](mailto:tietyt@gmail.com)
|
John Lindquist
|
||||||
* [Nick Gieschen](mailto:nickgieschen@gmail.com)
|
* [![icon][mail]](mailto:iklotzko@ltech.com)
|
||||||
* [Naoto Ikeno](mailto:ikenox@gmail.com)
|
[![icon][github-off]](#)
|
||||||
* [Maximilian Luz](mailto:qzed@users.noreply.github.com)
|
|
||||||
* [Vladimir Parfinenko](mailto:vparfinenko@excelsior-usa.com)
|
Ira Klotzko
|
||||||
* [Florian Hassmann](mailto:hassmann@hwdev.de)
|
* [![icon][mail]](mailto:alex@selesse.com)
|
||||||
* [Jan Palus](mailto:jpalus@fastmail.com)
|
[![icon][github]](https://github.com/selesse)
|
||||||
* [Konstantin Petrov](mailto:kpetrov@ripe.net)
|
|
||||||
* [Vasily Alferov](mailto:ya-ikmik2012@yandex.ru)
|
Alex Selesse
|
||||||
* [Vitalii Karavaev](mailto:fkve97@gmail.com)
|
* [![icon][mail]](mailto:dbennett@palantir.com)
|
||||||
* [John Lin](mailto:johnlinp@gmail.com)
|
[![icon][github-off]](#)
|
||||||
* [Alex Plate](mailto:alexpl292@gmail.com)
|
|
||||||
* [Matt Ellis](mailto:m.t.ellis@gmail.com)
|
Dathan Bennett
|
||||||
* [John Grib](mailto:johngrib82@gmail.com)
|
* [![icon][mail]](mailto:kphayen@gmail.com)
|
||||||
* [Marcel Hild](mailto:hild@b4mad.net)
|
[![icon][github-off]](#)
|
||||||
* [Vedran Budimcic](mailto:vedranb@gmail.com)
|
|
||||||
* [Andrei Gasparovici](mailto:andreigasparovici1@gmail.com)
|
salaam
|
||||||
* [dos65](mailto:qtankle@gmail.com)
|
* [![icon][mail]](mailto:rasen.dubi@gmail.com)
|
||||||
* [Tony Arra](mailto:ttonyarra@gmail.com)
|
[![icon][github]](https://github.com/rasendubi)
|
||||||
* [Brad Ziolko](mailto:bradziolko@gmail.com)
|
|
||||||
* [sumoooru2](mailto:sumoooru2@gmail.com)
|
Alexey Shmalko
|
||||||
* [gecko655](mailto:aqwsedrft1234@yahoo.co.jp)
|
* [![icon][mail]](mailto:a.m.brookins@gmail.com)
|
||||||
* [Daniele Megna](mailto:megna.dany@gmail.com)
|
[![icon][github-off]](#)
|
||||||
* [Andrew Potter](mailto:apottere@gmail.com)
|
|
||||||
* [Romain Gautier](mailto:romain.gautier@nimamoh.net)
|
Andrew Brookins
|
||||||
* [Elliot Courant](mailto:elliot.courant@wheniwork.com)
|
* [![icon][mail]](mailto:changwang83@gmail.com)
|
||||||
* [Simon Rainer](mailto:simon.rainer@fau.de)
|
[![icon][github-off]](#)
|
||||||
* [Michael Ziwisky](mailto:mziwisky@instructure.com)
|
|
||||||
* [Pierce Corcoran](mailto:pierce@plasticcow.com)
|
Chang Wang
|
||||||
* [Jonatan Tierno](mailto:jonatantierno@gmail.com)
|
* [![icon][mail]](mailto:josejaime.sanchez@gmail.com)
|
||||||
* [Brendan Annable](mailto:brendan@annable.me)
|
[![icon][github-off]](#)
|
||||||
* [Naveen Kumar Molleti](mailto:nerd.naveen@gmail.com)
|
|
||||||
|
Jaime Sanchez
|
||||||
|
* [![icon][mail]](mailto:thomas@homburg.dk)
|
||||||
|
[![icon][github-off]](#)
|
||||||
|
|
||||||
|
Thomas B Homburg
|
||||||
|
* [![icon][mail]](mailto:smartbomb@server.fake)
|
||||||
|
[![icon][github-off]](#)
|
||||||
|
|
||||||
|
smartbomb
|
||||||
|
* [![icon][mail]](mailto:tuomas.tynkkynen@iki.fi)
|
||||||
|
[![icon][github-off]](#)
|
||||||
|
|
||||||
|
Tuomas Tynkkynen
|
||||||
|
* [![icon][mail]](mailto:jackson@donorschoose.org)
|
||||||
|
[![icon][github-off]](#)
|
||||||
|
|
||||||
|
Jackson Popkin
|
||||||
|
* [![icon][mail]](mailto:yuyuyu1999@gmail.com)
|
||||||
|
[![icon][github-off]](#)
|
||||||
|
|
||||||
|
Teruo Kunihiro
|
||||||
|
* [![icon][mail]](mailto:lubashka.994@mail.ru)
|
||||||
|
[![icon][github-off]](#)
|
||||||
|
|
||||||
|
Liubov Paina
|
||||||
|
* [![icon][mail]](mailto:me@dhleong.net)
|
||||||
|
[![icon][github]](https://github.com/dhleong)
|
||||||
|
|
||||||
|
Daniel Leong
|
||||||
|
* [![icon][mail]](mailto:aleksey@pri-num.com)
|
||||||
|
[![icon][github-off]](#)
|
||||||
|
|
||||||
|
Aleksey Lagoshin
|
||||||
|
* [![icon][mail]](mailto:pbu_98@yahoo.com)
|
||||||
|
[![icon][github-off]](#)
|
||||||
|
|
||||||
|
Paulo Bu
|
||||||
|
* [![icon][mail]](mailto:gaganis@yahoo.com)
|
||||||
|
[![icon][github]](https://github.com/gaganis)
|
||||||
|
|
||||||
|
Giorgos Gaganis
|
||||||
|
* [![icon][mail]](mailto:pavel.fatin@jetbrains.com)
|
||||||
|
[![icon][github]](https://github.com/pavelfatin)
|
||||||
|
|
||||||
|
Pavel Fatin
|
||||||
|
* [![icon][mail]](mailto:tietyt@gmail.com)
|
||||||
|
[![icon][github-off]](#)
|
||||||
|
|
||||||
|
tieTYT
|
||||||
|
* [![icon][mail]](mailto:nickgieschen@gmail.com)
|
||||||
|
[![icon][github-off]](#)
|
||||||
|
|
||||||
|
Nick Gieschen
|
||||||
|
* [![icon][mail]](mailto:ikenox@gmail.com)
|
||||||
|
[![icon][github]](https://github.com/ikenox)
|
||||||
|
|
||||||
|
Naoto Ikeno
|
||||||
|
* [![icon][mail]](mailto:qzed@users.noreply.github.com)
|
||||||
|
[![icon][github-off]](#)
|
||||||
|
|
||||||
|
Maximilian Luz
|
||||||
|
* [![icon][mail]](mailto:vparfinenko@excelsior-usa.com)
|
||||||
|
[![icon][github-off]](#)
|
||||||
|
|
||||||
|
Vladimir Parfinenko
|
||||||
|
* [![icon][mail]](mailto:hassmann@hwdev.de)
|
||||||
|
[![icon][github-off]](#)
|
||||||
|
|
||||||
|
Florian Hassmann
|
||||||
|
* [![icon][mail]](mailto:jpalus@fastmail.com)
|
||||||
|
[![icon][github]](https://github.com/jpalus)
|
||||||
|
|
||||||
|
Jan Palus
|
||||||
|
* [![icon][mail]](mailto:kpetrov@ripe.net)
|
||||||
|
[![icon][github-off]](#)
|
||||||
|
|
||||||
|
Konstantin Petrov
|
||||||
|
* [![icon][mail]](mailto:ya-ikmik2012@yandex.ru)
|
||||||
|
[![icon][github]](https://github.com/vasalf)
|
||||||
|
|
||||||
|
Vasily Alferov
|
||||||
|
* [![icon][mail]](mailto:fkve97@gmail.com)
|
||||||
|
[![icon][github]](https://github.com/karavaevitalii)
|
||||||
|
|
||||||
|
Vitalii Karavaev
|
||||||
|
* [![icon][mail]](mailto:johnlinp@gmail.com)
|
||||||
|
[![icon][github]](https://github.com/johnlinp)
|
||||||
|
|
||||||
|
John Lin
|
||||||
|
* [![icon][mail]](mailto:alexpl292@gmail.com)
|
||||||
|
[![icon][github]](https://github.com/AlexPl292)
|
||||||
|
|
||||||
|
Alex Plate
|
||||||
|
* [![icon][mail]](mailto:m.t.ellis@gmail.com)
|
||||||
|
[![icon][github]](https://github.com/citizenmatt)
|
||||||
|
|
||||||
|
Matt Ellis
|
||||||
|
* [![icon][mail]](mailto:johngrib82@gmail.com)
|
||||||
|
[![icon][github]](https://github.com/johngrib)
|
||||||
|
|
||||||
|
John Grib
|
||||||
|
* [![icon][mail]](mailto:hild@b4mad.net)
|
||||||
|
[![icon][github-off]](#)
|
||||||
|
|
||||||
|
Marcel Hild
|
||||||
|
* [![icon][mail]](mailto:vedranb@gmail.com)
|
||||||
|
[![icon][github-off]](#)
|
||||||
|
|
||||||
|
Vedran Budimcic
|
||||||
|
* [![icon][mail]](mailto:andreigasparovici1@gmail.com)
|
||||||
|
[![icon][github]](https://github.com/andreigasparovici)
|
||||||
|
|
||||||
|
Andrei Gasparovici
|
||||||
|
* [![icon][mail]](mailto:qtankle@gmail.com)
|
||||||
|
[![icon][github]](https://github.com/dos65)
|
||||||
|
|
||||||
|
dos65
|
||||||
|
* [![icon][mail]](mailto:ttonyarra@gmail.com)
|
||||||
|
[![icon][github]](https://github.com/TonyArra)
|
||||||
|
|
||||||
|
Tony Arra
|
||||||
|
* [![icon][mail]](mailto:bradziolko@gmail.com)
|
||||||
|
[![icon][github]](https://github.com/bradziolko)
|
||||||
|
|
||||||
|
Brad Ziolko
|
||||||
|
* [![icon][mail]](mailto:sumoooru2@gmail.com)
|
||||||
|
[![icon][github]](https://github.com/sumoooru2)
|
||||||
|
|
||||||
|
sumoooru2
|
||||||
|
* [![icon][mail]](mailto:aqwsedrft1234@yahoo.co.jp)
|
||||||
|
[![icon][github]](https://github.com/gecko655)
|
||||||
|
|
||||||
|
gecko655
|
||||||
|
* [![icon][mail]](mailto:megna.dany@gmail.com)
|
||||||
|
[![icon][github]](https://github.com/danielemegna)
|
||||||
|
|
||||||
|
Daniele Megna
|
||||||
|
* [![icon][mail]](mailto:apottere@gmail.com)
|
||||||
|
[![icon][github]](https://github.com/apottere)
|
||||||
|
|
||||||
|
Andrew Potter
|
||||||
|
* [![icon][mail]](mailto:romain.gautier@nimamoh.net)
|
||||||
|
[![icon][github]](https://github.com/Nimamoh)
|
||||||
|
|
||||||
|
Romain Gautier
|
||||||
|
* [![icon][mail]](mailto:elliot.courant@wheniwork.com)
|
||||||
|
[![icon][github]](https://github.com/ECourant)
|
||||||
|
|
||||||
|
Elliot Courant
|
||||||
|
* [![icon][mail]](mailto:simon.rainer@fau.de)
|
||||||
|
[![icon][github]](https://github.com/Vvalter)
|
||||||
|
|
||||||
|
Simon Rainer
|
||||||
|
* [![icon][mail]](mailto:mziwisky@instructure.com)
|
||||||
|
[![icon][github]](https://github.com/mziwisky)
|
||||||
|
|
||||||
|
Michael Ziwisky
|
||||||
|
* [![icon][mail]](mailto:pierce@plasticcow.com)
|
||||||
|
[![icon][github]](https://github.com/thecodewarrior)
|
||||||
|
|
||||||
|
Pierce Corcoran
|
||||||
|
* [![icon][mail]](mailto:jonatantierno@gmail.com)
|
||||||
|
[![icon][github]](https://github.com/jonatantierno)
|
||||||
|
|
||||||
|
Jonatan Tierno
|
||||||
|
* [![icon][mail]](mailto:brendan@annable.me)
|
||||||
|
[![icon][github]](https://github.com/BrendanAnnable)
|
||||||
|
|
||||||
|
Brendan Annable
|
||||||
|
* [![icon][mail]](mailto:nerd.naveen@gmail.com)
|
||||||
|
[![icon][github]](https://github.com/NOLFXceptMe)
|
||||||
|
|
||||||
|
Naveen Kumar Molleti
|
||||||
|
* [![icon][mail]](mailto:jorgen.granseth@bekk.no)
|
||||||
|
[![icon][github]](https://github.com/jorgengranseth)
|
||||||
|
|
||||||
|
Jørgen Granseth
|
||||||
|
|
||||||
If you are a contributor and your name is not listed here, feel free to
|
If you are a contributor and your name is not listed here, feel free to
|
||||||
contact the maintainer.
|
contact the maintainers.
|
||||||
|
|
||||||
|
<a href="https://icons8.com">Icons by Icons8</a>
|
||||||
|
|
||||||
|
[mail]: resources/icons/mail.png
|
||||||
|
[github]: resources/icons/github.png
|
||||||
|
|
||||||
|
[github-off]: resources/icons/github-off.png
|
||||||
|
26
CHANGES.md
26
CHANGES.md
@@ -16,6 +16,29 @@ It is important to distinguish EAP from traditional pre-release software.
|
|||||||
Please note that the quality of EAP versions may at times be way below even
|
Please note that the quality of EAP versions may at times be way below even
|
||||||
usual beta standards.
|
usual beta standards.
|
||||||
|
|
||||||
|
To be released
|
||||||
|
--------------
|
||||||
|
**Features:**
|
||||||
|
* Support surrounding with a function name ([link](https://github.com/tpope/vim-surround/blob/master/doc/surround.txt#L138))
|
||||||
|
* [VIM-1720](https://youtrack.jetbrains.com/issue/VIM-1720) Add `:delmarks` command
|
||||||
|
|
||||||
|
**Fixes:**
|
||||||
|
* [VIM-1766](https://youtrack.jetbrains.com/issue/VIM-1766) Fix disappearing caret in ex entry on Linux
|
||||||
|
* [VIM-1032](https://youtrack.jetbrains.com/issue/VIM-1032) Annotations work well with relative line numbers enabled
|
||||||
|
* [VIM-1762](https://youtrack.jetbrains.com/issue/VIM-1762) Relative line numbers respect line number theme
|
||||||
|
* [VIM-1717](https://youtrack.jetbrains.com/issue/VIM-1717) Fix incorrect scroll location if no match with `incsearch`
|
||||||
|
* [VIM-1757](https://youtrack.jetbrains.com/issue/VIM-1757) Fix incorrect search results when specifying offset as part of search command
|
||||||
|
* Fix search highlights not showing after deleting last result
|
||||||
|
* Update current line highlight during incsearch and replace operation
|
||||||
|
* [VIM-1773](https://youtrack.jetbrains.com/issue/VIM-1773) Provide fallback error stripe colour if not defined
|
||||||
|
* [VIM-1785](https://youtrack.jetbrains.com/issue/VIM-1785)
|
||||||
|
[VIM-1731](https://youtrack.jetbrains.com/issue/VIM-1731)
|
||||||
|
Fix some problems with yanking to clipboard
|
||||||
|
* [VIM-1781](https://youtrack.jetbrains.com/issue/VIM-1781) Fix yanking with dollar motion
|
||||||
|
* [VIM-1772](https://youtrack.jetbrains.com/issue/VIM-1772) Fix yanking with `:y` command
|
||||||
|
* [VIM-1685](https://youtrack.jetbrains.com/issue/VIM-1685) Fix `ESC` for insert mode
|
||||||
|
* [VIM-1752](https://youtrack.jetbrains.com/issue/VIM-1752) Fix `ESC` for insert mode
|
||||||
|
|
||||||
0.53, 2019-08-07
|
0.53, 2019-08-07
|
||||||
--------------
|
--------------
|
||||||
* [VIM-1711](https://youtrack.jetbrains.com/issue/VIM-1711) Search is not triggered during surround action
|
* [VIM-1711](https://youtrack.jetbrains.com/issue/VIM-1711) Search is not triggered during surround action
|
||||||
@@ -26,8 +49,7 @@ usual beta standards.
|
|||||||
* [VIM-1725](https://youtrack.jetbrains.com/issue/VIM-1725) Fix problems with Japanese language
|
* [VIM-1725](https://youtrack.jetbrains.com/issue/VIM-1725) Fix problems with Japanese language
|
||||||
* [VIM-1648](https://youtrack.jetbrains.com/issue/VIM-1648) Fix exception while substitute with conformation
|
* [VIM-1648](https://youtrack.jetbrains.com/issue/VIM-1648) Fix exception while substitute with conformation
|
||||||
* [VIM-1736](https://youtrack.jetbrains.com/issue/VIM-1736) Fix `` for ex panel
|
* [VIM-1736](https://youtrack.jetbrains.com/issue/VIM-1736) Fix `` for ex panel
|
||||||
* [VIM-1739](https://youtrack.jetbrains.com/issue/VIM-1739) Fix full-width characters for ex panel
|
* [VIM-1739](https://youtrack.jetbrains.com/issue/VIM-1739) Fix full-width characters for ex pane
|
||||||
|
|
||||||
|
|
||||||
0.52, 2019-07-23
|
0.52, 2019-07-23
|
||||||
--------------
|
--------------
|
||||||
|
@@ -1,12 +1,12 @@
|
|||||||
<div>
|
<div>
|
||||||
<a href="http://teamcity.jetbrains.com/viewType.html?buildTypeId=IdeaVim_TestsForIntelliJ20183&guest=1">
|
<a href="https://teamcity.jetbrains.com/viewType.html?buildTypeId=IdeaVim_TestsForIntelliJ20183&guest=1">
|
||||||
<img src="http://teamcity.jetbrains.com/app/rest/builds/buildType:(id:IdeaVim_TestsForIntelliJ20183)/statusIcon.svg?guest=1"/>
|
<img src="https://teamcity.jetbrains.com/app/rest/builds/buildType:(id:IdeaVim_TestsForIntelliJ20183)/statusIcon.svg?guest=1"/>
|
||||||
</a>
|
</a>
|
||||||
<span>2018.3 Tests</span>
|
<span>2018.3 Tests</span>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<a href="http://teamcity.jetbrains.com/viewType.html?buildTypeId=IdeaVim_TestsForIntelliJ20191&guest=1">
|
<a href="https://teamcity.jetbrains.com/viewType.html?buildTypeId=IdeaVim_TestsForIntelliJ20191&guest=1">
|
||||||
<img src="http://teamcity.jetbrains.com/app/rest/builds/buildType:(id:IdeaVim_TestsForIntelliJ20191)/statusIcon.svg?guest=1"/>
|
<img src="https://teamcity.jetbrains.com/app/rest/builds/buildType:(id:IdeaVim_TestsForIntelliJ20191)/statusIcon.svg?guest=1"/>
|
||||||
</a>
|
</a>
|
||||||
<span>2019.1 Tests</span>
|
<span>2019.1 Tests</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -18,8 +18,8 @@ In order to contribute to IdeaVim, you should have some understanding of Java or
|
|||||||
|
|
||||||
See also these docs on the IntelliJ API:
|
See also these docs on the IntelliJ API:
|
||||||
|
|
||||||
* [IntelliJ architectural overview](http://confluence.jetbrains.com/display/IDEADEV/IntelliJ+IDEA+Architectural+Overview)
|
* [IntelliJ architectural overview](https://www.jetbrains.org/intellij/sdk/docs/platform/fundamentals.html)
|
||||||
* [IntelliJ plugin development resources](http://confluence.jetbrains.com/display/IDEADEV/PluginDevelopment)
|
* [IntelliJ plugin development resources](https://www.jetbrains.org/intellij/sdk/docs/welcome.html)
|
||||||
|
|
||||||
You can start by:
|
You can start by:
|
||||||
|
|
||||||
@@ -85,7 +85,7 @@ in the issue tracker.
|
|||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
3. Go to `Preferences | Editor | Copyright`, click the "+" button.
|
3. Go to `Preferences | Editor | Copyright`, click the "+" button.
|
||||||
Scope: Copyright scope
|
Scope: Copyright scope
|
||||||
|
35
README.md
35
README.md
@@ -3,20 +3,20 @@ IdeaVim
|
|||||||
|
|
||||||
<div>
|
<div>
|
||||||
<a href="https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub">
|
<a href="https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub">
|
||||||
<img src="http://jb.gg/badges/official.svg" alt="official JetBrains project"/>
|
<img src="https://jb.gg/badges/official.svg" alt="official JetBrains project"/>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<a href="http://teamcity.jetbrains.com/viewType.html?buildTypeId=IdeaVim_Deploy&guest=1">
|
<a href="https://teamcity.jetbrains.com/viewType.html?buildTypeId=IdeaVim_Deploy&guest=1">
|
||||||
<img src="http://teamcity.jetbrains.com/app/rest/builds/buildType:(id:IdeaVim_Deploy)/statusIcon.svg?guest=1"/>
|
<img src="https://teamcity.jetbrains.com/app/rest/builds/buildType:(id:IdeaVim_Deploy)/statusIcon.svg?guest=1"/>
|
||||||
</a>
|
</a>
|
||||||
<span>Stable</span>
|
<span>Stable</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<a href="http://teamcity.jetbrains.com/viewType.html?buildTypeId=IdeaVim_Build&guest=1">
|
<a href="https://teamcity.jetbrains.com/viewType.html?buildTypeId=IdeaVim_Build&guest=1">
|
||||||
<img src="http://teamcity.jetbrains.com/app/rest/builds/buildType:(id:IdeaVim_Build)/statusIcon.svg?guest=1"/>
|
<img src="https://teamcity.jetbrains.com/app/rest/builds/buildType:(id:IdeaVim_Build)/statusIcon.svg?guest=1"/>
|
||||||
</a>
|
</a>
|
||||||
<span>EAP</span>
|
<span>EAP</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -28,11 +28,11 @@ RubyMine, AppCode, DataGrip, GoLand, Rider, Cursive, and Android Studio.
|
|||||||
|
|
||||||
Resources:
|
Resources:
|
||||||
|
|
||||||
* [Plugin homepage](http://plugins.jetbrains.com/plugin/164)
|
* [Plugin homepage](https://plugins.jetbrains.com/plugin/164-ideavim)
|
||||||
* [Changelog](CHANGES.md)
|
* [Changelog](CHANGES.md)
|
||||||
* [Bug tracker](http://youtrack.jetbrains.com/issues/VIM)
|
* [Bug tracker](https://youtrack.jetbrains.com/issues/VIM)
|
||||||
* [Continuous integration builds](http://teamcity.jetbrains.com/project.html?projectId=IdeaVim&guest=1)
|
* [Continuous integration builds](https://teamcity.jetbrains.com/project.html?projectId=IdeaVim&guest=1)
|
||||||
* [@IdeaVim](http://twitter.com/ideavim) in Twitter
|
* [@IdeaVim](https://twitter.com/ideavim) in Twitter
|
||||||
|
|
||||||
|
|
||||||
Installation
|
Installation
|
||||||
@@ -70,8 +70,8 @@ Please note that the quality of EAP versions may at times be way below even
|
|||||||
usual beta standards.
|
usual beta standards.
|
||||||
|
|
||||||
You can always leave your feedback with:
|
You can always leave your feedback with:
|
||||||
* [@IdeaVim](http://twitter.com/ideavim) in Twitter
|
* [@IdeaVim](https://twitter.com/ideavim) in Twitter
|
||||||
* [Bug tracker](http://youtrack.jetbrains.com/issues/VIM)
|
* [Bug tracker](https://youtrack.jetbrains.com/issues/VIM)
|
||||||
|
|
||||||
|
|
||||||
Summary of Supported Vim Features
|
Summary of Supported Vim Features
|
||||||
@@ -111,7 +111,7 @@ Not supported (yet):
|
|||||||
See also:
|
See also:
|
||||||
|
|
||||||
* [The list of all supported commands](src/com/maddyhome/idea/vim/package-info.java)
|
* [The list of all supported commands](src/com/maddyhome/idea/vim/package-info.java)
|
||||||
* [Top features and bugs](http://youtrack.jetbrains.com/issues/VIM?q=%23Unresolved+sort+by%3A+votes)
|
* [Top features and bugs](https://youtrack.jetbrains.com/issues/VIM?q=%23Unresolved+sort+by%3A+votes)
|
||||||
|
|
||||||
|
|
||||||
Files
|
Files
|
||||||
@@ -125,7 +125,7 @@ You can read your ~/.vimrc file from ~/.ideavimrc with this command:
|
|||||||
source ~/.vimrc
|
source ~/.vimrc
|
||||||
|
|
||||||
Note, that IdeaVim currently parses ~/.ideavimrc file via simple pattern matching.
|
Note, that IdeaVim currently parses ~/.ideavimrc file via simple pattern matching.
|
||||||
See [VIM-669](http://youtrack.jetbrains.com/issue/VIM-669) for proper parsing
|
See [VIM-669](https://youtrack.jetbrains.com/issue/VIM-669) for proper parsing
|
||||||
of VimL files.
|
of VimL files.
|
||||||
|
|
||||||
Also note that if you have overridden the `user.home` JVM option, this
|
Also note that if you have overridden the `user.home` JVM option, this
|
||||||
@@ -145,12 +145,17 @@ IdeaVim extensions, you have to enable them via this command in your ~/.ideavimr
|
|||||||
Available extensions:
|
Available extensions:
|
||||||
|
|
||||||
* surround
|
* surround
|
||||||
|
* `set surround`
|
||||||
* Emulates [vim-surround](https://github.com/tpope/vim-surround)
|
* Emulates [vim-surround](https://github.com/tpope/vim-surround)
|
||||||
* Commands: `ys`, `cs`, `ds`, `S`
|
* Commands: `ys`, `cs`, `ds`, `S`
|
||||||
|
|
||||||
* multiple-cursors
|
* multiple-cursors
|
||||||
|
* `set multiple-cursors`
|
||||||
* Emulates [vim-multiple-cursors](https://github.com/terryma/vim-multiple-cursors)
|
* Emulates [vim-multiple-cursors](https://github.com/terryma/vim-multiple-cursors)
|
||||||
* Commands: `<A-n>`, `<A-x>`, `<A-p>`, `g<A-n>`
|
* Commands: `<A-n>`, `<A-x>`, `<A-p>`, `g<A-n>`
|
||||||
|
|
||||||
* commentary
|
* commentary
|
||||||
|
* `set commentary`
|
||||||
* Emulates [commentary.vim](https://github.com/tpope/vim-commentary)
|
* Emulates [commentary.vim](https://github.com/tpope/vim-commentary)
|
||||||
* Commands: `gcc`, `gc + motion`, `v_gc`
|
* Commands: `gcc`, `gc + motion`, `v_gc`
|
||||||
|
|
||||||
@@ -164,7 +169,7 @@ The IdeaVim plugin uses the undo/redo functionality of the IntelliJ Platform,
|
|||||||
so the behavior of the `u` and `<C-R>` commands may differ from the original
|
so the behavior of the `u` and `<C-R>` commands may differ from the original
|
||||||
Vim. Vim compatibility of undo/redo may be improved in future releases.
|
Vim. Vim compatibility of undo/redo may be improved in future releases.
|
||||||
|
|
||||||
See also [unresolved undo issues](http://youtrack.jetbrains.com/issues/VIM?q=%23Unresolved+Help+topic%3A+u).
|
See also [unresolved undo issues](https://youtrack.jetbrains.com/issues/VIM?q=%23Unresolved+Help+topic%3A+u).
|
||||||
|
|
||||||
### Escape
|
### Escape
|
||||||
|
|
||||||
@@ -174,7 +179,7 @@ should use `<C-c>` or `<C-[>` instead. In some dialog windows, the normal mode i
|
|||||||
switched by default. The usage of the Vim emulator in dialog windows is an area for
|
switched by default. The usage of the Vim emulator in dialog windows is an area for
|
||||||
improvement.
|
improvement.
|
||||||
|
|
||||||
See also [unresolved escape issues](http://youtrack.jetbrains.com/issues/VIM?q=%23Unresolved+Help+topic%3A+i_Esc).
|
See also [unresolved escape issues](https://youtrack.jetbrains.com/issues/VIM?q=%23Unresolved+Help+topic%3A+i_Esc).
|
||||||
|
|
||||||
### Executing IDE Actions
|
### Executing IDE Actions
|
||||||
|
|
||||||
|
13
build.gradle
13
build.gradle
@@ -55,10 +55,21 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
|
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
|
||||||
compile "org.jetbrains:annotations:17.0.0"
|
compile "org.jetbrains:annotations:17.0.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
compileKotlin {
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = javaVersion
|
||||||
|
}
|
||||||
|
}
|
||||||
|
compileTestKotlin {
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = javaVersion
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tasks.register("slackEapNotification") {
|
tasks.register("slackEapNotification") {
|
||||||
doLast {
|
doLast {
|
||||||
if (!slackUrl) return
|
if (!slackUrl) return
|
||||||
|
@@ -1,9 +1,11 @@
|
|||||||
ideaVersion=192-EAP-SNAPSHOT
|
# suppress inspection "UnusedProperty" for whole file
|
||||||
|
|
||||||
|
ideaVersion=193-EAP-SNAPSHOT
|
||||||
downloadIdeaSources=true
|
downloadIdeaSources=true
|
||||||
instrumentPluginCode=true
|
instrumentPluginCode=true
|
||||||
version=SNAPSHOT
|
version=SNAPSHOT
|
||||||
javaVersion=1.8
|
javaVersion=1.8
|
||||||
kotlinVersion=1.3.41
|
kotlinVersion=1.3.50
|
||||||
publishUsername=username
|
publishUsername=username
|
||||||
publishToken=token
|
publishToken=token
|
||||||
publishChannels=eap
|
publishChannels=eap
|
||||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -13,7 +13,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
|
|
||||||
#Thu Feb 21 15:20:13 MSK 2019
|
#Thu Feb 21 15:20:13 MSK 2019
|
||||||
|
@@ -1,17 +1,9 @@
|
|||||||
<idea-plugin url="http://plugins.jetbrains.com/plugin/164">
|
<idea-plugin url="https://plugins.jetbrains.com/plugin/164">
|
||||||
<name>IdeaVim</name>
|
<name>IdeaVim</name>
|
||||||
<id>IdeaVIM</id>
|
<id>IdeaVIM</id>
|
||||||
<change-notes><![CDATA[
|
<change-notes><![CDATA[
|
||||||
<ul>
|
<ul>
|
||||||
<li>Support select mode</li>
|
<li>Support surrounding with a function name</li>
|
||||||
<li>Integration with templates & in-line refactorings using Select mode</li>
|
|
||||||
<li>Support "Extend selection" action in visual mode</li>
|
|
||||||
<li>Commentary extension</li>
|
|
||||||
<li>Add options to integrate paste/join/marks with the IDE</li>
|
|
||||||
<li>Support 'gn' commands</li>
|
|
||||||
<li>Support :command command</li>
|
|
||||||
<li>Support :shell command</li>
|
|
||||||
<li>Support :tabnext and :tabprevious commands</li>
|
|
||||||
<li>Various bug fixes</li>
|
<li>Various bug fixes</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>See also the complete <a href="https://github.com/JetBrains/ideavim/blob/master/CHANGES.md">changelog</a>.</p>
|
<p>See also the complete <a href="https://github.com/JetBrains/ideavim/blob/master/CHANGES.md">changelog</a>.</p>
|
||||||
@@ -22,13 +14,14 @@
|
|||||||
<p>See also:</p>
|
<p>See also:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="https://github.com/JetBrains/ideavim">GitHub repository</a>: documentation and contributing</li>
|
<li><a href="https://github.com/JetBrains/ideavim">GitHub repository</a>: documentation and contributing</li>
|
||||||
<li><a href="http://youtrack.jetbrains.com/issues/VIM">Issue tracker</a>: feature requests and bug reports</li>
|
<li><a href="https://youtrack.jetbrains.com/issues/VIM">Issue tracker</a>: feature requests and bug reports</li>
|
||||||
</ul>
|
</ul>
|
||||||
]]></description>
|
]]></description>
|
||||||
<version>SNAPSHOT</version>
|
<version>SNAPSHOT</version>
|
||||||
<vendor>JetBrains</vendor>
|
<vendor>JetBrains</vendor>
|
||||||
|
|
||||||
<idea-version since-build="183.2940.10"/>
|
<!-- Please search for "[VERSION UPDATE]" in project in case you update the since-build version -->
|
||||||
|
<idea-version since-build="183.4284.148"/>
|
||||||
|
|
||||||
<!-- Mark the plugin as compatible with RubyMine and other products based on the IntelliJ platform -->
|
<!-- Mark the plugin as compatible with RubyMine and other products based on the IntelliJ platform -->
|
||||||
<depends>com.intellij.modules.lang</depends>
|
<depends>com.intellij.modules.lang</depends>
|
||||||
@@ -49,12 +42,32 @@
|
|||||||
</project-components>
|
</project-components>
|
||||||
|
|
||||||
<extensionPoints>
|
<extensionPoints>
|
||||||
<extensionPoint qualifiedName="IdeaVIM.vimExtension" interface="com.maddyhome.idea.vim.extension.VimExtension"/>
|
<extensionPoint name="vimExtension" interface="com.maddyhome.idea.vim.extension.VimExtension"/>
|
||||||
|
<extensionPoint name="vimAction" interface="com.maddyhome.idea.vim.handler.EditorActionHandlerBase"/>
|
||||||
|
<extensionPoint name="vimExCommand" interface="com.maddyhome.idea.vim.ex.CommandHandler"/>
|
||||||
</extensionPoints>
|
</extensionPoints>
|
||||||
|
|
||||||
<extensions defaultExtensionNs="com.intellij">
|
<extensions defaultExtensionNs="com.intellij">
|
||||||
<applicationConfigurable groupId="editor" instance="com.maddyhome.idea.vim.ui.VimEmulationConfigurable"/>
|
<applicationConfigurable groupId="editor" instance="com.maddyhome.idea.vim.ui.VimEmulationConfigurable"/>
|
||||||
|
|
||||||
|
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.MotionGroup"/>
|
||||||
|
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.ChangeGroup"/>
|
||||||
|
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.CommandGroup"/>
|
||||||
|
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.MarkGroup"/>
|
||||||
|
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.RegisterGroup"/>
|
||||||
|
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.FileGroup"/>
|
||||||
|
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.SearchGroup"/>
|
||||||
|
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.ProcessGroup"/>
|
||||||
|
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.MacroGroup"/>
|
||||||
|
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.DigraphGroup"/>
|
||||||
|
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.HistoryGroup"/>
|
||||||
|
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.KeyGroup"/>
|
||||||
|
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.WindowGroup"/>
|
||||||
|
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.EditorGroup"/>
|
||||||
|
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.visual.VisualMotionGroup"/>
|
||||||
|
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.copy.YankGroup"/>
|
||||||
|
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.copy.PutGroup"/>
|
||||||
|
|
||||||
<projectService serviceImplementation="com.maddyhome.idea.vim.group.NotificationService"/>
|
<projectService serviceImplementation="com.maddyhome.idea.vim.group.NotificationService"/>
|
||||||
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.NotificationService"/>
|
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.NotificationService"/>
|
||||||
</extensions>
|
</extensions>
|
||||||
@@ -63,358 +76,428 @@
|
|||||||
<vimExtension implementation="com.maddyhome.idea.vim.extension.surround.VimSurroundExtension"/>
|
<vimExtension implementation="com.maddyhome.idea.vim.extension.surround.VimSurroundExtension"/>
|
||||||
<vimExtension implementation="com.maddyhome.idea.vim.extension.multiplecursors.VimMultipleCursorsExtension"/>
|
<vimExtension implementation="com.maddyhome.idea.vim.extension.multiplecursors.VimMultipleCursorsExtension"/>
|
||||||
<vimExtension implementation="com.maddyhome.idea.vim.extension.commentary.CommentaryExtension"/>
|
<vimExtension implementation="com.maddyhome.idea.vim.extension.commentary.CommentaryExtension"/>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Motions -->
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.tabs.MotionPreviousTabAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.tabs.MotionNextTabAction"/>
|
||||||
|
<!-- Left/Right -->
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionColumnAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionFirstColumnAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionFirstColumnInsertModeAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionFirstScreenColumnAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionFirstNonSpaceAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionFirstScreenNonSpaceAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionLastColumnAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionLastColumnInsertAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionLastScreenColumnAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionLastMatchCharAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionLastMatchCharReverseAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionLastNonSpaceAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionLeftAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionLeftInsertModeAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionLeftWrapAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionLeftMatchCharAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionLeftTillMatchCharAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionMiddleColumnAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionRightAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionRightInsertAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionRightWrapAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionRightMatchCharAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionRightTillMatchCharAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionHomeAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionShiftHomeAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionEndAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionShiftEndAction"/>
|
||||||
|
<!-- Up/Down -->
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionDownAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionDownNotLineWiseAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionDownFirstNonSpaceAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.EnterNormalAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionDownLess1FirstNonSpaceAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionGotoLineFirstAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionGotoLineFirstInsertAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionGotoLineLastAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionGotoLineLastEndAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionGotoLineLastEndInsertAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionPercentOrMatchAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionUpAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionUpNotLineWiseAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionUpFirstNonSpaceAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionArrowDownAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionArrowUpAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionArrowLeftAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionArrowRightAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.window.LookupDownAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.window.LookupUpAction"/>
|
||||||
|
<!-- Text -->
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionCamelEndLeftAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionCamelEndRightAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionCamelLeftAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionCamelRightAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionNthCharacterAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionWordEndLeftAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionBigWordEndLeftAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionWordEndRightAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionBigWordEndRightAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionWordLeftAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionWordLeftInsertAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionBigWordLeftAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionWordRightAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionWordRightInsertAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionBigWordRightAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionSentenceNextStartAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionSentencePreviousStartAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionSentenceNextEndAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionSentencePreviousEndAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionParagraphNextAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionParagraphPreviousAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionUnmatchedBraceCloseAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionUnmatchedBraceOpenAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionUnmatchedParenCloseAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionUnmatchedParenOpenAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionSectionBackwardEndAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionSectionBackwardStartAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionSectionForwardEndAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionSectionForwardStartAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionMethodPreviousEndAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionMethodPreviousStartAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionMethodNextEndAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionMethodNextStartAction"/>
|
||||||
|
<!-- Text Objects -->
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionOuterWordAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionOuterBigWordAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionInnerWordAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionInnerBigWordAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockAngleAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockBraceAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockBracketAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockParenAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockDoubleQuoteAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockSingleQuoteAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockBackQuoteAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockTagAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockAngleAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockBraceAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockBracketAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockParenAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockDoubleQuoteAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockSingleQuoteAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockBackQuoteAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockTagAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionInnerParagraphAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionOuterParagraphAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionInnerSentenceAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionOuterSentenceAction"/>
|
||||||
|
<!-- Marks -->
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.mark.MotionMarkAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.mark.MotionGotoFileMarkAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.mark.MotionGotoFileMarkNoSaveJumpAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.mark.MotionGotoFileMarkLineAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.mark.MotionGotoFileMarkLineNoSaveJumpAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.mark.MotionGotoMarkAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.mark.MotionGotoMarkNoSaveJumpAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.mark.MotionGotoMarkLineAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.mark.MotionGotoMarkLineNoSaveJumpAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.mark.MotionJumpNextAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.mark.MotionJumpPreviousAction"/>
|
||||||
|
<!-- Screen -->
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.screen.MotionFirstScreenLineAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.screen.MotionLastScreenLineAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.screen.MotionMiddleScreenLineAction"/>
|
||||||
|
<!-- Scroll -->
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollFirstScreenLinePageStartAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollFirstScreenLineStartAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollFirstScreenLineAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollHalfPageDownAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollHalfPageUpAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollLastScreenLineAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollLastScreenLinePageStartAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollLastScreenLineStartAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollLineDownAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollLineUpAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollMiddleScreenLineAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollMiddleScreenLineStartAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollPageDownAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollPageDownInsertModeAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollPageUpAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollPageUpInsertModeAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollFirstScreenColumnAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollLastScreenColumnAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollColumnLeftAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollColumnRightAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionShiftDownAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionShiftUpAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionShiftRightAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionShiftLeftAction"/>
|
||||||
|
<!-- Visual -->
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.visual.VisualExitModeAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.visual.VisualToggleCharacterModeAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.visual.VisualToggleLineModeAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.visual.VisualToggleBlockModeAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.visual.VisualSwapEndsAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.visual.VisualSwapEndsBlockAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.visual.VisualSelectPreviousAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.visual.VisualSwapSelectionsAction"/>
|
||||||
|
|
||||||
|
<!-- Select-->
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.select.SelectEnableCharacterModeAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.select.SelectEnableLineModeAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.select.SelectEnableBlockModeAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.select.motion.SelectMotionRightAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.select.motion.SelectMotionLeftAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.select.SelectToggleVisualMode"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.select.SelectEnterAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.select.SelectEscapeAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.select.SelectDeleteAction"/>
|
||||||
|
|
||||||
|
<!-- Insert -->
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertAfterCursorAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertAfterLineEndAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertAtPreviousInsertAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertBeforeCursorAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertBeforeFirstNonBlankAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertCharacterAboveCursorAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertCharacterBelowCursorAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertDeleteInsertedTextAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertDeletePreviousWordAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertEnterAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertExitModeAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertLineStartAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertNewLineAboveAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertNewLineBelowAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertPreviousInsertAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertPreviousInsertExitAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertRegisterAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertInsertAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertSingleCommandAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.VisualBlockInsertAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.VisualBlockAppendAction"/>
|
||||||
|
|
||||||
|
<!-- Delete -->
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.delete.DeleteCharacterAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.delete.DeleteCharacterLeftAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.delete.DeleteCharacterRightAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.delete.DeleteEndOfLineAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.delete.DeleteJoinLinesAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.delete.DeleteJoinLinesSpacesAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.delete.DeleteJoinVisualLinesAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.delete.DeleteJoinVisualLinesSpacesAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.delete.DeleteLineAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.delete.DeleteMotionAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.delete.DeleteVisualAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.delete.DeleteVisualLinesAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.delete.DeleteVisualLinesEndAction"/>
|
||||||
|
|
||||||
|
<!-- Change -->
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeCaseLowerMotionAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeCaseLowerVisualAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeCaseToggleCharacterAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeCaseToggleMotionAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeCaseToggleVisualAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeCaseUpperMotionAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeCaseUpperVisualAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeCharacterAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeCharactersAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeEndOfLineAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeLineAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeMotionAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.number.ChangeNumberIncAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.number.ChangeNumberDecAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.number.ChangeVisualNumberIncAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.number.ChangeVisualNumberDecAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.number.ChangeVisualNumberAvalancheIncAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.number.ChangeVisualNumberAvalancheDecAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeReplaceAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeVisualAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeVisualCharacterAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeVisualLinesAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeVisualLinesEndAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.FilterMotionAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.FilterCountLinesAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.FilterVisualLinesAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.AutoIndentLinesVisualAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ReformatCodeVisualAction"/>
|
||||||
|
|
||||||
|
<!-- Shift -->
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.shift.AutoIndentLinesAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.shift.AutoIndentMotionAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.shift.ShiftLeftLinesAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.shift.ShiftLeftLinesNormalModeAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.shift.ShiftLeftMotionAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.shift.ShiftLeftVisualAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.shift.ShiftRightLinesAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.shift.ShiftRightLinesNormalModeAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.shift.ShiftRightMotionAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.shift.ShiftRightVisualAction"/>
|
||||||
|
|
||||||
|
<!-- Copy -->
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.copy.PutTextAfterCursorAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.copy.PutTextBeforeCursorAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.copy.PutTextAfterCursorNoIndentAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.copy.PutTextBeforeCursorNoIndentAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.copy.PutTextAfterCursorActionMoveCursor"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.copy.PutTextBeforeCursorActionMoveCursor"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.copy.SelectRegisterAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.copy.YankLineAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.copy.YankLineMidCountAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.copy.YankMotionAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.copy.YankVisualAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.copy.YankVisualLinesAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.copy.PutVisualTextAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.copy.PutVisualTextNoIndentAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.copy.PutVisualTextMoveCursorAction"/>
|
||||||
|
|
||||||
|
<!-- File -->
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.file.FileSaveCloseAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.file.FilePreviousAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.file.FileGetAsciiAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.file.FileGetHexAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.file.FileGetFileInfoAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.file.FileGetLocationInfoAction"/>
|
||||||
|
|
||||||
|
<!-- Window -->
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.window.VerticalSplitAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.window.HorizontalSplitAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.window.CloseWindowAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.window.WindowOnlyAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.window.WindowNextAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.window.WindowPrevAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.window.WindowLeftAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.window.WindowRightAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.window.WindowUpAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.window.WindowDownAction"/>
|
||||||
|
|
||||||
|
<!-- Search -->
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.search.SearchEntryFwdAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.search.SearchEntryRevAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.search.SearchAgainNextAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.search.SearchAgainPreviousAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.search.SearchWholeWordForwardAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.search.SearchWholeWordBackwardAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.search.SearchWordForwardAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.search.SearchWordBackwardAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.search.GotoDeclarationAction"/>
|
||||||
|
|
||||||
|
<!-- Macro -->
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.macro.ToggleRecordingAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.macro.PlaybackRegisterAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.macro.PlaybackLastRegisterAction"/>
|
||||||
|
|
||||||
|
<!-- Command Line -->
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.ex.ProcessExEntryAction"/>
|
||||||
|
|
||||||
|
<!-- Other -->
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeLastSearchReplaceAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeLastGlobalSearchReplaceAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.RepeatChangeAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.RepeatExCommandAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.ExEntryAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.ResetModeAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.RedoAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.UndoAction"/>
|
||||||
|
|
||||||
|
<!-- Keys -->
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.change.OperatorAction"/>
|
||||||
|
|
||||||
|
<!-- Visual Selection of last Search Pattern (gn) -->
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.gn.VisualSelectNextSearch"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.gn.VisualSelectPreviousSearch"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.gn.GnNextTextObject"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.gn.GnPreviousTextObject"/>
|
||||||
|
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.CtrlDownAction"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.CtrlUpAction"/>
|
||||||
|
|
||||||
|
<!-- Folds -->
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.fold.VimCollapseAllRegions"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.fold.VimCollapseRegion"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.fold.VimCollapseRegionRecursively"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.fold.VimExpandAllRegions"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.fold.VimExpandRegion"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.fold.VimExpandRegionRecursively"/>
|
||||||
|
|
||||||
|
<!-- Editor Actions -->
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.editor.VimEditorBackSpace"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.editor.VimEditorDelete"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.editor.VimEditorDown"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.editor.VimEditorTab"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.editor.VimEditorUp"/>
|
||||||
|
<vimAction implementation="com.maddyhome.idea.vim.action.editor.VimQuickJavaDoc"/>
|
||||||
|
|
||||||
|
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.ActionListHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.AsciiHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.CmdFilterHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.CmdHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.CmdClearHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.CopyTextHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.DelCmdHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.DeleteLinesHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.DeleteMarksHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.DigraphHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.DumpLineHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.EditFileHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.ActionHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.EchoHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.ExitHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.FindClassHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.FindFileHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.FindSymbolHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.GotoCharacterHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.HelpHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.HistoryHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.JoinLinesHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.JumpsHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.LetHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.MapHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.MarkHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.MarksHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.MoveTextHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.NextFileHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.NoHLSearchHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.OnlyHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.PreviousFileHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.PromptFindHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.PromptReplaceHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.PutLinesHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.QuitHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.RedoHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.RegistersHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.RepeatHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.SelectFileHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.SelectFirstFileHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.SelectLastFileHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.SetHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.ShiftLeftHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.ShiftRightHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.SourceHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.SortHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.SplitHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.SubstituteHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.UndoHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.WriteAllHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.WriteHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.WriteNextFileHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.WritePreviousFileHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.WriteQuitHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.YankLinesHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.ShellHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.NextTabHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.PreviousTabHandler"/>
|
||||||
|
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.TabOnlyHandler"/>
|
||||||
|
|
||||||
</extensions>
|
</extensions>
|
||||||
|
|
||||||
<actions>
|
<actions>
|
||||||
<action id="VimPluginToggle" class="com.maddyhome.idea.vim.action.VimPluginToggleAction" text="Vim Emulator" description="Toggle the Vim Plugin On/Off">
|
<action id="VimPluginToggle" class="com.maddyhome.idea.vim.action.VimPluginToggleAction" text="Vim Emulator" description="Toggle the vim plugin On/off">
|
||||||
<keyboard-shortcut first-keystroke="control alt V" keymap="$default"/>
|
<keyboard-shortcut first-keystroke="control alt V" keymap="$default"/>
|
||||||
<add-to-group group-id="ToolsMenu" anchor="last"/>
|
<add-to-group group-id="ToolsMenu" anchor="last"/>
|
||||||
</action>
|
</action>
|
||||||
|
|
||||||
<!-- Motions -->
|
|
||||||
<action id="VimMotionPreviousTab" class="com.maddyhome.idea.vim.action.motion.tabs.MotionPreviousTabAction" text="Move to Previous Tab"/>
|
|
||||||
<action id="VimMotionNextTab" class="com.maddyhome.idea.vim.action.motion.tabs.MotionNextTabAction" text="Move to Next Tab"/>
|
|
||||||
<!-- Left/Right -->
|
|
||||||
<action id="VimMotionColumn" class="com.maddyhome.idea.vim.action.motion.leftright.MotionColumnAction" text="Move to Column"/>
|
|
||||||
<action id="VimMotionFirstColumn" class="com.maddyhome.idea.vim.action.motion.leftright.MotionFirstColumnAction" text="Start of Line"/>
|
|
||||||
<action id="VimMotionFirstColumnInsertMode" class="com.maddyhome.idea.vim.action.motion.leftright.MotionFirstColumnInsertModeAction" text="Start of Line"/>
|
|
||||||
<action id="VimMotionFirstScreenColumn" class="com.maddyhome.idea.vim.action.motion.leftright.MotionFirstScreenColumnAction" text="Start of Screen Line"/>
|
|
||||||
<action id="VimMotionFirstNonSpace" class="com.maddyhome.idea.vim.action.motion.leftright.MotionFirstNonSpaceAction" text="First Character of Line"/>
|
|
||||||
<action id="VimMotionFirstScreenNonSpace" class="com.maddyhome.idea.vim.action.motion.leftright.MotionFirstScreenNonSpaceAction" text="First Character of Screen Line"/>
|
|
||||||
<action id="VimMotionLastColumn" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLastColumnAction" text="End of Line"/>
|
|
||||||
<action id="VimMotionLastColumnInsert" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLastColumnInsertAction" text="End of Line"/>
|
|
||||||
<action id="VimMotionLastScreenColumn" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLastScreenColumnAction" text="End of Screen Line"/>
|
|
||||||
<action id="VimMotionLastMatchChar" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLastMatchCharAction" text="Repeat Last Character Match"/>
|
|
||||||
<action id="VimMotionLastMatchCharReverse" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLastMatchCharReverseAction" text="Repeat Last Character Match in Reverse"/>
|
|
||||||
<action id="VimMotionLastNonSpace" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLastNonSpaceAction" text="Last Character of Line"/>
|
|
||||||
<action id="VimMotionLeft" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLeftAction" text="Left"/>
|
|
||||||
<action id="VimMotionLeftInsert" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLeftInsertModeAction" text="Left"/>
|
|
||||||
<action id="VimMotionLeftWrap" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLeftWrapAction" text="Left"/>
|
|
||||||
<action id="VimMotionLeftMatchChar" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLeftMatchCharAction" text="Move Left to Character"/>
|
|
||||||
<action id="VimMotionLeftTillMatchChar" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLeftTillMatchCharAction" text="Move Left till Character"/>
|
|
||||||
<action id="VimMotionMiddleColumn" class="com.maddyhome.idea.vim.action.motion.leftright.MotionMiddleColumnAction" text="Middle of Screen"/>
|
|
||||||
<action id="VimMotionRight" class="com.maddyhome.idea.vim.action.motion.leftright.MotionRightAction" text="Right"/>
|
|
||||||
<action id="VimMotionRightInsert" class="com.maddyhome.idea.vim.action.motion.leftright.MotionRightInsertAction" text="Right"/>
|
|
||||||
<action id="VimMotionRightWrap" class="com.maddyhome.idea.vim.action.motion.leftright.MotionRightWrapAction" text="Right"/>
|
|
||||||
<action id="VimMotionRightMatchChar" class="com.maddyhome.idea.vim.action.motion.leftright.MotionRightMatchCharAction" text="Move Right to Character"/>
|
|
||||||
<action id="VimMotionRightTillMatchChar" class="com.maddyhome.idea.vim.action.motion.leftright.MotionRightTillMatchCharAction" text="Move Right till Character"/>
|
|
||||||
<action id="VimMotionHome" class="com.maddyhome.idea.vim.action.motion.leftright.MotionHomeAction" text="Move Home Key"/>
|
|
||||||
<action id="VimMotionShiftHome" class="com.maddyhome.idea.vim.action.motion.leftright.MotionShiftHomeAction" text="Move Shift Home"/>
|
|
||||||
<action id="VimMotionEnd" class="com.maddyhome.idea.vim.action.motion.leftright.MotionEndAction" text="Move End Key"/>
|
|
||||||
<action id="VimMotionShiftEnd" class="com.maddyhome.idea.vim.action.motion.leftright.MotionShiftEndAction" text="Move Shift End Key"/>
|
|
||||||
<!-- Up/Down -->
|
|
||||||
<action id="VimMotionDown" class="com.maddyhome.idea.vim.action.motion.updown.MotionDownAction" text="Down"/>
|
|
||||||
<action id="VimMotionNotLineWiseDown" class="com.maddyhome.idea.vim.action.motion.updown.MotionDownNotLineWiseAction" text="Down"/>
|
|
||||||
<action id="VimMotionDownFirstNonSpace" class="com.maddyhome.idea.vim.action.motion.updown.MotionDownFirstNonSpaceAction" text="Down to First non-Space"/>
|
|
||||||
<action id="VimEnterNormalAction" class="com.maddyhome.idea.vim.action.motion.updown.EnterNormalAction" text="Down to First non-Space"/>
|
|
||||||
<action id="VimMotionDownLess1FirstNonSpace" class="com.maddyhome.idea.vim.action.motion.updown.MotionDownLess1FirstNonSpaceAction" text="Down to First non-Space"/>
|
|
||||||
<action id="VimMotionGotoLineFirst" class="com.maddyhome.idea.vim.action.motion.updown.MotionGotoLineFirstAction" text="Goto Line"/>
|
|
||||||
<action id="VimMotionGotoLineFirstInsertMode" class="com.maddyhome.idea.vim.action.motion.updown.MotionGotoLineFirstInsertAction" text="Goto Line"/>
|
|
||||||
<action id="VimMotionGotoLineLast" class="com.maddyhome.idea.vim.action.motion.updown.MotionGotoLineLastAction" text="Goto Line"/>
|
|
||||||
<action id="VimMotionGotoLineLastEnd" class="com.maddyhome.idea.vim.action.motion.updown.MotionGotoLineLastEndAction" text="Goto Line End"/>
|
|
||||||
<action id="VimMotionGotoLineLastEndInsert" class="com.maddyhome.idea.vim.action.motion.updown.MotionGotoLineLastEndInsertAction" text="Goto Line End"/>
|
|
||||||
<action id="VimMotionPercentOrMatch" class="com.maddyhome.idea.vim.action.motion.updown.MotionPercentOrMatchAction" text="Percent Down or Match"/>
|
|
||||||
<action id="VimMotionUp" class="com.maddyhome.idea.vim.action.motion.updown.MotionUpAction" text="Up"/>
|
|
||||||
<action id="VimMotionUpNotLineWise" class="com.maddyhome.idea.vim.action.motion.updown.MotionUpNotLineWiseAction" text="Up"/>
|
|
||||||
<action id="VimMotionUpFirstNonSpace" class="com.maddyhome.idea.vim.action.motion.updown.MotionUpFirstNonSpaceAction" text="Up to First non-Space"/>
|
|
||||||
<action id="VimArrowMotionDown" class="com.maddyhome.idea.vim.action.motion.updown.MotionArrowDownAction" text="Arrow Down"/>
|
|
||||||
<action id="VimArrowMotionUp" class="com.maddyhome.idea.vim.action.motion.updown.MotionArrowUpAction" text="Arrow Up"/>
|
|
||||||
<action id="VimArrowMotionLeft" class="com.maddyhome.idea.vim.action.motion.leftright.MotionArrowLeftAction" text="Arrow Left"/>
|
|
||||||
<action id="VimArrowMotionRight" class="com.maddyhome.idea.vim.action.motion.leftright.MotionArrowRightAction" text="Arrow Right"/>
|
|
||||||
<action id="VimLookupDown" class="com.maddyhome.idea.vim.action.window.LookupDownAction" text="Down"/>
|
|
||||||
<action id="VimLookupUp" class="com.maddyhome.idea.vim.action.window.LookupUpAction" text="Up"/>
|
|
||||||
<!-- Text -->
|
|
||||||
<action id="VimMotionCamelEndLeft" class="com.maddyhome.idea.vim.action.motion.text.MotionCamelEndLeftAction" text="Camel Word End Left"/>
|
|
||||||
<action id="VimMotionCamelEndRight" class="com.maddyhome.idea.vim.action.motion.text.MotionCamelEndRightAction" text="Camel Word End Right"/>
|
|
||||||
<action id="VimMotionCamelLeft" class="com.maddyhome.idea.vim.action.motion.text.MotionCamelLeftAction" text="Camel Word Left"/>
|
|
||||||
<action id="VimMotionCamelRight" class="com.maddyhome.idea.vim.action.motion.text.MotionCamelRightAction" text="Camel Word Right"/>
|
|
||||||
<action id="VimMotionNthCharacter" class="com.maddyhome.idea.vim.action.motion.text.MotionNthCharacterAction" text="Nth Character"/>
|
|
||||||
<action id="VimMotionWordEndLeft" class="com.maddyhome.idea.vim.action.motion.text.MotionWordEndLeftAction" text="Word End Left"/>
|
|
||||||
<action id="VimMotionBigWordEndLeft" class="com.maddyhome.idea.vim.action.motion.text.MotionBigWordEndLeftAction" text="BigWord End Left"/>
|
|
||||||
<action id="VimMotionWordEndRight" class="com.maddyhome.idea.vim.action.motion.text.MotionWordEndRightAction" text="Word End Right"/>
|
|
||||||
<action id="VimMotionBigWordEndRight" class="com.maddyhome.idea.vim.action.motion.text.MotionBigWordEndRightAction" text="BigWord End Right"/>
|
|
||||||
<action id="VimMotionWordLeft" class="com.maddyhome.idea.vim.action.motion.text.MotionWordLeftAction" text="Word Left"/>
|
|
||||||
<action id="VimMotionWordLeftInsert" class="com.maddyhome.idea.vim.action.motion.text.MotionWordLeftInsertAction" text="Word Left"/>
|
|
||||||
<action id="VimMotionBigWordLeft" class="com.maddyhome.idea.vim.action.motion.text.MotionBigWordLeftAction" text="BigWord Left"/>
|
|
||||||
<action id="VimMotionWordRight" class="com.maddyhome.idea.vim.action.motion.text.MotionWordRightAction" text="Word Right"/>
|
|
||||||
<action id="VimMotionWordRightInsert" class="com.maddyhome.idea.vim.action.motion.text.MotionWordRightInsertAction" text="Word Right"/>
|
|
||||||
<action id="VimMotionBigWordRight" class="com.maddyhome.idea.vim.action.motion.text.MotionBigWordRightAction" text="BigWord Right"/>
|
|
||||||
<action id="VimMotionSentenceStartNext" class="com.maddyhome.idea.vim.action.motion.text.MotionSentenceNextStartAction" text="Next Sentence Start"/>
|
|
||||||
<action id="VimMotionSentenceStartPrevious" class="com.maddyhome.idea.vim.action.motion.text.MotionSentencePreviousStartAction" text="Previous Sentence Start"/>
|
|
||||||
<action id="VimMotionSentenceEndNext" class="com.maddyhome.idea.vim.action.motion.text.MotionSentenceNextEndAction" text="Next Sentence End"/>
|
|
||||||
<action id="VimMotionSentenceEndPrevious" class="com.maddyhome.idea.vim.action.motion.text.MotionSentencePreviousEndAction" text="Previous Sentence End"/>
|
|
||||||
<action id="VimMotionParagraphNext" class="com.maddyhome.idea.vim.action.motion.text.MotionParagraphNextAction" text="Next Paragraph"/>
|
|
||||||
<action id="VimMotionParagraphPrevious" class="com.maddyhome.idea.vim.action.motion.text.MotionParagraphPreviousAction" text="Previous Paragraph"/>
|
|
||||||
<action id="VimMotionUnmatchedBraceClose" class="com.maddyhome.idea.vim.action.motion.text.MotionUnmatchedBraceCloseAction" text="Unmatched }"/>
|
|
||||||
<action id="VimMotionUnmatchedBraceOpen" class="com.maddyhome.idea.vim.action.motion.text.MotionUnmatchedBraceOpenAction" text="Unmatched {"/>
|
|
||||||
<action id="VimMotionUnmatchedParenClose" class="com.maddyhome.idea.vim.action.motion.text.MotionUnmatchedParenCloseAction" text="Unmatched )"/>
|
|
||||||
<action id="VimMotionUnmatchedParenOpen" class="com.maddyhome.idea.vim.action.motion.text.MotionUnmatchedParenOpenAction" text="Unmatched ("/>
|
|
||||||
<action id="VimMotionSectionBackwardEnd" class="com.maddyhome.idea.vim.action.motion.text.MotionSectionBackwardEndAction" text="Section End Backward"/>
|
|
||||||
<action id="VimMotionSectionBackwardStart" class="com.maddyhome.idea.vim.action.motion.text.MotionSectionBackwardStartAction" text="Section Start Backward"/>
|
|
||||||
<action id="VimMotionSectionForwardEnd" class="com.maddyhome.idea.vim.action.motion.text.MotionSectionForwardEndAction" text="Section End Forward"/>
|
|
||||||
<action id="VimMotionSectionForwardStart" class="com.maddyhome.idea.vim.action.motion.text.MotionSectionForwardStartAction" text="Section Start Forward"/>
|
|
||||||
<action id="VimMotionMethodBackwardEnd" class="com.maddyhome.idea.vim.action.motion.text.MotionMethodPreviousEndAction" text="Previous Method End"/>
|
|
||||||
<action id="VimMotionMethodBackwardStart" class="com.maddyhome.idea.vim.action.motion.text.MotionMethodPreviousStartAction" text="Previous Method Start"/>
|
|
||||||
<action id="VimMotionMethodForwardEnd" class="com.maddyhome.idea.vim.action.motion.text.MotionMethodNextEndAction" text="Next Method End"/>
|
|
||||||
<action id="VimMotionMethodForwardStart" class="com.maddyhome.idea.vim.action.motion.text.MotionMethodNextStartAction" text="Next Method Start"/>
|
|
||||||
<!-- Text Objects -->
|
|
||||||
<action id="VimMotionTextOuterWord" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterWordAction" text="Select outer word"/>
|
|
||||||
<action id="VimMotionTextOuterBigWord" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterBigWordAction" text="Select outer WORD"/>
|
|
||||||
<action id="VimMotionTextInnerWord" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerWordAction" text="Select inner word"/>
|
|
||||||
<action id="VimMotionTextInnerBigWord" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerBigWordAction" text="Select inner WORD"/>
|
|
||||||
<action id="VimMotionInnerBlockAngle" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockAngleAction" text="Select inner < block"/>
|
|
||||||
<action id="VimMotionInnerBlockBrace" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockBraceAction" text="Select inner { block"/>
|
|
||||||
<action id="VimMotionInnerBlockBracket" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockBracketAction" text="Select inner [ block"/>
|
|
||||||
<action id="VimMotionInnerBlockParen" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockParenAction" text="Select inner ( block"/>
|
|
||||||
<action id="VimMotionInnerBlockDoubleQuote" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockDoubleQuoteAction" text="Select inner double quote block"/>
|
|
||||||
<action id="VimMotionInnerBlockSingleQuote" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockSingleQuoteAction" text="Select inner single quote block"/>
|
|
||||||
<action id="VimMotionInnerBlockBackQuote" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockBackQuoteAction" text="Select inner back quote block"/>
|
|
||||||
<action id="VimMotionInnerBlockTag" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockTagAction" text="Select inner >< block >/<"/>
|
|
||||||
<action id="VimMotionOuterBlockAngle" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockAngleAction" text="Select outer < block"/>
|
|
||||||
<action id="VimMotionOuterBlockBrace" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockBraceAction" text="Select outer { block"/>
|
|
||||||
<action id="VimMotionOuterBlockBracket" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockBracketAction" text="Select outer [ block"/>
|
|
||||||
<action id="VimMotionOuterBlockParen" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockParenAction" text="Select outer ( block"/>
|
|
||||||
<action id="VimMotionOuterBlockDoubleQuote" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockDoubleQuoteAction" text="Select outer double quote block"/>
|
|
||||||
<action id="VimMotionOuterBlockSingleQuote" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockSingleQuoteAction" text="Select outer single quote block"/>
|
|
||||||
<action id="VimMotionOuterBlockBackQuote" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockBackQuoteAction" text="Select outer back quote block"/>
|
|
||||||
<action id="VimMotionOuterBlockTag" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockTagAction" text="Select outer >< block >/<"/>
|
|
||||||
<action id="VimMotionInnerParagraph" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerParagraphAction" text="Select Inner Paragraph"/>
|
|
||||||
<action id="VimMotionOuterParagraph" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterParagraphAction" text="Select Outer Paragraph"/>
|
|
||||||
<action id="VimMotionInnerSentence" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerSentenceAction" text="Select Inner Sentence"/>
|
|
||||||
<action id="VimMotionOuterSentence" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterSentenceAction" text="Select Outer Sentence"/>
|
|
||||||
<!-- Marks -->
|
|
||||||
<action id="VimMotionMark" class="com.maddyhome.idea.vim.action.motion.mark.MotionMarkAction" text="Mark"/>
|
|
||||||
<action id="VimMotionGotoFileMark" class="com.maddyhome.idea.vim.action.motion.mark.MotionGotoFileMarkAction" text="Goto Mark"/>
|
|
||||||
<action id="VimMotionGotoFileMarkNoSaveJump" class="com.maddyhome.idea.vim.action.motion.mark.MotionGotoFileMarkNoSaveJumpAction" text="Goto Mark"/>
|
|
||||||
<action id="VimMotionGotoFileMarkLine" class="com.maddyhome.idea.vim.action.motion.mark.MotionGotoFileMarkLineAction" text="Goto Mark Line"/>
|
|
||||||
<action id="VimMotionGotoFileMarkLineNoSaveJumo" class="com.maddyhome.idea.vim.action.motion.mark.MotionGotoFileMarkLineNoSaveJumpAction" text="Goto Mark Line"/>
|
|
||||||
<action id="VimMotionGotoMark" class="com.maddyhome.idea.vim.action.motion.mark.MotionGotoMarkAction" text="Goto Mark"/>
|
|
||||||
<action id="VimMotionGotoMarkNoSaveJump" class="com.maddyhome.idea.vim.action.motion.mark.MotionGotoMarkNoSaveJumpAction" text="Goto Mark"/>
|
|
||||||
<action id="VimMotionGotoMarkLine" class="com.maddyhome.idea.vim.action.motion.mark.MotionGotoMarkLineAction" text="Goto Mark Line"/>
|
|
||||||
<action id="VimMotionGotoMarkLineNoSaveJump" class="com.maddyhome.idea.vim.action.motion.mark.MotionGotoMarkLineNoSaveJumpAction" text="Goto Mark Line"/>
|
|
||||||
<action id="VimMotionJumpNext" class="com.maddyhome.idea.vim.action.motion.mark.MotionJumpNextAction" text="Goto Next Jump"/>
|
|
||||||
<action id="VimMotionJumpPrevious" class="com.maddyhome.idea.vim.action.motion.mark.MotionJumpPreviousAction" text="Goto Previous Jump"/>
|
|
||||||
<!-- Screen -->
|
|
||||||
<action id="VimMotionFirstScreenLine" class="com.maddyhome.idea.vim.action.motion.screen.MotionFirstScreenLineAction" text="First Screen Line"/>
|
|
||||||
<action id="VimMotionLastScreenLine" class="com.maddyhome.idea.vim.action.motion.screen.MotionLastScreenLineAction" text="Last Screen Line"/>
|
|
||||||
<action id="VimMotionMiddleScreenLine" class="com.maddyhome.idea.vim.action.motion.screen.MotionMiddleScreenLineAction" text="Middle Screen Line"/>
|
|
||||||
<!-- Scroll -->
|
|
||||||
<action id="VimMotionScrollFirstScreenLinePageStart" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollFirstScreenLinePageStartAction" text="Scroll Line to Top"/>
|
|
||||||
<action id="VimMotionScrollFirstScreenLineStart" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollFirstScreenLineStartAction" text="Scroll Line to Top"/>
|
|
||||||
<action id="VimMotionScrollFirstScreenLine" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollFirstScreenLineAction" text="Scroll Line to Top"/>
|
|
||||||
<action id="VimMotionScrollHalfPageDown" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollHalfPageDownAction" text="Scroll Half Page Down"/>
|
|
||||||
<action id="VimMotionScrollHalfPageUp" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollHalfPageUpAction" text="Scroll Half Page Up"/>
|
|
||||||
<action id="VimMotionScrollLastScreenLine" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollLastScreenLineAction" text="Scroll Line to Bottom"/>
|
|
||||||
<action id="VimMotionScrollLastScreenLinePageStart" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollLastScreenLinePageStartAction" text="Scroll Line to Bottom"/>
|
|
||||||
<action id="VimMotionScrollLastScreenLineStart" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollLastScreenLineStartAction" text="Scroll Line to Bottom"/>
|
|
||||||
<action id="VimMotionScrollLineDown" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollLineDownAction" text="Scroll Line Down"/>
|
|
||||||
<action id="VimMotionScrollLineUp" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollLineUpAction" text="Scroll Line Up"/>
|
|
||||||
<action id="VimMotionScrollMiddleScreenLine" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollMiddleScreenLineAction" text="Scroll Line to Middle"/>
|
|
||||||
<action id="VimMotionScrollMiddleScreenLineStart" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollMiddleScreenLineStartAction" text="Scroll Line to Middle"/>
|
|
||||||
<action id="VimMotionScrollPageDown" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollPageDownAction" text="Scroll Page Down"/>
|
|
||||||
<action id="VimMotionScrollPageDownInsertMode" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollPageDownInsertModeAction" text="Scroll Page Down"/>
|
|
||||||
<action id="VimMotionScrollPageUp" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollPageUpAction" text="Scroll Page Up"/>
|
|
||||||
<action id="VimMotionScrollPageUpInsertMode" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollPageUpInsertModeAction" text="Scroll Page Up"/>
|
|
||||||
<action id="VimMotionScrollFirstScreenColumn" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollFirstScreenColumnAction" text="Scroll Column to first column"/>
|
|
||||||
<action id="VimMotionScrollLastScreenColumn" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollLastScreenColumnAction" text="Scroll Column to last column"/>
|
|
||||||
<action id="VimMotionScrollColumnLeft" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollColumnLeftAction" text="Scroll Column Left"/>
|
|
||||||
<action id="VimMotionScrollColumnRight" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollColumnRightAction" text="Scroll Column Right"/>
|
|
||||||
<action id="VimMotionShiftDown" class="com.maddyhome.idea.vim.action.motion.updown.MotionShiftDownAction" text="Shift Down"/>
|
|
||||||
<action id="VimMotionShiftUp" class="com.maddyhome.idea.vim.action.motion.updown.MotionShiftUpAction" text="Shift Up"/>
|
|
||||||
<action id="VimMotionShiftRight" class="com.maddyhome.idea.vim.action.motion.leftright.MotionShiftRightAction" text="Shift Right"/>
|
|
||||||
<action id="VimMotionShiftLeft" class="com.maddyhome.idea.vim.action.motion.leftright.MotionShiftLeftAction" text="Shift Left"/>
|
|
||||||
<!-- Visual -->
|
|
||||||
<action id="VimVisualExitMode" class="com.maddyhome.idea.vim.action.motion.visual.VisualExitModeAction" text="Exit Visual Mode"/>
|
|
||||||
<action id="VimVisualToggleCharacterMode" class="com.maddyhome.idea.vim.action.motion.visual.VisualToggleCharacterModeAction" text="Toggle Character Selection"/>
|
|
||||||
<action id="VimVisualToggleLineMode" class="com.maddyhome.idea.vim.action.motion.visual.VisualToggleLineModeAction" text="Toggle Line Selection"/>
|
|
||||||
<action id="VimVisualToggleBlockMode" class="com.maddyhome.idea.vim.action.motion.visual.VisualToggleBlockModeAction" text="Toggle Block Selection"/>
|
|
||||||
<action id="VimVisualSwapEnds" class="com.maddyhome.idea.vim.action.motion.visual.VisualSwapEndsAction" text="Swap Visual Selection Ends"/>
|
|
||||||
<action id="VimVisualSwapEndsBlock" class="com.maddyhome.idea.vim.action.motion.visual.VisualSwapEndsBlockAction" text="Swap Visual Selection Ends"/>
|
|
||||||
<action id="VimVisualSelectPrevious" class="com.maddyhome.idea.vim.action.motion.visual.VisualSelectPreviousAction" text="Visual Select Previous"/>
|
|
||||||
<action id="VimVisualSwapSelections" class="com.maddyhome.idea.vim.action.motion.visual.VisualSwapSelectionsAction" text="Swap Visual Selection Ends"/>
|
|
||||||
|
|
||||||
<!-- Select-->
|
|
||||||
<action id="VimSelectEnableCharacterMode"
|
|
||||||
class="com.maddyhome.idea.vim.action.motion.select.SelectEnableCharacterModeAction"
|
|
||||||
text="Enter Character Select Mode"/>
|
|
||||||
<action id="VimSelectEnableLineMode" class="com.maddyhome.idea.vim.action.motion.select.SelectEnableLineModeAction"
|
|
||||||
text="Enter Line Select Mode"/>
|
|
||||||
<action id="VimSelectEnableBlockMode"
|
|
||||||
class="com.maddyhome.idea.vim.action.motion.select.SelectEnableBlockModeAction"
|
|
||||||
text="Enter Block Select Mode"/>
|
|
||||||
<action id="VimSelectMotionRight" class="com.maddyhome.idea.vim.action.motion.select.motion.SelectMotionRightAction"
|
|
||||||
text="Move Right Select Mode"/>
|
|
||||||
<action id="VimSelectMotionLeft" class="com.maddyhome.idea.vim.action.motion.select.motion.SelectMotionLeftAction"
|
|
||||||
text="Move Left Select Mode"/>
|
|
||||||
<action id="VimToggleVisual" class="com.maddyhome.idea.vim.action.motion.select.SelectToggleVisualMode"
|
|
||||||
text="Toggle Select/Visual mode"/>
|
|
||||||
<action id="VimSelectInsert" class="com.maddyhome.idea.vim.action.motion.select.SelectEnterAction"
|
|
||||||
text="Select Enter Action"/>
|
|
||||||
<action id="VimEscapeSelect" class="com.maddyhome.idea.vim.action.motion.select.SelectEscapeAction"
|
|
||||||
text="Select Escape Action"/>
|
|
||||||
<action id="VimDeleteAction" class="com.maddyhome.idea.vim.action.motion.select.SelectDeleteAction"
|
|
||||||
text="Select Delete Action"/>
|
|
||||||
|
|
||||||
<!-- Insert -->
|
|
||||||
<action id="VimInsertAfterCursor" class="com.maddyhome.idea.vim.action.change.insert.InsertAfterCursorAction" text="Insert After Cursor"/>
|
|
||||||
<action id="VimInsertAfterLineEnd" class="com.maddyhome.idea.vim.action.change.insert.InsertAfterLineEndAction" text="Insert After Line End"/>
|
|
||||||
<action id="VimInsertAtPreviousInsert" class="com.maddyhome.idea.vim.action.change.insert.InsertAtPreviousInsertAction" text="Insert Before Cursor"/>
|
|
||||||
<action id="VimInsertBeforeCursor" class="com.maddyhome.idea.vim.action.change.insert.InsertBeforeCursorAction" text="Insert Before Cursor"/>
|
|
||||||
<action id="VimInsertBeforeFirstNonBlank" class="com.maddyhome.idea.vim.action.change.insert.InsertBeforeFirstNonBlankAction" text="Insert Before First non-Blank"/>
|
|
||||||
<action id="VimInsertCharacterAboveCursor" class="com.maddyhome.idea.vim.action.change.insert.InsertCharacterAboveCursorAction" text="Insert Character Above Cursor"/>
|
|
||||||
<action id="VimInsertCharacterBelowCursor" class="com.maddyhome.idea.vim.action.change.insert.InsertCharacterBelowCursorAction" text="Insert Character Below Cursor"/>
|
|
||||||
<action id="VimInsertDeleteInsertedText" class="com.maddyhome.idea.vim.action.change.insert.InsertDeleteInsertedTextAction" text="Delete Inserted Text"/>
|
|
||||||
<action id="VimInsertDeletePreviousWord" class="com.maddyhome.idea.vim.action.change.insert.InsertDeletePreviousWordAction" text="Delete Previous Word"/>
|
|
||||||
<action id="VimInsertEnter" class="com.maddyhome.idea.vim.action.change.insert.InsertEnterAction" text="Enter"/>
|
|
||||||
<action id="VimInsertExitMode" class="com.maddyhome.idea.vim.action.change.insert.InsertExitModeAction" text="Exit Insert Mode"/>
|
|
||||||
<action id="VimInsertLineStart" class="com.maddyhome.idea.vim.action.change.insert.InsertLineStartAction" text="Insert at Line Start"/>
|
|
||||||
<action id="VimInsertNewLineAbove" class="com.maddyhome.idea.vim.action.change.insert.InsertNewLineAboveAction" text="Insert New Line Above"/>
|
|
||||||
<action id="VimInsertNewLineBelow" class="com.maddyhome.idea.vim.action.change.insert.InsertNewLineBelowAction" text="Insert New Line Below"/>
|
|
||||||
<action id="VimInsertPreviousInsert" class="com.maddyhome.idea.vim.action.change.insert.InsertPreviousInsertAction" text="Insert Previous Text"/>
|
|
||||||
<action id="VimInsertPreviousInsertExit" class="com.maddyhome.idea.vim.action.change.insert.InsertPreviousInsertExitAction" text="Insert Previous Text"/>
|
|
||||||
<action id="VimInsertRegister" class="com.maddyhome.idea.vim.action.change.insert.InsertRegisterAction" text="Insert Register"/>
|
|
||||||
<action id="VimInsertReplaceToggle" class="com.maddyhome.idea.vim.action.change.insert.InsertInsertAction" text="Toggle Insert/Replace"/>
|
|
||||||
<action id="VimInsertSingleCommand" class="com.maddyhome.idea.vim.action.change.insert.InsertSingleCommandAction" text="Execute Command"/>
|
|
||||||
<action id="VimVisualBlockInsert" class="com.maddyhome.idea.vim.action.change.insert.VisualBlockInsertAction" text="Visual Block Insert"/>
|
|
||||||
<action id="VimVisualBlockAppend" class="com.maddyhome.idea.vim.action.change.insert.VisualBlockAppendAction" text="Visual Block Append"/>
|
|
||||||
|
|
||||||
<!-- Delete -->
|
|
||||||
<action id="VimDeleteCharacter" class="com.maddyhome.idea.vim.action.change.delete.DeleteCharacterAction" text="Delete Character"/>
|
|
||||||
<action id="VimDeleteCharacterLeft" class="com.maddyhome.idea.vim.action.change.delete.DeleteCharacterLeftAction" text="Delete Character Left"/>
|
|
||||||
<action id="VimDeleteCharacterRight" class="com.maddyhome.idea.vim.action.change.delete.DeleteCharacterRightAction" text="Delete Character Right"/>
|
|
||||||
<action id="VimDeleteEndOfLine" class="com.maddyhome.idea.vim.action.change.delete.DeleteEndOfLineAction" text="Delete End-of-Line"/>
|
|
||||||
<action id="VimDeleteJoinLines" class="com.maddyhome.idea.vim.action.change.delete.DeleteJoinLinesAction" text="Delete Join Lines"/>
|
|
||||||
<action id="VimDeleteJoinLinesSpaces" class="com.maddyhome.idea.vim.action.change.delete.DeleteJoinLinesSpacesAction" text="Delete Join Lines"/>
|
|
||||||
<action id="VimDeleteJoinVisualLines" class="com.maddyhome.idea.vim.action.change.delete.DeleteJoinVisualLinesAction" text="Delete Join Lines"/>
|
|
||||||
<action id="VimDeleteJoinVisualLinesSpaces" class="com.maddyhome.idea.vim.action.change.delete.DeleteJoinVisualLinesSpacesAction" text="Delete Join Lines"/>
|
|
||||||
<action id="VimDeleteLine" class="com.maddyhome.idea.vim.action.change.delete.DeleteLineAction" text="Delete Line"/>
|
|
||||||
<action id="VimDeleteMotion" class="com.maddyhome.idea.vim.action.change.delete.DeleteMotionAction" text="Delete Motion"/>
|
|
||||||
<action id="VimDeleteVisual" class="com.maddyhome.idea.vim.action.change.delete.DeleteVisualAction" text="Delete Selection"/>
|
|
||||||
<action id="VimDeleteVisualLines" class="com.maddyhome.idea.vim.action.change.delete.DeleteVisualLinesAction" text="Delete Selected Lines"/>
|
|
||||||
<action id="VimDeleteVisualLinesEnd" class="com.maddyhome.idea.vim.action.change.delete.DeleteVisualLinesEndAction" text="Delete Selected Lines"/>
|
|
||||||
|
|
||||||
<!-- Change -->
|
|
||||||
<action id="VimChangeCaseLowerMotion" class="com.maddyhome.idea.vim.action.change.change.ChangeCaseLowerMotionAction" text="Change Motion to Lower Case"/>
|
|
||||||
<action id="VimChangeCaseLowerVisual" class="com.maddyhome.idea.vim.action.change.change.ChangeCaseLowerVisualAction" text="Change Motion to Lower Case"/>
|
|
||||||
<action id="VimChangeCaseToggleCharacter" class="com.maddyhome.idea.vim.action.change.change.ChangeCaseToggleCharacterAction" text="Change Toggle Case"/>
|
|
||||||
<action id="VimChangeCaseToggleMotion" class="com.maddyhome.idea.vim.action.change.change.ChangeCaseToggleMotionAction" text="Change Motion Toggle Case"/>
|
|
||||||
<action id="VimChangeCaseToggleVisual" class="com.maddyhome.idea.vim.action.change.change.ChangeCaseToggleVisualAction" text="Change Motion Toggle Case"/>
|
|
||||||
<action id="VimChangeCaseUpperMotion" class="com.maddyhome.idea.vim.action.change.change.ChangeCaseUpperMotionAction" text="Change Motion to Upper Case"/>
|
|
||||||
<action id="VimChangeCaseUpperVisual" class="com.maddyhome.idea.vim.action.change.change.ChangeCaseUpperVisualAction" text="Change Motion to Upper Case"/>
|
|
||||||
<action id="VimChangeCharacter" class="com.maddyhome.idea.vim.action.change.change.ChangeCharacterAction" text="Change Character"/>
|
|
||||||
<action id="VimChangeCharacters" class="com.maddyhome.idea.vim.action.change.change.ChangeCharactersAction" text="Change Characters"/>
|
|
||||||
<action id="VimChangeEndOfLine" class="com.maddyhome.idea.vim.action.change.change.ChangeEndOfLineAction" text="Change to End-of-Line"/>
|
|
||||||
<action id="VimChangeLine" class="com.maddyhome.idea.vim.action.change.change.ChangeLineAction" text="Change Line"/>
|
|
||||||
<action id="VimChangeMotion" class="com.maddyhome.idea.vim.action.change.change.ChangeMotionAction" text="Change Motion"/>
|
|
||||||
<action id="VimChangeNumberInc" class="com.maddyhome.idea.vim.action.change.change.number.ChangeNumberIncAction" text="Increment Number"/>
|
|
||||||
<action id="VimChangeNumberDec" class="com.maddyhome.idea.vim.action.change.change.number.ChangeNumberDecAction" text="Decrement Number"/>
|
|
||||||
<action id="VimChangeVisualNumberInc" class="com.maddyhome.idea.vim.action.change.change.number.ChangeVisualNumberIncAction" text="Increment Number"/>
|
|
||||||
<action id="VimChangeVisualNumberDec" class="com.maddyhome.idea.vim.action.change.change.number.ChangeVisualNumberDecAction" text="Decrement Number"/>
|
|
||||||
<action id="VimChangeVisualAvalancheNumberInc" class="com.maddyhome.idea.vim.action.change.change.number.ChangeVisualNumberAvalancheIncAction" text="Increment Number"/>
|
|
||||||
<action id="VimChangeVisualAvalancheNumberDec" class="com.maddyhome.idea.vim.action.change.change.number.ChangeVisualNumberAvalancheDecAction" text="Decrement Number"/>
|
|
||||||
<action id="VimChangeReplace" class="com.maddyhome.idea.vim.action.change.change.ChangeReplaceAction" text="Replace"/>
|
|
||||||
<action id="VimChangeVisual" class="com.maddyhome.idea.vim.action.change.change.ChangeVisualAction" text="Change Motion"/>
|
|
||||||
<action id="VimChangeVisualCharacter" class="com.maddyhome.idea.vim.action.change.change.ChangeVisualCharacterAction" text="Change Motion"/>
|
|
||||||
<action id="VimChangeVisualLines" class="com.maddyhome.idea.vim.action.change.change.ChangeVisualLinesAction" text="Change Motion"/>
|
|
||||||
<action id="VimChangeVisualLinesEnd" class="com.maddyhome.idea.vim.action.change.change.ChangeVisualLinesEndAction" text="Change Motion"/>
|
|
||||||
<action id="VimFilterMotion" class="com.maddyhome.idea.vim.action.change.change.FilterMotionAction" text="Filter Lines"/>
|
|
||||||
<action id="VimFilterCountLines" class="com.maddyhome.idea.vim.action.change.change.FilterCountLinesAction" text="Filter Lines"/>
|
|
||||||
<action id="VimFilterVisualLines" class="com.maddyhome.idea.vim.action.change.change.FilterVisualLinesAction" text="Filter Visual Lines"/>
|
|
||||||
<action id="VimAutoIndentVisual" class="com.maddyhome.idea.vim.action.change.change.AutoIndentLinesVisualAction" text="Auto Indent Selection"/>
|
|
||||||
<action id="VimReformatVisual" class="com.maddyhome.idea.vim.action.change.change.ReformatCodeVisualAction" text="Reformat Selection"/>
|
|
||||||
|
|
||||||
<!-- Shift -->
|
|
||||||
<action id="VimAutoIndentLines" class="com.maddyhome.idea.vim.action.change.shift.AutoIndentLinesAction" text="Auto Indent Lines"/>
|
|
||||||
<action id="VimAutoIndentMotion" class="com.maddyhome.idea.vim.action.change.shift.AutoIndentMotionAction" text="Auto Indent Lines"/>
|
|
||||||
<action id="VimShiftLeftLines" class="com.maddyhome.idea.vim.action.change.shift.ShiftLeftLinesAction" text="Shift Lines Left"/>
|
|
||||||
<action id="VimShiftLeftLinesNormalMode" class="com.maddyhome.idea.vim.action.change.shift.ShiftLeftLinesNormalModeAction" text="Shift Lines Left"/>
|
|
||||||
<action id="VimShiftLeftMotion" class="com.maddyhome.idea.vim.action.change.shift.ShiftLeftMotionAction" text="Shift Motion Left"/>
|
|
||||||
<action id="VimShiftLeftVisual" class="com.maddyhome.idea.vim.action.change.shift.ShiftLeftVisualAction" text="Shift Visual Left"/>
|
|
||||||
<action id="VimShiftRightLines" class="com.maddyhome.idea.vim.action.change.shift.ShiftRightLinesAction" text="Shift Lines Right"/>
|
|
||||||
<action id="VimShiftRightLinesNormalMode" class="com.maddyhome.idea.vim.action.change.shift.ShiftRightLinesNormalModeAction" text="Shift Lines Right"/>
|
|
||||||
<action id="VimShiftRightMotion" class="com.maddyhome.idea.vim.action.change.shift.ShiftRightMotionAction" text="Shift Motion Right"/>
|
|
||||||
<action id="VimShiftRightVisual" class="com.maddyhome.idea.vim.action.change.shift.ShiftRightVisualAction" text="Shift Visual Right"/>
|
|
||||||
|
|
||||||
<!-- Copy -->
|
|
||||||
<action id="VimCopyPutTextAfterCursor" class="com.maddyhome.idea.vim.action.copy.PutTextAfterCursorAction" text="Put Text"/>
|
|
||||||
<action id="VimCopyPutTextBeforeCursor" class="com.maddyhome.idea.vim.action.copy.PutTextBeforeCursorAction" text="Put Text"/>
|
|
||||||
<action id="VimCopyPutTextAfterCursorNoIndent" class="com.maddyhome.idea.vim.action.copy.PutTextAfterCursorNoIndentAction" text="Put Text"/>
|
|
||||||
<action id="VimCopyPutTextBeforeCursorNoIndent" class="com.maddyhome.idea.vim.action.copy.PutTextBeforeCursorNoIndentAction" text="Put Text"/>
|
|
||||||
<action id="VimCopyPutTextAfterCursorMoveCursor" class="com.maddyhome.idea.vim.action.copy.PutTextAfterCursorActionMoveCursor" text="Put Text"/>
|
|
||||||
<action id="VimCopyPutTextBeforeCursorMoveCursor" class="com.maddyhome.idea.vim.action.copy.PutTextBeforeCursorActionMoveCursor" text="Put Text"/>
|
|
||||||
<action id="VimCopySelectRegister" class="com.maddyhome.idea.vim.action.copy.SelectRegisterAction" text="Select Register"/>
|
|
||||||
<action id="VimCopyYankLine" class="com.maddyhome.idea.vim.action.copy.YankLineAction" text="Yank Line"/>
|
|
||||||
<action id="VimCopyYankMidCountLine" class="com.maddyhome.idea.vim.action.copy.YankLineMidCountAction" text="Yank Line"/>
|
|
||||||
<action id="VimCopyYankMotion" class="com.maddyhome.idea.vim.action.copy.YankMotionAction" text="Yank Motion"/>
|
|
||||||
<action id="VimCopyYankVisual" class="com.maddyhome.idea.vim.action.copy.YankVisualAction" text="Yank Motion"/>
|
|
||||||
<action id="VimCopyYankVisualLines" class="com.maddyhome.idea.vim.action.copy.YankVisualLinesAction" text="Yank Motion"/>
|
|
||||||
<action id="VimVisualPutText" class="com.maddyhome.idea.vim.action.copy.PutVisualTextAction" text="Paste over Selection"/>
|
|
||||||
<action id="VimVisualPutTextNoIndent" class="com.maddyhome.idea.vim.action.copy.PutVisualTextNoIndentAction" text="Paste over Selection"/>
|
|
||||||
<action id="VimVisualPutTextMoveCursor" class="com.maddyhome.idea.vim.action.copy.PutVisualTextMoveCursorAction" text="Paste over Selection"/>
|
|
||||||
|
|
||||||
<!-- File -->
|
|
||||||
<action id="VimFileSaveClose" class="com.maddyhome.idea.vim.action.file.FileSaveCloseAction" text="Save and Close Editor"/>
|
|
||||||
<action id="VimFilePrevious" class="com.maddyhome.idea.vim.action.file.FilePreviousAction" text="Selects Previous Editor"/>
|
|
||||||
<action id="VimFileGetAscii" class="com.maddyhome.idea.vim.action.file.FileGetAsciiAction" text="Get ASCII Info"/>
|
|
||||||
<action id="VimFileGetHex" class="com.maddyhome.idea.vim.action.file.FileGetHexAction" text="Get Hex Info"/>
|
|
||||||
<action id="VimFileGetFileInfo" class="com.maddyhome.idea.vim.action.file.FileGetFileInfoAction" text="Get File Info"/>
|
|
||||||
<action id="VimFileGetLocationInfo" class="com.maddyhome.idea.vim.action.file.FileGetLocationInfoAction" text="Get Location Info"/>
|
|
||||||
|
|
||||||
<!-- Window -->
|
|
||||||
<action id="VimWindowSplitVertical" class="com.maddyhome.idea.vim.action.window.VerticalSplitAction" text="Split window vertically"/>
|
|
||||||
<action id="VimWindowSplitHorizontal" class="com.maddyhome.idea.vim.action.window.HorizontalSplitAction" text="Split window horizontally"/>
|
|
||||||
<action id="VimWindowClose" class="com.maddyhome.idea.vim.action.window.CloseWindowAction" text="Close current window"/>
|
|
||||||
<action id="VimWindowOnly" class="com.maddyhome.idea.vim.action.window.WindowOnlyAction" text="Close all windows except current"/>
|
|
||||||
<action id="VimWindowNext" class="com.maddyhome.idea.vim.action.window.WindowNextAction" text="Select next window"/>
|
|
||||||
<action id="VimWindowPrev" class="com.maddyhome.idea.vim.action.window.WindowPrevAction" text="Select previous window"/>
|
|
||||||
<action id="VimWindowLeft" class="com.maddyhome.idea.vim.action.window.WindowLeftAction" text="Go to left window"/>
|
|
||||||
<action id="VimWindowRight" class="com.maddyhome.idea.vim.action.window.WindowRightAction" text="Go to right window"/>
|
|
||||||
<action id="VimWindowUp" class="com.maddyhome.idea.vim.action.window.WindowUpAction" text="Go to window up"/>
|
|
||||||
<action id="VimWindowDown" class="com.maddyhome.idea.vim.action.window.WindowDownAction" text="Go to window down"/>
|
|
||||||
|
|
||||||
<!-- Search -->
|
|
||||||
<action id="VimSearchFwdEntry" class="com.maddyhome.idea.vim.action.motion.search.SearchEntryFwdAction" text="Search Forward"/>
|
|
||||||
<action id="VimSearchRevEntry" class="com.maddyhome.idea.vim.action.motion.search.SearchEntryRevAction" text="Search Backward"/>
|
|
||||||
<action id="VimSearchAgainNext" class="com.maddyhome.idea.vim.action.motion.search.SearchAgainNextAction" text="Search Again"/>
|
|
||||||
<action id="VimSearchAgainPrevious" class="com.maddyhome.idea.vim.action.motion.search.SearchAgainPreviousAction" text="Search Again"/>
|
|
||||||
<action id="VimSearchWholeWordForward" class="com.maddyhome.idea.vim.action.motion.search.SearchWholeWordForwardAction" text="Search Again"/>
|
|
||||||
<action id="VimSearchWholeWordBackward" class="com.maddyhome.idea.vim.action.motion.search.SearchWholeWordBackwardAction" text="Search Again"/>
|
|
||||||
<action id="VimSearchWordForward" class="com.maddyhome.idea.vim.action.motion.search.SearchWordForwardAction" text="Search Again"/>
|
|
||||||
<action id="VimSearchWordBackward" class="com.maddyhome.idea.vim.action.motion.search.SearchWordBackwardAction" text="Search Again"/>
|
|
||||||
<action id="VimGotoDeclaration" class="com.maddyhome.idea.vim.action.motion.search.GotoDeclarationAction" text="Goto Declaration"/>
|
|
||||||
|
|
||||||
<!-- Macro -->
|
|
||||||
<action id="VimToggleRecording" class="com.maddyhome.idea.vim.action.macro.ToggleRecordingAction" text="Record Keystrokes"/>
|
|
||||||
<action id="VimPlaybackRegister" class="com.maddyhome.idea.vim.action.macro.PlaybackRegisterAction" text="Playback Register"/>
|
|
||||||
<action id="VimPlaybackLastRegister" class="com.maddyhome.idea.vim.action.macro.PlaybackLastRegisterAction" text="Playback Last Register"/>
|
|
||||||
|
|
||||||
<!-- Command Line -->
|
|
||||||
<action id="VimProcessExEntry" class="com.maddyhome.idea.vim.action.ex.ProcessExEntryAction" text="Process Ex Entry"/>
|
|
||||||
|
|
||||||
<!-- Other -->
|
|
||||||
<action id="VimLastSearchReplace" class="com.maddyhome.idea.vim.action.change.change.ChangeLastSearchReplaceAction" text="Repeat Last :s"/>
|
|
||||||
<action id="VimLastGlobalSearchReplace" class="com.maddyhome.idea.vim.action.change.change.ChangeLastGlobalSearchReplaceAction" text="Repeat Last :s"/>
|
|
||||||
<action id="VimRepeatChange" class="com.maddyhome.idea.vim.action.change.RepeatChangeAction" text="Repeat Change"/>
|
|
||||||
<action id="VimRepeatExCommand" class="com.maddyhome.idea.vim.action.change.RepeatExCommandAction" text="Repeat Ex Command"/>
|
|
||||||
<action id="VimExEntry" class="com.maddyhome.idea.vim.action.ExEntryAction" text="Enter Ex Command"/>
|
|
||||||
<action id="VimResetMode" class="com.maddyhome.idea.vim.action.ResetModeAction" text="Reset Mode"/>
|
|
||||||
<action id="VimRedo" class="com.maddyhome.idea.vim.action.change.RedoAction" text="Redo"/>
|
|
||||||
<action id="VimUndo" class="com.maddyhome.idea.vim.action.change.UndoAction" text="Undo"/>
|
|
||||||
|
|
||||||
<!-- Internal -->
|
<!-- Internal -->
|
||||||
<action id="VimInternalAddInlays" class="com.maddyhome.idea.vim.action.internal.AddInlaysAction" text="Add test inlays | IdeaVim internal" internal="true"/>
|
<action id="VimInternalAddInlays" class="com.maddyhome.idea.vim.action.internal.AddInlaysAction" text="Add Test Inlays | IdeaVim Internal" internal="true"/>
|
||||||
|
|
||||||
<!-- Keys -->
|
|
||||||
<action id="VimShortcutKeyAction" class="com.maddyhome.idea.vim.action.VimShortcutKeyAction" text="Shortcuts"/>
|
<action id="VimShortcutKeyAction" class="com.maddyhome.idea.vim.action.VimShortcutKeyAction" text="Shortcuts"/>
|
||||||
<action id="VimOperatorAction" class="com.maddyhome.idea.vim.action.change.OperatorAction" text="Operator"/>
|
|
||||||
|
|
||||||
<!-- Visual Selection of last Search Pattern (gn) -->
|
|
||||||
<action id="VimVisualSelectNextSearch" class="com.maddyhome.idea.vim.action.motion.gn.VisualSelectNextSearch" text="Visual Select Next Search"/>
|
|
||||||
<action id="VimVisualSelectPreviousSearch" class="com.maddyhome.idea.vim.action.motion.gn.VisualSelectPreviousSearch" text="Visual Select Previous Search"/>
|
|
||||||
<action id="VimGnNextTextObject" class="com.maddyhome.idea.vim.action.motion.gn.GnNextTextObject" text="Gn Next Text Object"/>
|
|
||||||
<action id="VimGnPreviousTextObject" class="com.maddyhome.idea.vim.action.motion.gn.GnPreviousTextObject" text="Gn Previous Text Object"/>
|
|
||||||
|
|
||||||
<action id="VimCtrlDownAction" class="com.maddyhome.idea.vim.action.motion.scroll.CtrlDownAction" text="Ctrl down"/>
|
|
||||||
<action id="VimCtrlUpAction" class="com.maddyhome.idea.vim.action.motion.scroll.CtrlUpAction" text="Ctrl up"/>
|
|
||||||
</actions>
|
</actions>
|
||||||
</idea-plugin>
|
</idea-plugin>
|
||||||
|
BIN
resources/icons/github-off.png
Normal file
BIN
resources/icons/github-off.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 638 B |
BIN
resources/icons/github.png
Normal file
BIN
resources/icons/github.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 364 B |
BIN
resources/icons/mail.png
Normal file
BIN
resources/icons/mail.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 282 B |
@@ -13,7 +13,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
|
|
||||||
notexcmd=Not an editor command: {0}
|
notexcmd=Not an editor command: {0}
|
||||||
@@ -67,4 +67,5 @@ E385=E385: search hit BOTTOM without match for: {0}
|
|||||||
e_patnotf2=Pattern not found: {0}
|
e_patnotf2=Pattern not found: {0}
|
||||||
unkopt=Unknown option: {0}
|
unkopt=Unknown option: {0}
|
||||||
e_invarg=Invalid argument: {0}
|
e_invarg=Invalid argument: {0}
|
||||||
|
E475=E475: Invalid argument: {0}
|
||||||
E774=E774: 'operatorfunc' is empty
|
E774=E774: 'operatorfunc' is empty
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
rootProject.name = 'IdeaVIM'
|
rootProject.name = 'IdeaVIM'
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim;
|
package com.maddyhome.idea.vim;
|
||||||
|
@@ -13,37 +13,44 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim;
|
package com.maddyhome.idea.vim;
|
||||||
|
|
||||||
|
import com.intellij.ide.DataManager;
|
||||||
import com.intellij.ide.IdeEventQueue;
|
import com.intellij.ide.IdeEventQueue;
|
||||||
import com.intellij.openapi.actionSystem.*;
|
import com.intellij.openapi.actionSystem.*;
|
||||||
import com.intellij.openapi.application.Application;
|
import com.intellij.openapi.application.Application;
|
||||||
import com.intellij.openapi.application.ApplicationManager;
|
import com.intellij.openapi.application.ApplicationManager;
|
||||||
import com.intellij.openapi.application.ModalityState;
|
import com.intellij.openapi.application.ModalityState;
|
||||||
import com.intellij.openapi.command.CommandProcessor;
|
import com.intellij.openapi.command.CommandProcessor;
|
||||||
|
import com.intellij.openapi.command.UndoConfirmationPolicy;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.actionSystem.ActionPlan;
|
import com.intellij.openapi.editor.actionSystem.ActionPlan;
|
||||||
|
import com.intellij.openapi.editor.actionSystem.DocCommandGroupId;
|
||||||
import com.intellij.openapi.editor.actionSystem.TypedActionHandler;
|
import com.intellij.openapi.editor.actionSystem.TypedActionHandler;
|
||||||
import com.intellij.openapi.project.Project;
|
import com.intellij.openapi.project.Project;
|
||||||
import com.maddyhome.idea.vim.action.MotionEditorAction;
|
|
||||||
import com.maddyhome.idea.vim.action.TextObjectAction;
|
|
||||||
import com.maddyhome.idea.vim.command.*;
|
import com.maddyhome.idea.vim.command.*;
|
||||||
import com.maddyhome.idea.vim.extension.VimExtensionHandler;
|
import com.maddyhome.idea.vim.extension.VimExtensionHandler;
|
||||||
import com.maddyhome.idea.vim.group.RegisterGroup;
|
import com.maddyhome.idea.vim.group.RegisterGroup;
|
||||||
|
import com.maddyhome.idea.vim.handler.EditorActionHandlerBase;
|
||||||
|
import com.maddyhome.idea.vim.handler.MotionActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.handler.TextObjectActionHandler;
|
||||||
import com.maddyhome.idea.vim.helper.*;
|
import com.maddyhome.idea.vim.helper.*;
|
||||||
import com.maddyhome.idea.vim.key.*;
|
import com.maddyhome.idea.vim.key.*;
|
||||||
import com.maddyhome.idea.vim.option.OptionsManager;
|
import com.maddyhome.idea.vim.option.OptionsManager;
|
||||||
|
import org.jetbrains.annotations.Contract;
|
||||||
|
import org.jetbrains.annotations.NonNls;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.event.KeyEvent;
|
import java.awt.event.KeyEvent;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Stack;
|
import static com.intellij.openapi.actionSystem.CommonDataKeys.*;
|
||||||
|
import static com.intellij.openapi.actionSystem.PlatformDataKeys.PROJECT_FILE_DIRECTORY;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This handlers every keystroke that the user can argType except those that are still valid hotkeys for various Idea
|
* This handlers every keystroke that the user can argType except those that are still valid hotkeys for various Idea
|
||||||
@@ -88,6 +95,13 @@ public class KeyHandler {
|
|||||||
return origHandler;
|
return origHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void executeVimAction(@NotNull Editor editor, @NotNull EditorActionHandlerBase cmd, DataContext context) {
|
||||||
|
CommandProcessor.getInstance().executeCommand(editor.getProject(), () -> cmd
|
||||||
|
.execute(editor, getProjectAwareDataContext(editor, context)), cmd.getId(),
|
||||||
|
DocCommandGroupId.noneGroupId(editor.getDocument()),
|
||||||
|
UndoConfirmationPolicy.DEFAULT, editor.getDocument());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Execute an action
|
* Execute an action
|
||||||
*
|
*
|
||||||
@@ -101,7 +115,8 @@ public class KeyHandler {
|
|||||||
// Is the template presentation sufficient?
|
// Is the template presentation sufficient?
|
||||||
// What are the modifiers? Is zero OK?
|
// What are the modifiers? Is zero OK?
|
||||||
final AnActionEvent event =
|
final AnActionEvent event =
|
||||||
new AnActionEvent(null, context, ActionPlaces.ACTION_SEARCH, action.getTemplatePresentation(), ActionManager.getInstance(), 0);
|
new AnActionEvent(null, context, ActionPlaces.ACTION_SEARCH, action.getTemplatePresentation(),
|
||||||
|
ActionManager.getInstance(), 0);
|
||||||
action.update(event);
|
action.update(event);
|
||||||
if (event.getPresentation().isEnabled()) {
|
if (event.getPresentation().isEnabled()) {
|
||||||
action.actionPerformed(event);
|
action.actionPerformed(event);
|
||||||
@@ -148,6 +163,8 @@ public class KeyHandler {
|
|||||||
@NotNull KeyStroke key,
|
@NotNull KeyStroke key,
|
||||||
@NotNull DataContext context,
|
@NotNull DataContext context,
|
||||||
boolean allowKeyMappings) {
|
boolean allowKeyMappings) {
|
||||||
|
if (VimPlugin.Initialization.notInitialized()) return;
|
||||||
|
|
||||||
VimPlugin.clearError();
|
VimPlugin.clearError();
|
||||||
// All the editor actions should be performed with top level editor!!!
|
// All the editor actions should be performed with top level editor!!!
|
||||||
// Be careful: all the EditorActionHandler implementation should correctly process InjectedEditors
|
// Be careful: all the EditorActionHandler implementation should correctly process InjectedEditors
|
||||||
@@ -282,8 +299,8 @@ public class KeyHandler {
|
|||||||
RegisterGroup register = VimPlugin.getRegister();
|
RegisterGroup register = VimPlugin.getRegister();
|
||||||
if (register.getCurrentRegister() == register.getDefaultRegister()) {
|
if (register.getCurrentRegister() == register.getDefaultRegister()) {
|
||||||
if (key.getKeyCode() == KeyEvent.VK_ESCAPE) {
|
if (key.getKeyCode() == KeyEvent.VK_ESCAPE) {
|
||||||
CommandProcessor.getInstance().executeCommand(editor.getProject(),
|
CommandProcessor.getInstance()
|
||||||
() -> KeyHandler.executeAction("EditorEscape", context), "", null);
|
.executeCommand(editor.getProject(), () -> KeyHandler.executeAction("EditorEscape", context), "", null);
|
||||||
}
|
}
|
||||||
VimPlugin.indicateError();
|
VimPlugin.indicateError();
|
||||||
}
|
}
|
||||||
@@ -527,8 +544,9 @@ public class KeyHandler {
|
|||||||
|
|
||||||
if (ApplicationManager.getApplication().isDispatchThread()) {
|
if (ApplicationManager.getApplication().isDispatchThread()) {
|
||||||
Runnable action = new ActionRunner(editor, context, cmd, key);
|
Runnable action = new ActionRunner(editor, context, cmd, key);
|
||||||
String name = cmd.getAction().getTemplatePresentation().getText();
|
EditorActionHandlerBase cmdAction = cmd.getAction();
|
||||||
name = name != null ? "Vim " + name : "";
|
String name = cmdAction.getId();
|
||||||
|
|
||||||
if (type.isWrite()) {
|
if (type.isWrite()) {
|
||||||
RunnableHelper.runWriteCommand(project, action, name, action);
|
RunnableHelper.runWriteCommand(project, action, name, action);
|
||||||
}
|
}
|
||||||
@@ -548,18 +566,18 @@ public class KeyHandler {
|
|||||||
if (currentArg == Argument.Type.MOTION) {
|
if (currentArg == Argument.Type.MOTION) {
|
||||||
// We have been expecting a motion argument - is this one?
|
// We have been expecting a motion argument - is this one?
|
||||||
if (node.getCmdType() == Command.Type.MOTION) {
|
if (node.getCmdType() == Command.Type.MOTION) {
|
||||||
if (!(node.getAction() instanceof MotionEditorAction) && !(node.getAction() instanceof TextObjectAction)) {
|
if (!(node.getAction() instanceof MotionActionHandler) && !(node.getAction() instanceof TextObjectActionHandler)) {
|
||||||
throw new RuntimeException("MOTION cmd type can be used only with MotionEditorAction or TextObjectAction - " +
|
throw new RuntimeException("MOTION cmd type can be used only with MotionActionHandler or TextObjectActionHandler - " +
|
||||||
node.getAction().getClass().getName());
|
node.getAction().getClass().getName());
|
||||||
}
|
}
|
||||||
// Create the motion command and add it to the stack
|
// Create the motion command and add it to the stack
|
||||||
Command cmd = new Command(count, node.getActionId(), node.getAction(), node.getCmdType(), node.getFlags());
|
Command cmd = new Command(count, node.getAction(), node.getCmdType(), node.getFlags());
|
||||||
cmd.setKeys(keys);
|
cmd.setKeys(keys);
|
||||||
currentCmd.push(cmd);
|
currentCmd.push(cmd);
|
||||||
}
|
}
|
||||||
else if (node.getCmdType() == Command.Type.RESET) {
|
else if (node.getCmdType() == Command.Type.RESET) {
|
||||||
currentCmd.clear();
|
currentCmd.clear();
|
||||||
Command cmd = new Command(1, node.getActionId(), node.getAction(), node.getCmdType(), node.getFlags());
|
Command cmd = new Command(1, node.getAction(), node.getCmdType(), node.getFlags());
|
||||||
cmd.setKeys(keys);
|
cmd.setKeys(keys);
|
||||||
currentCmd.push(cmd);
|
currentCmd.push(cmd);
|
||||||
}
|
}
|
||||||
@@ -578,15 +596,9 @@ public class KeyHandler {
|
|||||||
// The user entered a valid command that doesn't take any arguments
|
// The user entered a valid command that doesn't take any arguments
|
||||||
else {
|
else {
|
||||||
// Create the command and add it to the stack
|
// Create the command and add it to the stack
|
||||||
Command cmd = new Command(count, node.getActionId(), node.getAction(), node.getCmdType(), node.getFlags());
|
Command cmd = new Command(count, node.getAction(), node.getCmdType(), node.getFlags());
|
||||||
cmd.setKeys(keys);
|
cmd.setKeys(keys);
|
||||||
currentCmd.push(cmd);
|
currentCmd.push(cmd);
|
||||||
|
|
||||||
// This is a sanity check that the command has a valid action. This should only fail if the
|
|
||||||
// programmer made a typo or forgot to add the action to the plugin.xml file
|
|
||||||
if (cmd.getAction() == null) {
|
|
||||||
state = State.ERROR;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -596,7 +608,7 @@ public class KeyHandler {
|
|||||||
@NotNull CommandState editorState,
|
@NotNull CommandState editorState,
|
||||||
@NotNull ArgumentNode node) {
|
@NotNull ArgumentNode node) {
|
||||||
// Create a new command based on what the user has typed so far, excluding this keystroke.
|
// Create a new command based on what the user has typed so far, excluding this keystroke.
|
||||||
Command cmd = new Command(count, node.getActionId(), node.getAction(), node.getCmdType(), node.getFlags());
|
Command cmd = new Command(count, node.getAction(), node.getCmdType(), node.getFlags());
|
||||||
cmd.setKeys(keys);
|
cmd.setKeys(keys);
|
||||||
currentCmd.push(cmd);
|
currentCmd.push(cmd);
|
||||||
// What type of argument does this command expect?
|
// What type of argument does this command expect?
|
||||||
@@ -719,11 +731,56 @@ public class KeyHandler {
|
|||||||
VimPlugin.getRegister().resetRegister();
|
VimPlugin.getRegister().resetRegister();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This method is copied from com.intellij.openapi.editor.actionSystem.EditorAction.getProjectAwareDataContext
|
||||||
|
@NotNull
|
||||||
|
private static DataContext getProjectAwareDataContext(@NotNull final Editor editor, @NotNull final DataContext original) {
|
||||||
|
if (PROJECT.getData(original) == editor.getProject()) {
|
||||||
|
return new DialogAwareDataContext(original);
|
||||||
|
}
|
||||||
|
|
||||||
|
return dataId -> {
|
||||||
|
if (PROJECT.is(dataId)) {
|
||||||
|
final Project project = editor.getProject();
|
||||||
|
if (project != null) {
|
||||||
|
return project;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return original.getData(dataId);
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// This class is copied from com.intellij.openapi.editor.actionSystem.DialogAwareDataContext.DialogAwareDataContext
|
||||||
|
private final static class DialogAwareDataContext implements DataContext {
|
||||||
|
private static final DataKey[] keys = {PROJECT, PROJECT_FILE_DIRECTORY, EDITOR, VIRTUAL_FILE, PSI_FILE};
|
||||||
|
private final Map<String, Object> values = new HashMap<>();
|
||||||
|
|
||||||
|
DialogAwareDataContext(DataContext context) {
|
||||||
|
for (DataKey key : keys) {
|
||||||
|
values.put(key.getName(), key.getData(context));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public Object getData(@NotNull @NonNls String dataId) {
|
||||||
|
if (values.containsKey(dataId)) {
|
||||||
|
return values.get(dataId);
|
||||||
|
}
|
||||||
|
final Editor editor = (Editor)values.get(EDITOR.getName());
|
||||||
|
if (editor != null) {
|
||||||
|
return DataManager.getInstance().getDataContext(editor.getContentComponent()).getData(dataId);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This was used as an experiment to execute actions as a runnable.
|
* This was used as an experiment to execute actions as a runnable.
|
||||||
*/
|
*/
|
||||||
static class ActionRunner implements Runnable {
|
static class ActionRunner implements Runnable {
|
||||||
public ActionRunner(Editor editor, DataContext context, Command cmd, KeyStroke key) {
|
@Contract(pure = true)
|
||||||
|
ActionRunner(Editor editor, DataContext context, Command cmd, KeyStroke key) {
|
||||||
this.editor = editor;
|
this.editor = editor;
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.cmd = cmd;
|
this.cmd = cmd;
|
||||||
@@ -735,7 +792,7 @@ public class KeyHandler {
|
|||||||
CommandState editorState = CommandState.getInstance(editor);
|
CommandState editorState = CommandState.getInstance(editor);
|
||||||
boolean wasRecording = editorState.isRecording();
|
boolean wasRecording = editorState.isRecording();
|
||||||
|
|
||||||
executeAction(cmd.getAction(), context);
|
executeVimAction(editor, cmd.getAction(), context);
|
||||||
if (editorState.getMode() == CommandState.Mode.INSERT || editorState.getMode() == CommandState.Mode.REPLACE) {
|
if (editorState.getMode() == CommandState.Mode.INSERT || editorState.getMode() == CommandState.Mode.REPLACE) {
|
||||||
VimPlugin.getChange().processCommand(editor, cmd);
|
VimPlugin.getChange().processCommand(editor, cmd);
|
||||||
}
|
}
|
||||||
|
@@ -13,67 +13,53 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package com.maddyhome.idea.vim;
|
package com.maddyhome.idea.vim;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.AnAction;
|
import com.intellij.openapi.extensions.ExtensionPointName;
|
||||||
import com.intellij.openapi.actionSystem.ex.ActionManagerEx;
|
|
||||||
import com.maddyhome.idea.vim.action.VimCommandActionBase;
|
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
|
||||||
import com.maddyhome.idea.vim.group.KeyGroup;
|
import com.maddyhome.idea.vim.group.KeyGroup;
|
||||||
|
import com.maddyhome.idea.vim.handler.EditorActionHandlerBase;
|
||||||
import com.maddyhome.idea.vim.key.Shortcut;
|
import com.maddyhome.idea.vim.key.Shortcut;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.event.KeyEvent;
|
import java.awt.event.KeyEvent;
|
||||||
import java.util.EnumSet;
|
|
||||||
|
|
||||||
class RegisterActions {
|
public class RegisterActions {
|
||||||
|
|
||||||
|
public static final ExtensionPointName<EditorActionHandlerBase> VIM_ACTIONS_EP =
|
||||||
|
ExtensionPointName.create("IdeaVIM.vimAction");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register all the key/action mappings for the plugin.
|
* Register all the key/action mappings for the plugin.
|
||||||
*/
|
*/
|
||||||
static void registerActions() {
|
static void registerActions() {
|
||||||
registerVimCommandActions();
|
registerVimCommandActions();
|
||||||
registerSystemMappings();
|
registerEmptyShortcuts();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
public static EditorActionHandlerBase findAction(@NotNull String id) {
|
||||||
|
return VIM_ACTIONS_EP.extensions().filter(vimActionBean -> vimActionBean.getId().equals(id)).findFirst()
|
||||||
|
.orElse(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public static EditorActionHandlerBase findActionOrDie(@NotNull String id) {
|
||||||
|
EditorActionHandlerBase action = findAction(id);
|
||||||
|
if (action == null) throw new RuntimeException("Action " + id + " is not registered");
|
||||||
|
return action;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void registerVimCommandActions() {
|
private static void registerVimCommandActions() {
|
||||||
final ActionManagerEx manager = ActionManagerEx.getInstanceEx();
|
KeyGroup parser = VimPlugin.getKey();
|
||||||
for (String actionId : manager.getPluginActions(VimPlugin.getPluginId())) {
|
VIM_ACTIONS_EP.extensions().forEach(parser::registerCommandAction);
|
||||||
final AnAction action = manager.getAction(actionId);
|
|
||||||
if (action instanceof VimCommandActionBase) {
|
|
||||||
VimPlugin.getKey().registerCommandAction((VimCommandActionBase)action, actionId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void registerSystemMappings() {
|
private static void registerEmptyShortcuts() {
|
||||||
final KeyGroup parser = VimPlugin.getKey();
|
final KeyGroup parser = VimPlugin.getKey();
|
||||||
parser.registerAction(MappingMode.NV, "CollapseAllRegions", Command.Type.OTHER_READONLY, new Shortcut("zM"));
|
|
||||||
parser.registerAction(MappingMode.NV, "CollapseRegion", Command.Type.OTHER_READONLY, new Shortcut("zc"));
|
|
||||||
parser.registerAction(MappingMode.NV, "CollapseRegionRecursively", Command.Type.OTHER_READONLY, new Shortcut("zC"));
|
|
||||||
parser.registerAction(MappingMode.NV, "ExpandAllRegions", Command.Type.OTHER_READONLY, new Shortcut("zR"));
|
|
||||||
parser.registerAction(MappingMode.NV, "ExpandRegion", Command.Type.OTHER_READONLY, new Shortcut("zo"));
|
|
||||||
parser.registerAction(MappingMode.NV, "ExpandRegionRecursively", Command.Type.OTHER_READONLY, new Shortcut("zO"));
|
|
||||||
|
|
||||||
parser.registerAction(MappingMode.I, "EditorBackSpace", Command.Type.INSERT, EnumSet.noneOf(CommandFlags.class),
|
|
||||||
new Shortcut[]{new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_H, KeyEvent.CTRL_MASK)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0))});
|
|
||||||
parser.registerAction(MappingMode.I, "EditorDelete", Command.Type.INSERT, EnumSet.of(CommandFlags.FLAG_SAVE_STROKE),
|
|
||||||
new Shortcut[]{new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0))});
|
|
||||||
parser.registerAction(MappingMode.I, "EditorDown", Command.Type.INSERT, EnumSet.of(CommandFlags.FLAG_CLEAR_STROKES),
|
|
||||||
new Shortcut[]{new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_KP_DOWN, 0))});
|
|
||||||
parser.registerAction(MappingMode.I, "EditorTab", Command.Type.INSERT, EnumSet.of(CommandFlags.FLAG_SAVE_STROKE),
|
|
||||||
new Shortcut[]{new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_I, KeyEvent.CTRL_MASK)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0))});
|
|
||||||
parser.registerAction(MappingMode.I, "EditorUp", Command.Type.INSERT, EnumSet.of(CommandFlags.FLAG_CLEAR_STROKES),
|
|
||||||
new Shortcut[]{new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_KP_UP, 0))});
|
|
||||||
|
|
||||||
parser.registerAction(MappingMode.N, "QuickJavaDoc", Command.Type.OTHER_READONLY, new Shortcut('K'));
|
|
||||||
|
|
||||||
// Digraph shortcuts are handled directly by KeyHandler#handleKey, so they don't have an action. But we still need to
|
// Digraph shortcuts are handled directly by KeyHandler#handleKey, so they don't have an action. But we still need to
|
||||||
// register the shortcuts or the editor will swallow them. Technically, the shortcuts will be registered as part of
|
// register the shortcuts or the editor will swallow them. Technically, the shortcuts will be registered as part of
|
||||||
|
@@ -13,12 +13,11 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim
|
package com.maddyhome.idea.vim
|
||||||
|
|
||||||
import com.intellij.configurationStore.APP_CONFIG
|
|
||||||
import com.intellij.openapi.components.PersistentStateComponent
|
import com.intellij.openapi.components.PersistentStateComponent
|
||||||
import com.intellij.openapi.components.RoamingType
|
import com.intellij.openapi.components.RoamingType
|
||||||
import com.intellij.openapi.components.State
|
import com.intellij.openapi.components.State
|
||||||
@@ -30,8 +29,10 @@ import org.jdom.Element
|
|||||||
* @author Alex Plate
|
* @author Alex Plate
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@State(name = "VimLocalSettings",
|
@State(name = "VimLocalSettings", storages = [
|
||||||
storages = [Storage("$APP_CONFIG$/vim_local_settings.xml", roamingType = RoamingType.DISABLED)])
|
Storage("\$APP_CONFIG$$/vim_local_settings.xml", roamingType = RoamingType.DISABLED, deprecated = true),
|
||||||
|
Storage("\$APP_CONFIG$/vim_local_settings.xml", roamingType = RoamingType.DISABLED)
|
||||||
|
])
|
||||||
class VimLocalConfig : PersistentStateComponent<Element> {
|
class VimLocalConfig : PersistentStateComponent<Element> {
|
||||||
override fun getState(): Element {
|
override fun getState(): Element {
|
||||||
val element = Element("ideavim-local")
|
val element = Element("ideavim-local")
|
||||||
@@ -48,9 +49,20 @@ class VimLocalConfig : PersistentStateComponent<Element> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun loadState(state: Element) {
|
override fun loadState(state: Element) {
|
||||||
VimPlugin.getMark().readData(state)
|
val setup = {
|
||||||
VimPlugin.getRegister().readData(state)
|
VimPlugin.getMark().readData(state)
|
||||||
VimPlugin.getSearch().readData(state)
|
VimPlugin.getRegister().readData(state)
|
||||||
VimPlugin.getHistory().readData(state)
|
VimPlugin.getSearch().readData(state)
|
||||||
|
VimPlugin.getHistory().readData(state)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Disable multithreading for EAP release
|
||||||
|
setup()
|
||||||
|
/*
|
||||||
|
if (ApplicationManager.getApplication().isUnitTestMode) {
|
||||||
|
} else {
|
||||||
|
ApplicationManager.getApplication().executeOnPooledThread(setup)
|
||||||
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package com.maddyhome.idea.vim;
|
package com.maddyhome.idea.vim;
|
||||||
|
|
||||||
@@ -21,9 +21,7 @@ import com.intellij.ide.plugins.IdeaPluginDescriptor;
|
|||||||
import com.intellij.ide.plugins.PluginManager;
|
import com.intellij.ide.plugins.PluginManager;
|
||||||
import com.intellij.ide.util.PropertiesComponent;
|
import com.intellij.ide.util.PropertiesComponent;
|
||||||
import com.intellij.notification.Notification;
|
import com.intellij.notification.Notification;
|
||||||
import com.intellij.notification.NotificationDisplayType;
|
|
||||||
import com.intellij.notification.NotificationListener;
|
import com.intellij.notification.NotificationListener;
|
||||||
import com.intellij.notification.Notifications;
|
|
||||||
import com.intellij.openapi.Disposable;
|
import com.intellij.openapi.Disposable;
|
||||||
import com.intellij.openapi.application.ApplicationInfo;
|
import com.intellij.openapi.application.ApplicationInfo;
|
||||||
import com.intellij.openapi.application.ApplicationManager;
|
import com.intellij.openapi.application.ApplicationManager;
|
||||||
@@ -67,6 +65,7 @@ import java.io.File;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This plugin attempts to emulate the key binding and general functionality of Vim and gVim. See the supplied
|
* This plugin attempts to emulate the key binding and general functionality of Vim and gVim. See the supplied
|
||||||
@@ -96,56 +95,15 @@ public class VimPlugin implements BaseComponent, PersistentStateComponent<Elemen
|
|||||||
|
|
||||||
private static final Logger LOG = Logger.getInstance(VimPlugin.class);
|
private static final Logger LOG = Logger.getInstance(VimPlugin.class);
|
||||||
|
|
||||||
@NotNull private final MotionGroup motion;
|
|
||||||
@NotNull private final ChangeGroup change;
|
|
||||||
@NotNull private final CommandGroup command;
|
|
||||||
@NotNull private final MarkGroup mark;
|
|
||||||
@NotNull private final RegisterGroup register;
|
|
||||||
@NotNull private final FileGroup file;
|
|
||||||
@NotNull private final SearchGroup search;
|
|
||||||
@NotNull private final ProcessGroup process;
|
|
||||||
@NotNull private final MacroGroup macro;
|
|
||||||
@NotNull private final DigraphGroup digraph;
|
|
||||||
@NotNull private final HistoryGroup history;
|
|
||||||
@NotNull private final KeyGroup key;
|
|
||||||
@NotNull private final WindowGroup window;
|
|
||||||
@NotNull private final EditorGroup editor;
|
|
||||||
@NotNull private final VisualMotionGroup visualMotion;
|
|
||||||
@NotNull private final YankGroup yank;
|
|
||||||
@NotNull private final PutGroup put;
|
|
||||||
|
|
||||||
@NotNull private final VimState state;
|
|
||||||
|
|
||||||
public VimPlugin() {
|
|
||||||
motion = new MotionGroup();
|
|
||||||
change = new ChangeGroup();
|
|
||||||
command = new CommandGroup();
|
|
||||||
mark = new MarkGroup();
|
|
||||||
register = new RegisterGroup();
|
|
||||||
file = new FileGroup();
|
|
||||||
search = new SearchGroup();
|
|
||||||
process = new ProcessGroup();
|
|
||||||
macro = new MacroGroup();
|
|
||||||
digraph = new DigraphGroup();
|
|
||||||
history = new HistoryGroup();
|
|
||||||
key = new KeyGroup();
|
|
||||||
window = new WindowGroup();
|
|
||||||
editor = new EditorGroup();
|
|
||||||
visualMotion = new VisualMotionGroup();
|
|
||||||
yank = new YankGroup();
|
|
||||||
put = new PutGroup();
|
|
||||||
|
|
||||||
state = new VimState();
|
|
||||||
|
|
||||||
LOG.debug("VimPlugin ctr");
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public String getComponentName() {
|
public String getComponentName() {
|
||||||
return IDEAVIM_COMPONENT_NAME;
|
return IDEAVIM_COMPONENT_NAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@NotNull private final VimState state = new VimState();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initComponent() {
|
public void initComponent() {
|
||||||
LOG.debug("initComponent");
|
LOG.debug("initComponent");
|
||||||
@@ -179,6 +137,12 @@ public class VimPlugin implements BaseComponent, PersistentStateComponent<Elemen
|
|||||||
return getInstance().state;
|
return getInstance().state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public static MotionGroup getMotion() {
|
||||||
|
return ServiceManager.getService(MotionGroup.class);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reports statistics about installed IdeaVim and enabled Vim emulation.
|
* Reports statistics about installed IdeaVim and enabled Vim emulation.
|
||||||
* <p>
|
* <p>
|
||||||
@@ -227,94 +191,84 @@ public class VimPlugin implements BaseComponent, PersistentStateComponent<Elemen
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
public static MotionGroup getMotion() {
|
|
||||||
return getInstance().motion;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static ChangeGroup getChange() {
|
public static ChangeGroup getChange() {
|
||||||
return getInstance().change;
|
return ServiceManager.getService(ChangeGroup.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static CommandGroup getCommand() {
|
public static CommandGroup getCommand() {
|
||||||
return getInstance().command;
|
return ServiceManager.getService(CommandGroup.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static MarkGroup getMark() {
|
public static MarkGroup getMark() {
|
||||||
return getInstance().mark;
|
return ServiceManager.getService(MarkGroup.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static RegisterGroup getRegister() {
|
public static RegisterGroup getRegister() {
|
||||||
return getInstance().register;
|
return ServiceManager.getService(RegisterGroup.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static FileGroup getFile() {
|
public static FileGroup getFile() {
|
||||||
return getInstance().file;
|
return ServiceManager.getService(FileGroup.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static SearchGroup getSearch() {
|
public static SearchGroup getSearch() {
|
||||||
return getInstance().search;
|
return ServiceManager.getService(SearchGroup.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static ProcessGroup getProcess() {
|
public static ProcessGroup getProcess() {
|
||||||
return getInstance().process;
|
return ServiceManager.getService(ProcessGroup.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static MacroGroup getMacro() {
|
public static MacroGroup getMacro() {
|
||||||
return getInstance().macro;
|
return ServiceManager.getService(MacroGroup.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static DigraphGroup getDigraph() {
|
public static DigraphGroup getDigraph() {
|
||||||
return getInstance().digraph;
|
return ServiceManager.getService(DigraphGroup.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static HistoryGroup getHistory() {
|
public static HistoryGroup getHistory() {
|
||||||
return getInstance().history;
|
return ServiceManager.getService(HistoryGroup.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static KeyGroup getKey() {
|
public static KeyGroup getKey() {
|
||||||
return getInstance().key;
|
return ServiceManager.getService(KeyGroup.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static WindowGroup getWindow() {
|
public static WindowGroup getWindow() {
|
||||||
return getInstance().window;
|
return ServiceManager.getService(WindowGroup.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static EditorGroup getEditor() {
|
public static EditorGroup getEditor() {
|
||||||
return getInstance().editor;
|
return ServiceManager.getService(EditorGroup.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static VisualMotionGroup getVisualMotion() {
|
public static VisualMotionGroup getVisualMotion() {
|
||||||
return getInstance().visualMotion;
|
return ServiceManager.getService(VisualMotionGroup.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static YankGroup getYank() {
|
public static YankGroup getYank() {
|
||||||
return getInstance().yank;
|
return ServiceManager.getService(YankGroup.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static PutGroup getPut() {
|
public static PutGroup getPut() {
|
||||||
return getInstance().put;
|
return ServiceManager.getService(PutGroup.class);
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
|
||||||
private static NotificationService getNotifications() {
|
|
||||||
return getNotifications(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -328,41 +282,56 @@ public class VimPlugin implements BaseComponent, PersistentStateComponent<Elemen
|
|||||||
state.setAttribute("enabled", Boolean.toString(enabled));
|
state.setAttribute("enabled", Boolean.toString(enabled));
|
||||||
element.addContent(state);
|
element.addContent(state);
|
||||||
|
|
||||||
key.saveData(element);
|
getKey().saveData(element);
|
||||||
editor.saveData(element);
|
getEditor().saveData(element);
|
||||||
this.state.saveData(element);
|
|
||||||
|
|
||||||
return element;
|
return element;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private static NotificationService getNotifications() {
|
||||||
|
return getNotifications(null);
|
||||||
|
}
|
||||||
|
|
||||||
private void initializePlugin() {
|
private void initializePlugin() {
|
||||||
if (initialized) return;
|
if (initialized) return;
|
||||||
initialized = true;
|
initialized = true;
|
||||||
|
|
||||||
Notifications.Bus.register(NotificationService.IDEAVIM_STICKY_NOTIFICATION_ID, NotificationDisplayType.STICKY_BALLOON);
|
|
||||||
|
|
||||||
ApplicationManager.getApplication().invokeLater(this::updateState);
|
ApplicationManager.getApplication().invokeLater(this::updateState);
|
||||||
|
|
||||||
getEditor().turnOn();
|
getEditor().turnOn();
|
||||||
getSearch().turnOn();
|
getSearch().turnOn();
|
||||||
VimListenerManager.INSTANCE.turnOn();
|
VimListenerManager.INSTANCE.turnOn();
|
||||||
|
|
||||||
// Register vim actions in command mode
|
|
||||||
RegisterActions.registerActions();
|
|
||||||
|
|
||||||
// Add some listeners so we can handle special events
|
// Add some listeners so we can handle special events
|
||||||
DocumentManager.getInstance().addDocumentListener(MarkGroup.MarkUpdater.INSTANCE);
|
DocumentManager.getInstance().addDocumentListener(MarkGroup.MarkUpdater.INSTANCE);
|
||||||
DocumentManager.getInstance().addDocumentListener(SearchGroup.DocumentSearchListener.INSTANCE);
|
DocumentManager.getInstance().addDocumentListener(SearchGroup.DocumentSearchListener.INSTANCE);
|
||||||
|
|
||||||
// Register ex handlers
|
Runnable asyncSetup = () -> {
|
||||||
CommandParser.getInstance().registerHandlers();
|
// Register vim actions in command mode
|
||||||
|
RegisterActions.registerActions();
|
||||||
|
|
||||||
if (!ApplicationManager.getApplication().isUnitTestMode()) {
|
// Register ex handlers
|
||||||
final File ideaVimRc = VimScriptParser.findIdeaVimRc();
|
CommandParser.getInstance().registerHandlers();
|
||||||
if (ideaVimRc != null) {
|
|
||||||
VimScriptParser.executeFile(ideaVimRc);
|
if (!ApplicationManager.getApplication().isUnitTestMode()) {
|
||||||
|
final File ideaVimRc = VimScriptParser.findIdeaVimRc();
|
||||||
|
if (ideaVimRc != null) {
|
||||||
|
VimScriptParser.executeFile(ideaVimRc);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Initialization.initialized();
|
||||||
|
};
|
||||||
|
|
||||||
|
// Disable multithreading for EAP release
|
||||||
|
asyncSetup.run();
|
||||||
|
/*
|
||||||
|
if (ApplicationManager.getApplication().isUnitTestMode()) {
|
||||||
|
} else {
|
||||||
|
ApplicationManager.getApplication().executeOnPooledThread(asyncSetup);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@@ -444,6 +413,18 @@ public class VimPlugin implements BaseComponent, PersistentStateComponent<Elemen
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class Initialization {
|
||||||
|
private static final AtomicBoolean initialized = new AtomicBoolean(false);
|
||||||
|
|
||||||
|
public static boolean notInitialized() {
|
||||||
|
return !(initialized.get());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void initialized() {
|
||||||
|
initialized.set(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private static VimPlugin getInstance() {
|
private static VimPlugin getInstance() {
|
||||||
return (VimPlugin)ApplicationManager.getApplication().getComponent(IDEAVIM_COMPONENT_NAME);
|
return (VimPlugin)ApplicationManager.getApplication().getComponent(IDEAVIM_COMPONENT_NAME);
|
||||||
@@ -475,14 +456,14 @@ public class VimPlugin implements BaseComponent, PersistentStateComponent<Elemen
|
|||||||
if (SystemInfo.isMac) {
|
if (SystemInfo.isMac) {
|
||||||
final MacKeyRepeat keyRepeat = MacKeyRepeat.getInstance();
|
final MacKeyRepeat keyRepeat = MacKeyRepeat.getInstance();
|
||||||
final Boolean enabled = keyRepeat.isEnabled();
|
final Boolean enabled = keyRepeat.isEnabled();
|
||||||
final Boolean isKeyRepeat = editor.isKeyRepeat();
|
final Boolean isKeyRepeat = getEditor().isKeyRepeat();
|
||||||
if ((enabled == null || !enabled) && (isKeyRepeat == null || isKeyRepeat)) {
|
if ((enabled == null || !enabled) && (isKeyRepeat == null || isKeyRepeat)) {
|
||||||
if (VimPlugin.getNotifications().enableRepeatingMode() == Messages.YES) {
|
if (VimPlugin.getNotifications().enableRepeatingMode() == Messages.YES) {
|
||||||
editor.setKeyRepeat(true);
|
getEditor().setKeyRepeat(true);
|
||||||
keyRepeat.setEnabled(true);
|
keyRepeat.setEnabled(true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
editor.setKeyRepeat(false);
|
getEditor().setKeyRepeat(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -514,27 +495,39 @@ public class VimPlugin implements BaseComponent, PersistentStateComponent<Elemen
|
|||||||
public void loadState(@NotNull final Element element) {
|
public void loadState(@NotNull final Element element) {
|
||||||
LOG.debug("Loading state");
|
LOG.debug("Loading state");
|
||||||
|
|
||||||
// Restore whether the plugin is enabled or not
|
Runnable setup = () -> {
|
||||||
Element state = element.getChild("state");
|
// Restore whether the plugin is enabled or not
|
||||||
if (state != null) {
|
Element state = element.getChild("state");
|
||||||
try {
|
if (state != null) {
|
||||||
previousStateVersion = Integer.parseInt(state.getAttributeValue("version"));
|
try {
|
||||||
|
previousStateVersion = Integer.parseInt(state.getAttributeValue("version"));
|
||||||
|
}
|
||||||
|
catch (NumberFormatException ignored) {
|
||||||
|
}
|
||||||
|
enabled = Boolean.parseBoolean(state.getAttributeValue("enabled"));
|
||||||
|
previousKeyMap = state.getAttributeValue("keymap");
|
||||||
}
|
}
|
||||||
catch (NumberFormatException ignored) {
|
|
||||||
}
|
|
||||||
enabled = Boolean.parseBoolean(state.getAttributeValue("enabled"));
|
|
||||||
previousKeyMap = state.getAttributeValue("keymap");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (previousStateVersion > 0 && previousStateVersion < 5) {
|
if (previousStateVersion > 0 && previousStateVersion < 5) {
|
||||||
// Migrate settings from 4 to 5 version
|
// Migrate settings from 4 to 5 version
|
||||||
mark.readData(element);
|
getMark().readData(element);
|
||||||
register.readData(element);
|
getRegister().readData(element);
|
||||||
search.readData(element);
|
getSearch().readData(element);
|
||||||
history.readData(element);
|
getHistory().readData(element);
|
||||||
|
}
|
||||||
|
getKey().readData(element);
|
||||||
|
getEditor().readData(element);
|
||||||
|
this.state.readData(element);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Disable multithreading for EAP release
|
||||||
|
setup.run();
|
||||||
|
/*
|
||||||
|
if (ApplicationManager.getApplication().isUnitTestMode()) {
|
||||||
|
setup.run();
|
||||||
|
} else {
|
||||||
|
ApplicationManager.getApplication().executeOnPooledThread(setup);
|
||||||
}
|
}
|
||||||
key.readData(element);
|
*/
|
||||||
editor.readData(element);
|
|
||||||
this.state.readData(element);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim
|
package com.maddyhome.idea.vim
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim;
|
package com.maddyhome.idea.vim;
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action;
|
package com.maddyhome.idea.vim.action;
|
||||||
@@ -31,7 +31,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class ExEntryAction extends VimCommandAction {
|
public class ExEntryAction extends VimActionHandler.SingleExecution {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -50,16 +50,10 @@ public class ExEntryAction extends VimCommandAction {
|
|||||||
return Command.Type.OTHER_READONLY;
|
return Command.Type.OTHER_READONLY;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
||||||
return new VimActionHandler.SingleExecution() {
|
VimPlugin.getProcess().startExCommand(editor, context, cmd);
|
||||||
@Override
|
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
|
||||||
VimPlugin.getProcess().startExCommand(editor, context, cmd);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action;
|
package com.maddyhome.idea.vim.action;
|
||||||
@@ -32,18 +32,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class ResetModeAction extends VimCommandAction {
|
public class ResetModeAction extends VimActionHandler.SingleExecution {
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
protected VimActionHandler makeActionHandler() {
|
|
||||||
return new VimActionHandler.SingleExecution() {
|
|
||||||
@Override
|
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
|
||||||
KeyHandler.getInstance().fullReset(HelperKt.getTopLevelEditor(editor));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
@@ -62,4 +51,10 @@ public class ResetModeAction extends VimCommandAction {
|
|||||||
public Command.Type getType() {
|
public Command.Type getType() {
|
||||||
return Command.Type.RESET;
|
return Command.Type.RESET;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
||||||
|
KeyHandler.getInstance().fullReset(HelperKt.getTopLevelEditor(editor));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,136 +0,0 @@
|
|||||||
/*
|
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
|
||||||
* Copyright (C) 2003-2019 The IdeaVim authors
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action
|
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableSet
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext
|
|
||||||
import com.intellij.openapi.editor.Caret
|
|
||||||
import com.intellij.openapi.editor.Editor
|
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction
|
|
||||||
import com.maddyhome.idea.vim.command.Argument
|
|
||||||
import com.maddyhome.idea.vim.command.Command
|
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags
|
|
||||||
import com.maddyhome.idea.vim.command.MappingMode
|
|
||||||
import com.maddyhome.idea.vim.common.TextRange
|
|
||||||
import com.maddyhome.idea.vim.handler.EditorActionHandlerBase
|
|
||||||
import com.maddyhome.idea.vim.handler.MotionActionHandler
|
|
||||||
import com.maddyhome.idea.vim.handler.TextObjectActionHandler
|
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
|
||||||
import com.maddyhome.idea.vim.helper.StringHelper
|
|
||||||
import com.maddyhome.idea.vim.helper.noneOfEnum
|
|
||||||
import java.util.*
|
|
||||||
import javax.swing.KeyStroke
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Structure of commands
|
|
||||||
*
|
|
||||||
* VimCommandActionBase
|
|
||||||
* (Can't be used directly)
|
|
||||||
* |
|
|
||||||
* -------------------------------------------------------------------------------------
|
|
||||||
* | | |
|
|
||||||
* MotionEditorAction TextObjectAction VimCommandAction
|
|
||||||
* (accepts MotionActionHandler) (accepts TextObjectActionHandler) (accepts VimActionHandler)
|
|
||||||
*
|
|
||||||
* See also EditorActionHandlerBase.kt for handlers structure
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Action that represents a Vim command.
|
|
||||||
*
|
|
||||||
* Actions should be registered in resources/META-INF/plugin.xml and in package-info.java
|
|
||||||
* inside [com.maddyhome.idea.vim.action].
|
|
||||||
*
|
|
||||||
* @author vlan
|
|
||||||
*/
|
|
||||||
sealed class VimCommandActionBase : EditorAction(null) {
|
|
||||||
|
|
||||||
init {
|
|
||||||
@Suppress("LeakingThis")
|
|
||||||
setupHandler(makeActionHandler())
|
|
||||||
}
|
|
||||||
|
|
||||||
protected abstract fun makeActionHandler(): EditorActionHandlerBase
|
|
||||||
|
|
||||||
abstract val mappingModes: Set<MappingMode>
|
|
||||||
|
|
||||||
abstract val keyStrokesSet: Set<List<KeyStroke>>
|
|
||||||
|
|
||||||
abstract val type: Command.Type
|
|
||||||
|
|
||||||
open val argumentType: Argument.Type = Argument.Type.NONE
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns various binary flags for the command.
|
|
||||||
*
|
|
||||||
* These legacy flags will be refactored in future releases.
|
|
||||||
*
|
|
||||||
* @see com.maddyhome.idea.vim.command.Command
|
|
||||||
*/
|
|
||||||
open val flags: EnumSet<CommandFlags> = noneOfEnum()
|
|
||||||
|
|
||||||
protected companion object {
|
|
||||||
@JvmStatic
|
|
||||||
fun parseKeysSet(vararg keyStrings: String): Set<List<KeyStroke>> {
|
|
||||||
val builder = ImmutableSet.builder<List<KeyStroke>>()
|
|
||||||
for (keyString in keyStrings) {
|
|
||||||
builder.add(StringHelper.parseKeys(keyString))
|
|
||||||
}
|
|
||||||
return builder.build()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class VimCommandAction : VimCommandActionBase() {
|
|
||||||
abstract override fun makeActionHandler(): VimActionHandler
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class TextObjectAction : VimCommandActionBase() {
|
|
||||||
abstract override fun makeActionHandler(): TextObjectActionHandler
|
|
||||||
|
|
||||||
fun getRange(editor: Editor, caret: Caret, context: DataContext, count: Int, rawCount: Int, argument: Argument?): TextRange? {
|
|
||||||
val actionHandler = handler as? TextObjectActionHandler
|
|
||||||
?: throw RuntimeException("TextObjectAction works only with TextObjectActionHandler")
|
|
||||||
|
|
||||||
return actionHandler.getRange(editor, caret, context, count, rawCount, argument)
|
|
||||||
}
|
|
||||||
|
|
||||||
final override val type: Command.Type = Command.Type.MOTION
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class MotionEditorAction : VimCommandActionBase() {
|
|
||||||
abstract override fun makeActionHandler(): MotionActionHandler
|
|
||||||
|
|
||||||
fun getOffset(editor: Editor,
|
|
||||||
caret: Caret,
|
|
||||||
context: DataContext,
|
|
||||||
count: Int,
|
|
||||||
rawCount: Int,
|
|
||||||
argument: Argument?): Int {
|
|
||||||
val actionHandler = handler as? MotionActionHandler
|
|
||||||
?: throw RuntimeException("MotionAction works only with MotionHandler")
|
|
||||||
|
|
||||||
return when (actionHandler) {
|
|
||||||
is MotionActionHandler.SingleExecution -> actionHandler.getOffset(editor, context, count, rawCount, argument)
|
|
||||||
is MotionActionHandler.ForEachCaret -> actionHandler.getOffset(editor, caret, context, count, rawCount, argument)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
final override val type: Command.Type = Command.Type.MOTION
|
|
||||||
}
|
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action;
|
package com.maddyhome.idea.vim.action;
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action;
|
package com.maddyhome.idea.vim.action;
|
||||||
@@ -30,9 +30,11 @@ import com.intellij.openapi.project.DumbAware;
|
|||||||
import com.intellij.openapi.project.Project;
|
import com.intellij.openapi.project.Project;
|
||||||
import com.intellij.openapi.util.Key;
|
import com.intellij.openapi.util.Key;
|
||||||
import com.maddyhome.idea.vim.KeyHandler;
|
import com.maddyhome.idea.vim.KeyHandler;
|
||||||
|
import com.maddyhome.idea.vim.RegisterActions;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.change.insert.InsertExitModeAction;
|
import com.maddyhome.idea.vim.action.change.insert.InsertExitModeAction;
|
||||||
import com.maddyhome.idea.vim.command.CommandState;
|
import com.maddyhome.idea.vim.command.CommandState;
|
||||||
|
import com.maddyhome.idea.vim.handler.EditorActionHandlerBase;
|
||||||
import com.maddyhome.idea.vim.helper.CommandStateHelper;
|
import com.maddyhome.idea.vim.helper.CommandStateHelper;
|
||||||
import com.maddyhome.idea.vim.helper.EditorDataContext;
|
import com.maddyhome.idea.vim.helper.EditorDataContext;
|
||||||
import com.maddyhome.idea.vim.helper.EditorHelper;
|
import com.maddyhome.idea.vim.helper.EditorHelper;
|
||||||
@@ -177,9 +179,9 @@ public class VimShortcutKeyAction extends AnAction implements DumbAware {
|
|||||||
if (values == null) return false;
|
if (values == null) return false;
|
||||||
|
|
||||||
return values.stream().anyMatch(actionId -> {
|
return values.stream().anyMatch(actionId -> {
|
||||||
final AnAction action = ActionManager.getInstance().getAction(actionId);
|
final EditorActionHandlerBase action = RegisterActions.findAction(actionId);
|
||||||
if (!(action instanceof VimCommandAction)) return false;
|
if (action == null) return false;
|
||||||
return ((VimCommandAction)action).getKeyStrokesSet().stream()
|
return action.getKeyStrokesSet().stream()
|
||||||
.anyMatch(ks -> !ks.isEmpty() && ks.get(0).equals(keyStroke));
|
.anyMatch(ks -> !ks.isEmpty() && ks.get(0).equals(keyStroke));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change;
|
package com.maddyhome.idea.vim.action.change;
|
||||||
@@ -22,7 +22,6 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.KeyHandler;
|
import com.maddyhome.idea.vim.KeyHandler;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.*;
|
import com.maddyhome.idea.vim.command.*;
|
||||||
import com.maddyhome.idea.vim.common.TextRange;
|
import com.maddyhome.idea.vim.common.TextRange;
|
||||||
import com.maddyhome.idea.vim.group.MotionGroup;
|
import com.maddyhome.idea.vim.group.MotionGroup;
|
||||||
@@ -40,39 +39,7 @@ import java.util.Set;
|
|||||||
/**
|
/**
|
||||||
* @author vlan
|
* @author vlan
|
||||||
*/
|
*/
|
||||||
final public class OperatorAction extends VimCommandAction {
|
final public class OperatorAction extends VimActionHandler.SingleExecution {
|
||||||
@Contract(" -> new")
|
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
final protected VimActionHandler makeActionHandler() {
|
|
||||||
return new VimActionHandler.SingleExecution() {
|
|
||||||
@Override
|
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
|
||||||
final OperatorFunction operatorFunction = VimPlugin.getKey().getOperatorFunction();
|
|
||||||
if (operatorFunction != null) {
|
|
||||||
final Argument argument = cmd.getArgument();
|
|
||||||
if (argument != null) {
|
|
||||||
final Command motion = argument.getMotion();
|
|
||||||
if (motion != null) {
|
|
||||||
final TextRange range = MotionGroup
|
|
||||||
.getMotionRange(editor, editor.getCaretModel().getPrimaryCaret(), context, cmd.getCount(),
|
|
||||||
cmd.getRawCount(), argument, true);
|
|
||||||
if (range != null) {
|
|
||||||
VimPlugin.getMark().setChangeMarks(editor, range);
|
|
||||||
final SelectionType selectionType = SelectionType.fromCommandFlags(motion.getFlags());
|
|
||||||
KeyHandler.getInstance().reset(editor);
|
|
||||||
return operatorFunction.apply(editor, context, selectionType);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
VimPlugin.showMessage(MessageHelper.message("E774"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Contract(pure = true)
|
@Contract(pure = true)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
@@ -105,4 +72,29 @@ final public class OperatorAction extends VimCommandAction {
|
|||||||
final public EnumSet<CommandFlags> getFlags() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return EnumSet.of(CommandFlags.FLAG_OP_PEND);
|
return EnumSet.of(CommandFlags.FLAG_OP_PEND);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
||||||
|
final OperatorFunction operatorFunction = VimPlugin.getKey().getOperatorFunction();
|
||||||
|
if (operatorFunction != null) {
|
||||||
|
final Argument argument = cmd.getArgument();
|
||||||
|
if (argument != null) {
|
||||||
|
final Command motion = argument.getMotion();
|
||||||
|
if (motion != null) {
|
||||||
|
final TextRange range = MotionGroup
|
||||||
|
.getMotionRange(editor, editor.getCaretModel().getPrimaryCaret(), context, cmd.getCount(),
|
||||||
|
cmd.getRawCount(), argument, true);
|
||||||
|
if (range != null) {
|
||||||
|
VimPlugin.getMark().setChangeMarks(editor, range);
|
||||||
|
final SelectionType selectionType = SelectionType.fromCommandFlags(motion.getFlags());
|
||||||
|
KeyHandler.getInstance().reset(editor);
|
||||||
|
return operatorFunction.apply(editor, context, selectionType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
VimPlugin.showMessage(MessageHelper.message("E774"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,14 +13,13 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change;
|
package com.maddyhome.idea.vim.action.change;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
@@ -32,7 +31,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class RedoAction extends VimCommandAction {
|
public class RedoAction extends VimActionHandler.SingleExecution {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -51,14 +50,8 @@ public class RedoAction extends VimCommandAction {
|
|||||||
return Command.Type.OTHER_SELF_SYNCHRONIZED;
|
return Command.Type.OTHER_SELF_SYNCHRONIZED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
||||||
return new VimActionHandler.SingleExecution() {
|
return UndoRedoHelper.INSTANCE.redo(context);
|
||||||
@Override
|
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
|
||||||
return UndoRedoHelper.INSTANCE.redo(context);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change;
|
package com.maddyhome.idea.vim.action.change;
|
||||||
@@ -22,7 +22,6 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.KeyHandler;
|
import com.maddyhome.idea.vim.KeyHandler;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandState;
|
import com.maddyhome.idea.vim.command.CommandState;
|
||||||
@@ -35,7 +34,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class RepeatChangeAction extends VimCommandAction {
|
public class RepeatChangeAction extends VimActionHandler.SingleExecution {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -54,54 +53,48 @@ public class RepeatChangeAction extends VimCommandAction {
|
|||||||
return Command.Type.OTHER_WRITABLE;
|
return Command.Type.OTHER_WRITABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command command) {
|
||||||
return new VimActionHandler.SingleExecution() {
|
CommandState state = CommandState.getInstance(editor);
|
||||||
@Override
|
Command cmd = state.getLastChangeCommand();
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command command) {
|
|
||||||
CommandState state = CommandState.getInstance(editor);
|
|
||||||
Command cmd = state.getLastChangeCommand();
|
|
||||||
|
|
||||||
if (cmd != null) {
|
if (cmd != null) {
|
||||||
if (command.getRawCount() > 0) {
|
if (command.getRawCount() > 0) {
|
||||||
cmd.setCount(command.getCount());
|
cmd.setCount(command.getCount());
|
||||||
Argument arg = cmd.getArgument();
|
Argument arg = cmd.getArgument();
|
||||||
if (arg != null) {
|
if (arg != null) {
|
||||||
Command mot = arg.getMotion();
|
Command mot = arg.getMotion();
|
||||||
if (mot != null) {
|
if (mot != null) {
|
||||||
mot.setCount(0);
|
mot.setCount(0);
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Command save = state.getCommand();
|
|
||||||
int lastFTCmd = VimPlugin.getMotion().getLastFTCmd();
|
|
||||||
char lastFTChar = VimPlugin.getMotion().getLastFTChar();
|
|
||||||
|
|
||||||
state.setCommand(cmd);
|
|
||||||
state.pushState(CommandState.Mode.REPEAT, CommandState.SubMode.NONE, MappingMode.NORMAL);
|
|
||||||
char reg = VimPlugin.getRegister().getCurrentRegister();
|
|
||||||
VimPlugin.getRegister().selectRegister(state.getLastChangeRegister());
|
|
||||||
try {
|
|
||||||
KeyHandler.executeAction(cmd.getAction(), context);
|
|
||||||
}
|
|
||||||
catch (Exception e) {
|
|
||||||
// oops
|
|
||||||
}
|
|
||||||
state.popState();
|
|
||||||
if (save != null) {
|
|
||||||
state.setCommand(save);
|
|
||||||
}
|
|
||||||
VimPlugin.getMotion().setLastFTCmd(lastFTCmd, lastFTChar);
|
|
||||||
state.saveLastChangeCommand(cmd);
|
|
||||||
VimPlugin.getRegister().selectRegister(reg);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
Command save = state.getCommand();
|
||||||
|
int lastFTCmd = VimPlugin.getMotion().getLastFTCmd();
|
||||||
|
char lastFTChar = VimPlugin.getMotion().getLastFTChar();
|
||||||
|
|
||||||
|
state.setCommand(cmd);
|
||||||
|
state.pushState(CommandState.Mode.REPEAT, CommandState.SubMode.NONE, MappingMode.NORMAL);
|
||||||
|
char reg = VimPlugin.getRegister().getCurrentRegister();
|
||||||
|
VimPlugin.getRegister().selectRegister(state.getLastChangeRegister());
|
||||||
|
try {
|
||||||
|
KeyHandler.executeVimAction(editor, cmd.getAction(), context);
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
// oops
|
||||||
|
}
|
||||||
|
state.popState();
|
||||||
|
if (save != null) {
|
||||||
|
state.setCommand(save);
|
||||||
|
}
|
||||||
|
VimPlugin.getMotion().setLastFTCmd(lastFTCmd, lastFTChar);
|
||||||
|
state.saveLastChangeCommand(cmd);
|
||||||
|
VimPlugin.getRegister().selectRegister(reg);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,14 +13,13 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change;
|
package com.maddyhome.idea.vim.action.change;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.ex.CommandParser;
|
import com.maddyhome.idea.vim.ex.CommandParser;
|
||||||
@@ -33,7 +32,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class RepeatExCommandAction extends VimCommandAction {
|
public class RepeatExCommandAction extends VimActionHandler.SingleExecution {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -52,20 +51,14 @@ public class RepeatExCommandAction extends VimCommandAction {
|
|||||||
return Command.Type.OTHER_SELF_SYNCHRONIZED;
|
return Command.Type.OTHER_SELF_SYNCHRONIZED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command command) {
|
||||||
return new VimActionHandler.SingleExecution() {
|
int count = command.getCount();
|
||||||
@Override
|
try {
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command command) {
|
return CommandParser.getInstance().processLastCommand(editor, context, count);
|
||||||
int count = command.getCount();
|
}
|
||||||
try {
|
catch (ExException e) {
|
||||||
return CommandParser.getInstance().processLastCommand(editor, context, count);
|
return false;
|
||||||
}
|
}
|
||||||
catch (ExException e) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,14 +13,13 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change;
|
package com.maddyhome.idea.vim.action.change;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
@@ -32,7 +31,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class UndoAction extends VimCommandAction {
|
public class UndoAction extends VimActionHandler.SingleExecution {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -51,14 +50,8 @@ public class UndoAction extends VimCommandAction {
|
|||||||
return Command.Type.OTHER_SELF_SYNCHRONIZED;
|
return Command.Type.OTHER_SELF_SYNCHRONIZED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
||||||
return new VimActionHandler.SingleExecution() {
|
return UndoRedoHelper.INSTANCE.undo(context);
|
||||||
@Override
|
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
|
||||||
return UndoRedoHelper.INSTANCE.undo(context);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
@@ -22,12 +22,10 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
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.handler.VisualOperatorActionHandler;
|
||||||
import org.jetbrains.annotations.Contract;
|
import org.jetbrains.annotations.Contract;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@@ -40,24 +38,7 @@ import java.util.Set;
|
|||||||
/**
|
/**
|
||||||
* @author vlan
|
* @author vlan
|
||||||
*/
|
*/
|
||||||
final public class AutoIndentLinesVisualAction extends VimCommandAction {
|
final public class AutoIndentLinesVisualAction extends VisualOperatorActionHandler.ForEachCaret {
|
||||||
@Contract(" -> new")
|
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
final protected VimActionHandler makeActionHandler() {
|
|
||||||
return new VisualOperatorActionHandler.ForEachCaret() {
|
|
||||||
@Override
|
|
||||||
public boolean executeAction(@NotNull Editor editor,
|
|
||||||
@NotNull Caret caret,
|
|
||||||
@NotNull DataContext context,
|
|
||||||
@NotNull Command cmd,
|
|
||||||
@NotNull VimSelection range) {
|
|
||||||
VimPlugin.getChange().autoIndentRange(editor, caret, context, range.toVimTextRange(true));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Contract(pure = true)
|
@Contract(pure = true)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
@@ -83,4 +64,14 @@ final public class AutoIndentLinesVisualAction extends VimCommandAction {
|
|||||||
final public EnumSet<CommandFlags> getFlags() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return EnumSet.of(CommandFlags.FLAG_MOT_LINEWISE, CommandFlags.FLAG_EXIT_VISUAL);
|
return EnumSet.of(CommandFlags.FLAG_MOT_LINEWISE, CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean executeAction(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull VimSelection range) {
|
||||||
|
VimPlugin.getChange().autoIndentRange(editor, caret, context, range.toVimTextRange(true));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
@@ -22,13 +22,11 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import com.maddyhome.idea.vim.helper.CharacterHelper;
|
import com.maddyhome.idea.vim.helper.CharacterHelper;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
@@ -39,7 +37,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class ChangeCaseLowerMotionAction extends VimCommandAction {
|
public class ChangeCaseLowerMotionAction extends ChangeEditorActionHandler.ForEachCaret {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -70,21 +68,15 @@ public class ChangeCaseLowerMotionAction extends VimCommandAction {
|
|||||||
return Argument.Type.MOTION;
|
return Argument.Type.MOTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.ForEachCaret() {
|
@NotNull Caret caret,
|
||||||
@Override
|
@NotNull DataContext context,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int count,
|
||||||
@NotNull Caret caret,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
return argument != null &&
|
||||||
int rawCount,
|
VimPlugin.getChange()
|
||||||
@Nullable Argument argument) {
|
.changeCaseMotion(editor, caret, context, count, rawCount, CharacterHelper.CASE_LOWER, argument);
|
||||||
return argument != null &&
|
|
||||||
VimPlugin.getChange()
|
|
||||||
.changeCaseMotion(editor, caret, context, count, rawCount, CharacterHelper.CASE_LOWER, argument);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
@@ -22,12 +22,10 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
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.handler.VisualOperatorActionHandler;
|
||||||
import com.maddyhome.idea.vim.helper.CharacterHelper;
|
import com.maddyhome.idea.vim.helper.CharacterHelper;
|
||||||
import com.maddyhome.idea.vim.helper.HelperKt;
|
import com.maddyhome.idea.vim.helper.HelperKt;
|
||||||
@@ -42,25 +40,7 @@ import java.util.Set;
|
|||||||
/**
|
/**
|
||||||
* @author vlan
|
* @author vlan
|
||||||
*/
|
*/
|
||||||
final public class ChangeCaseLowerVisualAction extends VimCommandAction {
|
final public class ChangeCaseLowerVisualAction extends VisualOperatorActionHandler.ForEachCaret {
|
||||||
@Contract(" -> new")
|
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
final protected VimActionHandler makeActionHandler() {
|
|
||||||
return new VisualOperatorActionHandler.ForEachCaret() {
|
|
||||||
@Override
|
|
||||||
public boolean executeAction(@NotNull Editor editor,
|
|
||||||
@NotNull Caret caret,
|
|
||||||
@NotNull DataContext context,
|
|
||||||
@NotNull Command cmd,
|
|
||||||
@NotNull VimSelection range) {
|
|
||||||
final Editor topLevelEditor = HelperKt.getTopLevelEditor(editor);
|
|
||||||
return VimPlugin.getChange()
|
|
||||||
.changeCaseRange(topLevelEditor, caret, range.toVimTextRange(false), CharacterHelper.CASE_LOWER);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Contract(pure = true)
|
@Contract(pure = true)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
@@ -86,4 +66,15 @@ final public class ChangeCaseLowerVisualAction extends VimCommandAction {
|
|||||||
final public EnumSet<CommandFlags> getFlags() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return EnumSet.of(CommandFlags.FLAG_EXIT_VISUAL);
|
return EnumSet.of(CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean executeAction(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull VimSelection range) {
|
||||||
|
final Editor topLevelEditor = HelperKt.getTopLevelEditor(editor);
|
||||||
|
return VimPlugin.getChange()
|
||||||
|
.changeCaseRange(topLevelEditor, caret, range.toVimTextRange(false), CharacterHelper.CASE_LOWER);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
@@ -22,12 +22,10 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@@ -36,7 +34,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class ChangeCaseToggleCharacterAction extends VimCommandAction {
|
public class ChangeCaseToggleCharacterAction extends ChangeEditorActionHandler.ForEachCaret {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -55,19 +53,13 @@ public class ChangeCaseToggleCharacterAction extends VimCommandAction {
|
|||||||
return Command.Type.CHANGE;
|
return Command.Type.CHANGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.ForEachCaret() {
|
@NotNull Caret caret,
|
||||||
@Override
|
@NotNull DataContext context,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int count,
|
||||||
@NotNull Caret caret,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
return VimPlugin.getChange().changeCaseToggleCharacter(editor, caret, count);
|
||||||
int rawCount,
|
|
||||||
@Nullable Argument argument) {
|
|
||||||
return VimPlugin.getChange().changeCaseToggleCharacter(editor, caret, count);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
@@ -22,13 +22,11 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import com.maddyhome.idea.vim.helper.CharacterHelper;
|
import com.maddyhome.idea.vim.helper.CharacterHelper;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
@@ -39,7 +37,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class ChangeCaseToggleMotionAction extends VimCommandAction {
|
public class ChangeCaseToggleMotionAction extends ChangeEditorActionHandler.ForEachCaret {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -70,21 +68,15 @@ public class ChangeCaseToggleMotionAction extends VimCommandAction {
|
|||||||
return EnumSet.of(CommandFlags.FLAG_OP_PEND);
|
return EnumSet.of(CommandFlags.FLAG_OP_PEND);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.ForEachCaret() {
|
@NotNull Caret caret,
|
||||||
@Override
|
@NotNull DataContext context,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int count,
|
||||||
@NotNull Caret caret,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
return argument != null &&
|
||||||
int rawCount,
|
VimPlugin.getChange()
|
||||||
@Nullable Argument argument) {
|
.changeCaseMotion(editor, caret, context, count, rawCount, CharacterHelper.CASE_TOGGLE, argument);
|
||||||
return argument != null &&
|
|
||||||
VimPlugin.getChange()
|
|
||||||
.changeCaseMotion(editor, caret, context, count, rawCount, CharacterHelper.CASE_TOGGLE, argument);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
@@ -22,12 +22,10 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
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.handler.VisualOperatorActionHandler;
|
||||||
import com.maddyhome.idea.vim.helper.CharacterHelper;
|
import com.maddyhome.idea.vim.helper.CharacterHelper;
|
||||||
import org.jetbrains.annotations.Contract;
|
import org.jetbrains.annotations.Contract;
|
||||||
@@ -41,24 +39,7 @@ import java.util.Set;
|
|||||||
/**
|
/**
|
||||||
* @author vlan
|
* @author vlan
|
||||||
*/
|
*/
|
||||||
final public class ChangeCaseToggleVisualAction extends VimCommandAction {
|
final public class ChangeCaseToggleVisualAction extends VisualOperatorActionHandler.ForEachCaret {
|
||||||
@Contract(" -> new")
|
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
final protected VimActionHandler makeActionHandler() {
|
|
||||||
return new VisualOperatorActionHandler.ForEachCaret() {
|
|
||||||
@Override
|
|
||||||
public boolean executeAction(@NotNull Editor editor,
|
|
||||||
@NotNull Caret caret,
|
|
||||||
@NotNull DataContext context,
|
|
||||||
@NotNull Command cmd,
|
|
||||||
@NotNull VimSelection range) {
|
|
||||||
return VimPlugin.getChange()
|
|
||||||
.changeCaseRange(editor, caret, range.toVimTextRange(false), CharacterHelper.CASE_TOGGLE);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Contract(pure = true)
|
@Contract(pure = true)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
@@ -84,4 +65,14 @@ final public class ChangeCaseToggleVisualAction extends VimCommandAction {
|
|||||||
final public EnumSet<CommandFlags> getFlags() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return EnumSet.of(CommandFlags.FLAG_EXIT_VISUAL);
|
return EnumSet.of(CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean executeAction(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull VimSelection range) {
|
||||||
|
return VimPlugin.getChange()
|
||||||
|
.changeCaseRange(editor, caret, range.toVimTextRange(false), CharacterHelper.CASE_TOGGLE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
@@ -22,13 +22,11 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import com.maddyhome.idea.vim.helper.CharacterHelper;
|
import com.maddyhome.idea.vim.helper.CharacterHelper;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
@@ -39,7 +37,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class ChangeCaseUpperMotionAction extends VimCommandAction {
|
public class ChangeCaseUpperMotionAction extends ChangeEditorActionHandler.ForEachCaret {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -70,21 +68,15 @@ public class ChangeCaseUpperMotionAction extends VimCommandAction {
|
|||||||
return EnumSet.of(CommandFlags.FLAG_OP_PEND);
|
return EnumSet.of(CommandFlags.FLAG_OP_PEND);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.ForEachCaret() {
|
@NotNull Caret caret,
|
||||||
@Override
|
@NotNull DataContext context,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int count,
|
||||||
@NotNull Caret caret,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
return argument != null &&
|
||||||
int rawCount,
|
VimPlugin.getChange()
|
||||||
@Nullable Argument argument) {
|
.changeCaseMotion(editor, caret, context, count, rawCount, CharacterHelper.CASE_UPPER, argument);
|
||||||
return argument != null &&
|
|
||||||
VimPlugin.getChange()
|
|
||||||
.changeCaseMotion(editor, caret, context, count, rawCount, CharacterHelper.CASE_UPPER, argument);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
@@ -22,12 +22,10 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
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.handler.VisualOperatorActionHandler;
|
||||||
import com.maddyhome.idea.vim.helper.CharacterHelper;
|
import com.maddyhome.idea.vim.helper.CharacterHelper;
|
||||||
import org.jetbrains.annotations.Contract;
|
import org.jetbrains.annotations.Contract;
|
||||||
@@ -41,24 +39,7 @@ import java.util.Set;
|
|||||||
/**
|
/**
|
||||||
* @author vlan
|
* @author vlan
|
||||||
*/
|
*/
|
||||||
final public class ChangeCaseUpperVisualAction extends VimCommandAction {
|
final public class ChangeCaseUpperVisualAction extends VisualOperatorActionHandler.ForEachCaret {
|
||||||
@Contract(" -> new")
|
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
final protected VimActionHandler makeActionHandler() {
|
|
||||||
return new VisualOperatorActionHandler.ForEachCaret() {
|
|
||||||
@Override
|
|
||||||
public boolean executeAction(@NotNull Editor editor,
|
|
||||||
@NotNull Caret caret,
|
|
||||||
@NotNull DataContext context,
|
|
||||||
@NotNull Command cmd,
|
|
||||||
@NotNull VimSelection range) {
|
|
||||||
return VimPlugin.getChange()
|
|
||||||
.changeCaseRange(editor, caret, range.toVimTextRange(false), CharacterHelper.CASE_UPPER);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Contract(pure = true)
|
@Contract(pure = true)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
@@ -84,4 +65,14 @@ final public class ChangeCaseUpperVisualAction extends VimCommandAction {
|
|||||||
final public EnumSet<CommandFlags> getFlags() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return EnumSet.of(CommandFlags.FLAG_EXIT_VISUAL);
|
return EnumSet.of(CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean executeAction(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull VimSelection range) {
|
||||||
|
return VimPlugin.getChange()
|
||||||
|
.changeCaseRange(editor, caret, range.toVimTextRange(false), CharacterHelper.CASE_UPPER);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
@@ -22,13 +22,11 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@@ -38,7 +36,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class ChangeCharacterAction extends VimCommandAction {
|
public class ChangeCharacterAction extends ChangeEditorActionHandler.ForEachCaret {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -69,19 +67,13 @@ public class ChangeCharacterAction extends VimCommandAction {
|
|||||||
return EnumSet.of(CommandFlags.FLAG_ALLOW_DIGRAPH);
|
return EnumSet.of(CommandFlags.FLAG_ALLOW_DIGRAPH);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.ForEachCaret() {
|
@NotNull Caret caret,
|
||||||
@Override
|
@NotNull DataContext context,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int count,
|
||||||
@NotNull Caret caret,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
return argument != null && VimPlugin.getChange().changeCharacter(editor, caret, count, argument.getCharacter());
|
||||||
int rawCount,
|
|
||||||
@Nullable Argument argument) {
|
|
||||||
return argument != null && VimPlugin.getChange().changeCharacter(editor, caret, count, argument.getCharacter());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
@@ -22,13 +22,11 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@@ -38,7 +36,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class ChangeCharactersAction extends VimCommandAction {
|
public class ChangeCharactersAction extends ChangeEditorActionHandler.ForEachCaret {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -63,19 +61,13 @@ public class ChangeCharactersAction extends VimCommandAction {
|
|||||||
return EnumSet.of(CommandFlags.FLAG_NO_REPEAT, CommandFlags.FLAG_MULTIKEY_UNDO);
|
return EnumSet.of(CommandFlags.FLAG_NO_REPEAT, CommandFlags.FLAG_MULTIKEY_UNDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.ForEachCaret() {
|
@NotNull Caret caret,
|
||||||
@Override
|
@NotNull DataContext context,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int count,
|
||||||
@NotNull Caret caret,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
return VimPlugin.getChange().changeCharacters(editor, caret, count);
|
||||||
int rawCount,
|
|
||||||
@Nullable Argument argument) {
|
|
||||||
return VimPlugin.getChange().changeCharacters(editor, caret, count);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
@@ -22,13 +22,11 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@@ -38,7 +36,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class ChangeEndOfLineAction extends VimCommandAction {
|
public class ChangeEndOfLineAction extends ChangeEditorActionHandler.ForEachCaret {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -63,19 +61,13 @@ public class ChangeEndOfLineAction extends VimCommandAction {
|
|||||||
return EnumSet.of(CommandFlags.FLAG_NO_REPEAT, CommandFlags.FLAG_MULTIKEY_UNDO);
|
return EnumSet.of(CommandFlags.FLAG_NO_REPEAT, CommandFlags.FLAG_MULTIKEY_UNDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.ForEachCaret() {
|
@NotNull Caret caret,
|
||||||
@Override
|
@NotNull DataContext context,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int count,
|
||||||
@NotNull Caret caret,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
return VimPlugin.getChange().changeEndOfLine(editor, caret, count);
|
||||||
int rawCount,
|
|
||||||
@Nullable Argument argument) {
|
|
||||||
return VimPlugin.getChange().changeEndOfLine(editor, caret, count);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
@@ -21,13 +21,11 @@ package com.maddyhome.idea.vim.action.change.change;
|
|||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.ex.LineRange;
|
import com.maddyhome.idea.vim.ex.LineRange;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import com.maddyhome.idea.vim.helper.EditorHelper;
|
import com.maddyhome.idea.vim.helper.EditorHelper;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
@@ -37,7 +35,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class ChangeLastGlobalSearchReplaceAction extends VimCommandAction {
|
public class ChangeLastGlobalSearchReplaceAction extends ChangeEditorActionHandler.SingleExecution {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -56,20 +54,14 @@ public class ChangeLastGlobalSearchReplaceAction extends VimCommandAction {
|
|||||||
return Command.Type.OTHER_SELF_SYNCHRONIZED;
|
return Command.Type.OTHER_SELF_SYNCHRONIZED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.SingleExecution() {
|
@NotNull DataContext context,
|
||||||
@Override
|
int count,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
final LineRange range = new LineRange(0, EditorHelper.getLineCount(editor) - 1);
|
||||||
int rawCount,
|
return VimPlugin.getSearch()
|
||||||
@Nullable Argument argument) {
|
.searchAndReplace(editor, editor.getCaretModel().getPrimaryCaret(), range, "s", "//~/&");
|
||||||
final LineRange range = new LineRange(0, EditorHelper.getLineCount(editor) - 1);
|
|
||||||
return VimPlugin.getSearch()
|
|
||||||
.searchAndReplace(editor, editor.getCaretModel().getPrimaryCaret(), range, "s", "//~/&");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
@@ -22,13 +22,11 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.ex.LineRange;
|
import com.maddyhome.idea.vim.ex.LineRange;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@@ -37,7 +35,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class ChangeLastSearchReplaceAction extends VimCommandAction {
|
public class ChangeLastSearchReplaceAction extends ChangeEditorActionHandler.SingleExecution {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -56,26 +54,20 @@ public class ChangeLastSearchReplaceAction extends VimCommandAction {
|
|||||||
return Command.Type.OTHER_SELF_SYNCHRONIZED;
|
return Command.Type.OTHER_SELF_SYNCHRONIZED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.SingleExecution() {
|
@NotNull DataContext context,
|
||||||
@Override
|
int count,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
boolean result = true;
|
||||||
int rawCount,
|
for (Caret caret : editor.getCaretModel().getAllCarets()) {
|
||||||
@Nullable Argument argument) {
|
final int line = caret.getLogicalPosition().line;
|
||||||
boolean result = true;
|
if (!VimPlugin.getSearch().searchAndReplace(editor, caret, new LineRange(line, line), "s", "//~/")) {
|
||||||
for (Caret caret : editor.getCaretModel().getAllCarets()) {
|
result = false;
|
||||||
final int line = caret.getLogicalPosition().line;
|
|
||||||
if (!VimPlugin.getSearch().searchAndReplace(editor, caret, new LineRange(line, line), "s", "//~/")) {
|
|
||||||
result = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
@@ -22,13 +22,11 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@@ -38,7 +36,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class ChangeLineAction extends VimCommandAction {
|
public class ChangeLineAction extends ChangeEditorActionHandler.ForEachCaret {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -63,19 +61,13 @@ public class ChangeLineAction extends VimCommandAction {
|
|||||||
return EnumSet.of(CommandFlags.FLAG_NO_REPEAT, CommandFlags.FLAG_ALLOW_MID_COUNT, CommandFlags.FLAG_MULTIKEY_UNDO);
|
return EnumSet.of(CommandFlags.FLAG_NO_REPEAT, CommandFlags.FLAG_ALLOW_MID_COUNT, CommandFlags.FLAG_MULTIKEY_UNDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.ForEachCaret() {
|
@NotNull Caret caret,
|
||||||
@Override
|
@NotNull DataContext context,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int count,
|
||||||
@NotNull Caret caret,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
return VimPlugin.getChange().changeLine(editor, caret, count, context);
|
||||||
int rawCount,
|
|
||||||
@Nullable Argument argument) {
|
|
||||||
return VimPlugin.getChange().changeLine(editor, caret, count, context);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
@@ -22,13 +22,11 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@@ -38,7 +36,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class ChangeMotionAction extends VimCommandAction {
|
public class ChangeMotionAction extends ChangeEditorActionHandler.ForEachCaret {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -69,20 +67,13 @@ public class ChangeMotionAction extends VimCommandAction {
|
|||||||
return Argument.Type.MOTION;
|
return Argument.Type.MOTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.ForEachCaret() {
|
@NotNull Caret caret,
|
||||||
@Override
|
@NotNull DataContext context,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int count,
|
||||||
@NotNull Caret caret,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
return argument != null && VimPlugin.getChange().changeMotion(editor, caret, context, count, rawCount, argument);
|
||||||
int rawCount,
|
|
||||||
@Nullable Argument argument) {
|
|
||||||
return argument != null &&
|
|
||||||
VimPlugin.getChange().changeMotion(editor, caret, context, count, rawCount, argument);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
@@ -21,13 +21,11 @@ package com.maddyhome.idea.vim.action.change.change;
|
|||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@@ -37,7 +35,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class ChangeReplaceAction extends VimCommandAction {
|
public class ChangeReplaceAction extends ChangeEditorActionHandler.SingleExecution {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -62,19 +60,13 @@ public class ChangeReplaceAction extends VimCommandAction {
|
|||||||
return EnumSet.of(CommandFlags.FLAG_MULTIKEY_UNDO);
|
return EnumSet.of(CommandFlags.FLAG_MULTIKEY_UNDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.SingleExecution() {
|
@NotNull DataContext context,
|
||||||
@Override
|
int count,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
VimPlugin.getChange().changeReplace(editor, context);
|
||||||
int rawCount,
|
return true;
|
||||||
@Nullable Argument argument) {
|
|
||||||
VimPlugin.getChange().changeReplace(editor, context);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
@@ -22,12 +22,10 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
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.handler.VisualOperatorActionHandler;
|
||||||
import org.jetbrains.annotations.Contract;
|
import org.jetbrains.annotations.Contract;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@@ -40,24 +38,7 @@ import java.util.Set;
|
|||||||
/**
|
/**
|
||||||
* @author vlan
|
* @author vlan
|
||||||
*/
|
*/
|
||||||
final public class ChangeVisualAction extends VimCommandAction {
|
final public class ChangeVisualAction extends VisualOperatorActionHandler.ForEachCaret {
|
||||||
@Contract(" -> new")
|
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
final protected VimActionHandler makeActionHandler() {
|
|
||||||
return new VisualOperatorActionHandler.ForEachCaret() {
|
|
||||||
@Override
|
|
||||||
public boolean executeAction(@NotNull Editor editor,
|
|
||||||
@NotNull Caret caret,
|
|
||||||
@NotNull DataContext context,
|
|
||||||
@NotNull Command cmd,
|
|
||||||
@NotNull VimSelection range) {
|
|
||||||
|
|
||||||
return VimPlugin.getChange().changeRange(editor, caret, range.toVimTextRange(false), range.getType(), context);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Contract(pure = true)
|
@Contract(pure = true)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
@@ -83,4 +64,14 @@ final public class ChangeVisualAction extends VimCommandAction {
|
|||||||
final public EnumSet<CommandFlags> getFlags() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return EnumSet.of(CommandFlags.FLAG_MULTIKEY_UNDO, CommandFlags.FLAG_EXIT_VISUAL);
|
return EnumSet.of(CommandFlags.FLAG_MULTIKEY_UNDO, CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean executeAction(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull VimSelection range) {
|
||||||
|
|
||||||
|
return VimPlugin.getChange().changeRange(editor, caret, range.toVimTextRange(false), range.getType(), context);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
@@ -22,13 +22,11 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
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.handler.VisualOperatorActionHandler;
|
||||||
import org.jetbrains.annotations.Contract;
|
import org.jetbrains.annotations.Contract;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@@ -41,25 +39,7 @@ import java.util.Set;
|
|||||||
/**
|
/**
|
||||||
* @author vlan
|
* @author vlan
|
||||||
*/
|
*/
|
||||||
final public class ChangeVisualCharacterAction extends VimCommandAction {
|
final public class ChangeVisualCharacterAction extends VisualOperatorActionHandler.ForEachCaret {
|
||||||
@Contract(" -> new")
|
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
final protected VimActionHandler makeActionHandler() {
|
|
||||||
return new VisualOperatorActionHandler.ForEachCaret() {
|
|
||||||
@Override
|
|
||||||
public boolean executeAction(@NotNull Editor editor,
|
|
||||||
@NotNull Caret caret,
|
|
||||||
@NotNull DataContext context,
|
|
||||||
@NotNull Command cmd,
|
|
||||||
@NotNull VimSelection range) {
|
|
||||||
final Argument argument = cmd.getArgument();
|
|
||||||
return argument != null &&
|
|
||||||
VimPlugin.getChange().changeCharacterRange(editor, range.toVimTextRange(false), argument.getCharacter());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Contract(pure = true)
|
@Contract(pure = true)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
@@ -92,4 +72,15 @@ final public class ChangeVisualCharacterAction extends VimCommandAction {
|
|||||||
final public EnumSet<CommandFlags> getFlags() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return EnumSet.of(CommandFlags.FLAG_ALLOW_DIGRAPH, CommandFlags.FLAG_EXIT_VISUAL);
|
return EnumSet.of(CommandFlags.FLAG_ALLOW_DIGRAPH, CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean executeAction(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull VimSelection range) {
|
||||||
|
final Argument argument = cmd.getArgument();
|
||||||
|
return argument != null &&
|
||||||
|
VimPlugin.getChange().changeCharacterRange(editor, range.toVimTextRange(false), argument.getCharacter());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
@@ -22,14 +22,12 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.command.SelectionType;
|
import com.maddyhome.idea.vim.command.SelectionType;
|
||||||
import com.maddyhome.idea.vim.common.TextRange;
|
import com.maddyhome.idea.vim.common.TextRange;
|
||||||
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
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.handler.VisualOperatorActionHandler;
|
||||||
import com.maddyhome.idea.vim.helper.EditorHelper;
|
import com.maddyhome.idea.vim.helper.EditorHelper;
|
||||||
import org.jetbrains.annotations.Contract;
|
import org.jetbrains.annotations.Contract;
|
||||||
@@ -43,27 +41,7 @@ import java.util.Set;
|
|||||||
/**
|
/**
|
||||||
* @author vlan
|
* @author vlan
|
||||||
*/
|
*/
|
||||||
final public class ChangeVisualLinesAction extends VimCommandAction {
|
final public class ChangeVisualLinesAction extends VisualOperatorActionHandler.ForEachCaret {
|
||||||
@Contract(" -> new")
|
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
final protected VimActionHandler makeActionHandler() {
|
|
||||||
return new VisualOperatorActionHandler.ForEachCaret() {
|
|
||||||
@Override
|
|
||||||
public boolean executeAction(@NotNull Editor editor,
|
|
||||||
@NotNull Caret caret,
|
|
||||||
@NotNull DataContext context,
|
|
||||||
@NotNull Command cmd,
|
|
||||||
@NotNull VimSelection range) {
|
|
||||||
final TextRange textRange = range.toVimTextRange(true);
|
|
||||||
|
|
||||||
final TextRange lineRange = new TextRange(EditorHelper.getLineStartForOffset(editor, textRange.getStartOffset()),
|
|
||||||
EditorHelper.getLineEndForOffset(editor, textRange.getEndOffset()) + 1);
|
|
||||||
return VimPlugin.getChange().changeRange(editor, caret, lineRange, SelectionType.LINE_WISE, context);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Contract(pure = true)
|
@Contract(pure = true)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
@@ -89,4 +67,17 @@ final public class ChangeVisualLinesAction extends VimCommandAction {
|
|||||||
final public EnumSet<CommandFlags> getFlags() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return EnumSet.of(CommandFlags.FLAG_MOT_LINEWISE, CommandFlags.FLAG_MULTIKEY_UNDO, CommandFlags.FLAG_EXIT_VISUAL);
|
return EnumSet.of(CommandFlags.FLAG_MOT_LINEWISE, CommandFlags.FLAG_MULTIKEY_UNDO, CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean executeAction(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull VimSelection range) {
|
||||||
|
final TextRange textRange = range.toVimTextRange(true);
|
||||||
|
|
||||||
|
final TextRange lineRange = new TextRange(EditorHelper.getLineStartForOffset(editor, textRange.getStartOffset()),
|
||||||
|
EditorHelper.getLineEndForOffset(editor, textRange.getEndOffset()) + 1);
|
||||||
|
return VimPlugin.getChange().changeRange(editor, caret, lineRange, SelectionType.LINE_WISE, context);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
@@ -22,14 +22,12 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.command.SelectionType;
|
import com.maddyhome.idea.vim.command.SelectionType;
|
||||||
import com.maddyhome.idea.vim.common.TextRange;
|
import com.maddyhome.idea.vim.common.TextRange;
|
||||||
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
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.handler.VisualOperatorActionHandler;
|
||||||
import com.maddyhome.idea.vim.helper.EditorHelper;
|
import com.maddyhome.idea.vim.helper.EditorHelper;
|
||||||
import org.jetbrains.annotations.Contract;
|
import org.jetbrains.annotations.Contract;
|
||||||
@@ -43,39 +41,7 @@ import java.util.Set;
|
|||||||
/**
|
/**
|
||||||
* @author vlan
|
* @author vlan
|
||||||
*/
|
*/
|
||||||
final public class ChangeVisualLinesEndAction extends VimCommandAction {
|
final public class ChangeVisualLinesEndAction extends VisualOperatorActionHandler.ForEachCaret {
|
||||||
@Contract(" -> new")
|
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
final protected VimActionHandler makeActionHandler() {
|
|
||||||
return new VisualOperatorActionHandler.ForEachCaret() {
|
|
||||||
@Override
|
|
||||||
public boolean executeAction(@NotNull Editor editor,
|
|
||||||
@NotNull Caret caret,
|
|
||||||
@NotNull DataContext context,
|
|
||||||
@NotNull Command cmd,
|
|
||||||
@NotNull VimSelection range) {
|
|
||||||
TextRange vimTextRange = range.toVimTextRange(true);
|
|
||||||
if (range.getType() == SelectionType.BLOCK_WISE && vimTextRange.isMultiple()) {
|
|
||||||
final int[] starts = vimTextRange.getStartOffsets();
|
|
||||||
final int[] ends = vimTextRange.getEndOffsets();
|
|
||||||
for (int i = 0; i < starts.length; i++) {
|
|
||||||
if (ends[i] > starts[i]) {
|
|
||||||
ends[i] = EditorHelper.getLineEndForOffset(editor, starts[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
final TextRange blockRange = new TextRange(starts, ends);
|
|
||||||
return VimPlugin.getChange().changeRange(editor, caret, blockRange, SelectionType.BLOCK_WISE, context);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
final TextRange lineRange = new TextRange(EditorHelper.getLineStartForOffset(editor, vimTextRange.getStartOffset()),
|
|
||||||
EditorHelper.getLineEndForOffset(editor, vimTextRange.getEndOffset()) + 1);
|
|
||||||
return VimPlugin.getChange().changeRange(editor, caret, lineRange, SelectionType.LINE_WISE, context);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Contract(pure = true)
|
@Contract(pure = true)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
@@ -101,4 +67,30 @@ final public class ChangeVisualLinesEndAction extends VimCommandAction {
|
|||||||
final public EnumSet<CommandFlags> getFlags() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return EnumSet.of(CommandFlags.FLAG_MOT_LINEWISE, CommandFlags.FLAG_MULTIKEY_UNDO, CommandFlags.FLAG_EXIT_VISUAL);
|
return EnumSet.of(CommandFlags.FLAG_MOT_LINEWISE, CommandFlags.FLAG_MULTIKEY_UNDO, CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean executeAction(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull VimSelection range) {
|
||||||
|
TextRange vimTextRange = range.toVimTextRange(true);
|
||||||
|
if (range.getType() == SelectionType.BLOCK_WISE && vimTextRange.isMultiple()) {
|
||||||
|
final int[] starts = vimTextRange.getStartOffsets();
|
||||||
|
final int[] ends = vimTextRange.getEndOffsets();
|
||||||
|
for (int i = 0; i < starts.length; i++) {
|
||||||
|
if (ends[i] > starts[i]) {
|
||||||
|
ends[i] = EditorHelper.getLineEndForOffset(editor, starts[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
final TextRange blockRange = new TextRange(starts, ends);
|
||||||
|
return VimPlugin.getChange().changeRange(editor, caret, blockRange, SelectionType.BLOCK_WISE, context);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
final TextRange lineRange =
|
||||||
|
new TextRange(EditorHelper.getLineStartForOffset(editor, vimTextRange.getStartOffset()),
|
||||||
|
EditorHelper.getLineEndForOffset(editor, vimTextRange.getEndOffset()) + 1);
|
||||||
|
return VimPlugin.getChange().changeRange(editor, caret, lineRange, SelectionType.LINE_WISE, context);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
@@ -21,7 +21,6 @@ package com.maddyhome.idea.vim.action.change.change;
|
|||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
@@ -32,7 +31,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class FilterCountLinesAction extends VimCommandAction {
|
public class FilterCountLinesAction extends VimActionHandler.SingleExecution {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -51,16 +50,10 @@ public class FilterCountLinesAction extends VimCommandAction {
|
|||||||
return Command.Type.CHANGE;
|
return Command.Type.CHANGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
||||||
return new VimActionHandler.SingleExecution() {
|
VimPlugin.getProcess().startFilterCommand(editor, context, cmd);
|
||||||
@Override
|
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
|
||||||
VimPlugin.getProcess().startFilterCommand(editor, context, cmd);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
@@ -22,7 +22,6 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.LogicalPosition;
|
import com.intellij.openapi.editor.LogicalPosition;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
@@ -33,12 +32,13 @@ import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class FilterMotionAction extends VimCommandAction {
|
public class FilterMotionAction extends VimActionHandler.SingleExecution {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -69,43 +69,63 @@ public class FilterMotionAction extends VimCommandAction {
|
|||||||
return EnumSet.of(CommandFlags.FLAG_OP_PEND);
|
return EnumSet.of(CommandFlags.FLAG_OP_PEND);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
||||||
return new VimActionHandler.SingleExecution() {
|
final Argument argument = cmd.getArgument();
|
||||||
@Override
|
if (argument == null) {
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
return false;
|
||||||
final Argument argument = cmd.getArgument();
|
}
|
||||||
if (argument == null) {
|
TextRange range = MotionGroup
|
||||||
return false;
|
.getMotionRange(editor, editor.getCaretModel().getPrimaryCaret(), context, cmd.getCount(), cmd.getRawCount(),
|
||||||
}
|
argument, false);
|
||||||
TextRange range = MotionGroup
|
if (range == null) {
|
||||||
.getMotionRange(editor, editor.getCaretModel().getPrimaryCaret(), context, cmd.getCount(), cmd.getRawCount(),
|
return false;
|
||||||
argument, false);
|
}
|
||||||
if (range == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
LogicalPosition current = editor.getCaretModel().getLogicalPosition();
|
LogicalPosition current = editor.getCaretModel().getLogicalPosition();
|
||||||
LogicalPosition start = editor.offsetToLogicalPosition(range.getStartOffset());
|
LogicalPosition start = editor.offsetToLogicalPosition(range.getStartOffset());
|
||||||
LogicalPosition end = editor.offsetToLogicalPosition(range.getEndOffset());
|
LogicalPosition end = editor.offsetToLogicalPosition(range.getEndOffset());
|
||||||
if (current.line != start.line) {
|
if (current.line != start.line) {
|
||||||
MotionGroup.moveCaret(editor, editor.getCaretModel().getPrimaryCaret(), range.getStartOffset());
|
MotionGroup.moveCaret(editor, editor.getCaretModel().getPrimaryCaret(), range.getStartOffset());
|
||||||
}
|
}
|
||||||
|
|
||||||
int count;
|
int count;
|
||||||
if (start.line < end.line) {
|
if (start.line < end.line) {
|
||||||
count = end.line - start.line + 1;
|
count = end.line - start.line + 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
count = 1;
|
count = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
Command command = new Command(count, null, null, Command.Type.UNDEFINED, EnumSet.noneOf(CommandFlags.class));
|
Command command = new Command(count, new EmptyAction(), Command.Type.UNDEFINED, EnumSet.noneOf(CommandFlags.class));
|
||||||
VimPlugin.getProcess().startFilterCommand(editor, context, command);
|
VimPlugin.getProcess().startFilterCommand(editor, context, command);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
private static class EmptyAction extends VimActionHandler.SingleExecution {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<MappingMode> getMappingModes() {
|
||||||
|
return Collections.emptySet();
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
|
return Collections.emptySet();
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Command.Type getType() {
|
||||||
|
return Command.Type.OTHER_SELF_SYNCHRONIZED;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
@@ -21,7 +21,6 @@ package com.maddyhome.idea.vim.action.change.change;
|
|||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
@@ -37,21 +36,7 @@ import java.util.Set;
|
|||||||
/**
|
/**
|
||||||
* @author vlan
|
* @author vlan
|
||||||
*/
|
*/
|
||||||
final public class FilterVisualLinesAction extends VimCommandAction {
|
final public class FilterVisualLinesAction extends VimActionHandler.SingleExecution {
|
||||||
@Contract(" -> new")
|
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
final protected VimActionHandler makeActionHandler() {
|
|
||||||
return new VimActionHandler.SingleExecution() {
|
|
||||||
@Override
|
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
|
||||||
VimPlugin.getProcess().startFilterCommand(editor, context, cmd);
|
|
||||||
VimPlugin.getVisualMotion().resetVisual(editor);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Contract(pure = true)
|
@Contract(pure = true)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
@@ -77,4 +62,11 @@ final public class FilterVisualLinesAction extends VimCommandAction {
|
|||||||
final public EnumSet<CommandFlags> getFlags() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return EnumSet.of(CommandFlags.FLAG_MOT_LINEWISE);
|
return EnumSet.of(CommandFlags.FLAG_MOT_LINEWISE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
||||||
|
VimPlugin.getProcess().startFilterCommand(editor, context, cmd);
|
||||||
|
VimPlugin.getVisualMotion().exitVisual(editor);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
@@ -22,12 +22,10 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
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.handler.VisualOperatorActionHandler;
|
||||||
import org.jetbrains.annotations.Contract;
|
import org.jetbrains.annotations.Contract;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@@ -40,24 +38,7 @@ import java.util.Set;
|
|||||||
/**
|
/**
|
||||||
* @author vlan
|
* @author vlan
|
||||||
*/
|
*/
|
||||||
final public class ReformatCodeVisualAction extends VimCommandAction {
|
final public class ReformatCodeVisualAction extends VisualOperatorActionHandler.ForEachCaret {
|
||||||
@Contract(" -> new")
|
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
final protected VimActionHandler makeActionHandler() {
|
|
||||||
return new VisualOperatorActionHandler.ForEachCaret() {
|
|
||||||
@Override
|
|
||||||
public boolean executeAction(@NotNull Editor editor,
|
|
||||||
@NotNull Caret caret,
|
|
||||||
@NotNull DataContext context,
|
|
||||||
@NotNull Command cmd,
|
|
||||||
@NotNull VimSelection range) {
|
|
||||||
VimPlugin.getChange().reformatCode(editor, range);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Contract(pure = true)
|
@Contract(pure = true)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
@@ -83,4 +64,14 @@ final public class ReformatCodeVisualAction extends VimCommandAction {
|
|||||||
final public EnumSet<CommandFlags> getFlags() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return EnumSet.of(CommandFlags.FLAG_MOT_LINEWISE, CommandFlags.FLAG_EXIT_VISUAL);
|
return EnumSet.of(CommandFlags.FLAG_MOT_LINEWISE, CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean executeAction(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull VimSelection range) {
|
||||||
|
VimPlugin.getChange().reformatCode(editor, range);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.change.number;
|
package com.maddyhome.idea.vim.action.change.change.number;
|
||||||
@@ -22,12 +22,10 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@@ -36,7 +34,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class ChangeNumberDecAction extends VimCommandAction {
|
public class ChangeNumberDecAction extends ChangeEditorActionHandler.ForEachCaret {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -55,19 +53,13 @@ public class ChangeNumberDecAction extends VimCommandAction {
|
|||||||
return Command.Type.CHANGE;
|
return Command.Type.CHANGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.ForEachCaret() {
|
@NotNull Caret caret,
|
||||||
@Override
|
@NotNull DataContext context,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int count,
|
||||||
@NotNull Caret caret,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
return VimPlugin.getChange().changeNumber(editor, caret, -count);
|
||||||
int rawCount,
|
|
||||||
@Nullable Argument argument) {
|
|
||||||
return VimPlugin.getChange().changeNumber(editor, caret, -count);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.change.number;
|
package com.maddyhome.idea.vim.action.change.change.number;
|
||||||
@@ -22,12 +22,10 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@@ -36,7 +34,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class ChangeNumberIncAction extends VimCommandAction {
|
public class ChangeNumberIncAction extends ChangeEditorActionHandler.ForEachCaret {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -55,19 +53,13 @@ public class ChangeNumberIncAction extends VimCommandAction {
|
|||||||
return Command.Type.CHANGE;
|
return Command.Type.CHANGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.ForEachCaret() {
|
@NotNull Caret caret,
|
||||||
@Override
|
@NotNull DataContext context,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int count,
|
||||||
@NotNull Caret caret,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
return VimPlugin.getChange().changeNumber(editor, caret, count);
|
||||||
int rawCount,
|
|
||||||
@Nullable Argument argument) {
|
|
||||||
return VimPlugin.getChange().changeNumber(editor, caret, count);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.change.number;
|
package com.maddyhome.idea.vim.action.change.change.number;
|
||||||
@@ -22,12 +22,10 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
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.handler.VisualOperatorActionHandler;
|
||||||
import org.jetbrains.annotations.Contract;
|
import org.jetbrains.annotations.Contract;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@@ -37,24 +35,7 @@ import java.util.EnumSet;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
final public class ChangeVisualNumberAvalancheDecAction extends VimCommandAction {
|
final public class ChangeVisualNumberAvalancheDecAction extends VisualOperatorActionHandler.ForEachCaret {
|
||||||
@Contract(" -> new")
|
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
final protected VimActionHandler makeActionHandler() {
|
|
||||||
return new VisualOperatorActionHandler.ForEachCaret() {
|
|
||||||
@Override
|
|
||||||
public boolean executeAction(@NotNull Editor editor,
|
|
||||||
@NotNull Caret caret,
|
|
||||||
@NotNull DataContext context,
|
|
||||||
@NotNull Command cmd,
|
|
||||||
@NotNull VimSelection range) {
|
|
||||||
return VimPlugin.getChange()
|
|
||||||
.changeNumberVisualMode(editor, caret, range.toVimTextRange(false), -cmd.getCount(), true);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Contract(pure = true)
|
@Contract(pure = true)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
@@ -80,4 +61,14 @@ final public class ChangeVisualNumberAvalancheDecAction extends VimCommandAction
|
|||||||
final public EnumSet<CommandFlags> getFlags() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return EnumSet.of(CommandFlags.FLAG_EXIT_VISUAL);
|
return EnumSet.of(CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean executeAction(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull VimSelection range) {
|
||||||
|
return VimPlugin.getChange()
|
||||||
|
.changeNumberVisualMode(editor, caret, range.toVimTextRange(false), -cmd.getCount(), true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.change.number;
|
package com.maddyhome.idea.vim.action.change.change.number;
|
||||||
@@ -22,12 +22,10 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
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.handler.VisualOperatorActionHandler;
|
||||||
import org.jetbrains.annotations.Contract;
|
import org.jetbrains.annotations.Contract;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@@ -37,24 +35,7 @@ import java.util.EnumSet;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
final public class ChangeVisualNumberAvalancheIncAction extends VimCommandAction {
|
final public class ChangeVisualNumberAvalancheIncAction extends VisualOperatorActionHandler.ForEachCaret {
|
||||||
@Contract(" -> new")
|
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
final protected VimActionHandler makeActionHandler() {
|
|
||||||
return new VisualOperatorActionHandler.ForEachCaret() {
|
|
||||||
@Override
|
|
||||||
public boolean executeAction(@NotNull Editor editor,
|
|
||||||
@NotNull Caret caret,
|
|
||||||
@NotNull DataContext context,
|
|
||||||
@NotNull Command cmd,
|
|
||||||
@NotNull VimSelection range) {
|
|
||||||
return VimPlugin.getChange()
|
|
||||||
.changeNumberVisualMode(editor, caret, range.toVimTextRange(false), cmd.getCount(), true);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Contract(pure = true)
|
@Contract(pure = true)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
@@ -80,4 +61,14 @@ final public class ChangeVisualNumberAvalancheIncAction extends VimCommandAction
|
|||||||
final public EnumSet<CommandFlags> getFlags() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return EnumSet.of(CommandFlags.FLAG_EXIT_VISUAL);
|
return EnumSet.of(CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean executeAction(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull VimSelection range) {
|
||||||
|
return VimPlugin.getChange()
|
||||||
|
.changeNumberVisualMode(editor, caret, range.toVimTextRange(false), cmd.getCount(), true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.change.number;
|
package com.maddyhome.idea.vim.action.change.change.number;
|
||||||
@@ -22,12 +22,10 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
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.handler.VisualOperatorActionHandler;
|
||||||
import org.jetbrains.annotations.Contract;
|
import org.jetbrains.annotations.Contract;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@@ -37,24 +35,7 @@ import java.util.EnumSet;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
final public class ChangeVisualNumberDecAction extends VimCommandAction {
|
final public class ChangeVisualNumberDecAction extends VisualOperatorActionHandler.ForEachCaret {
|
||||||
@Contract(" -> new")
|
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
final protected VimActionHandler makeActionHandler() {
|
|
||||||
return new VisualOperatorActionHandler.ForEachCaret() {
|
|
||||||
@Override
|
|
||||||
public boolean executeAction(@NotNull Editor editor,
|
|
||||||
@NotNull Caret caret,
|
|
||||||
@NotNull DataContext context,
|
|
||||||
@NotNull Command cmd,
|
|
||||||
@NotNull VimSelection range) {
|
|
||||||
return VimPlugin.getChange()
|
|
||||||
.changeNumberVisualMode(editor, caret, range.toVimTextRange(false), -cmd.getCount(), false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Contract(pure = true)
|
@Contract(pure = true)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
@@ -80,4 +61,14 @@ final public class ChangeVisualNumberDecAction extends VimCommandAction {
|
|||||||
final public EnumSet<CommandFlags> getFlags() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return EnumSet.of(CommandFlags.FLAG_EXIT_VISUAL);
|
return EnumSet.of(CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean executeAction(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull VimSelection range) {
|
||||||
|
return VimPlugin.getChange()
|
||||||
|
.changeNumberVisualMode(editor, caret, range.toVimTextRange(false), -cmd.getCount(), false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.change.number;
|
package com.maddyhome.idea.vim.action.change.change.number;
|
||||||
@@ -22,12 +22,10 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
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.handler.VisualOperatorActionHandler;
|
||||||
import org.jetbrains.annotations.Contract;
|
import org.jetbrains.annotations.Contract;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@@ -37,24 +35,7 @@ import java.util.EnumSet;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
final public class ChangeVisualNumberIncAction extends VimCommandAction {
|
final public class ChangeVisualNumberIncAction extends VisualOperatorActionHandler.ForEachCaret {
|
||||||
@Contract(" -> new")
|
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
final protected VimActionHandler makeActionHandler() {
|
|
||||||
return new VisualOperatorActionHandler.ForEachCaret() {
|
|
||||||
@Override
|
|
||||||
public boolean executeAction(@NotNull Editor editor,
|
|
||||||
@NotNull Caret caret,
|
|
||||||
@NotNull DataContext context,
|
|
||||||
@NotNull Command cmd,
|
|
||||||
@NotNull VimSelection range) {
|
|
||||||
return VimPlugin.getChange()
|
|
||||||
.changeNumberVisualMode(editor, caret, range.toVimTextRange(false), cmd.getCount(), false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Contract(pure = true)
|
@Contract(pure = true)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
@@ -80,4 +61,14 @@ final public class ChangeVisualNumberIncAction extends VimCommandAction {
|
|||||||
final public EnumSet<CommandFlags> getFlags() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return EnumSet.of(CommandFlags.FLAG_EXIT_VISUAL);
|
return EnumSet.of(CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean executeAction(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull VimSelection range) {
|
||||||
|
return VimPlugin.getChange()
|
||||||
|
.changeNumberVisualMode(editor, caret, range.toVimTextRange(false), cmd.getCount(), false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.delete;
|
package com.maddyhome.idea.vim.action.change.delete;
|
||||||
@@ -22,12 +22,10 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@@ -36,7 +34,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class DeleteCharacterAction extends VimCommandAction {
|
public class DeleteCharacterAction extends ChangeEditorActionHandler.ForEachCaret {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -55,19 +53,13 @@ public class DeleteCharacterAction extends VimCommandAction {
|
|||||||
return Command.Type.DELETE;
|
return Command.Type.DELETE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.ForEachCaret() {
|
@NotNull Caret caret,
|
||||||
@Override
|
@NotNull DataContext context,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int count,
|
||||||
@NotNull Caret caret,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
return VimPlugin.getChange().deleteCharacter(editor, caret, 1, false);
|
||||||
int rawCount,
|
|
||||||
@Nullable Argument argument) {
|
|
||||||
return VimPlugin.getChange().deleteCharacter(editor, caret, 1, false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.delete;
|
package com.maddyhome.idea.vim.action.change.delete;
|
||||||
@@ -22,12 +22,10 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@@ -36,7 +34,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class DeleteCharacterLeftAction extends VimCommandAction {
|
public class DeleteCharacterLeftAction extends ChangeEditorActionHandler.ForEachCaret {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -55,19 +53,13 @@ public class DeleteCharacterLeftAction extends VimCommandAction {
|
|||||||
return Command.Type.DELETE;
|
return Command.Type.DELETE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.ForEachCaret() {
|
@NotNull Caret caret,
|
||||||
@Override
|
@NotNull DataContext context,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int count,
|
||||||
@NotNull Caret caret,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
return VimPlugin.getChange().deleteCharacter(editor, caret, -count, false);
|
||||||
int rawCount,
|
|
||||||
@Nullable Argument argument) {
|
|
||||||
return VimPlugin.getChange().deleteCharacter(editor, caret, -count, false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.delete;
|
package com.maddyhome.idea.vim.action.change.delete;
|
||||||
@@ -22,12 +22,10 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@@ -36,7 +34,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class DeleteCharacterRightAction extends VimCommandAction {
|
public class DeleteCharacterRightAction extends ChangeEditorActionHandler.ForEachCaret {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -55,19 +53,13 @@ public class DeleteCharacterRightAction extends VimCommandAction {
|
|||||||
return Command.Type.DELETE;
|
return Command.Type.DELETE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.ForEachCaret() {
|
@NotNull Caret caret,
|
||||||
@Override
|
@NotNull DataContext context,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int count,
|
||||||
@NotNull Caret caret,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
return VimPlugin.getChange().deleteCharacter(editor, caret, count, false);
|
||||||
int rawCount,
|
|
||||||
@Nullable Argument argument) {
|
|
||||||
return VimPlugin.getChange().deleteCharacter(editor, caret, count, false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.delete;
|
package com.maddyhome.idea.vim.action.change.delete;
|
||||||
@@ -22,12 +22,10 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@@ -36,7 +34,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class DeleteEndOfLineAction extends VimCommandAction {
|
public class DeleteEndOfLineAction extends ChangeEditorActionHandler.ForEachCaret {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -55,19 +53,13 @@ public class DeleteEndOfLineAction extends VimCommandAction {
|
|||||||
return Command.Type.DELETE;
|
return Command.Type.DELETE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.ForEachCaret() {
|
@NotNull Caret caret,
|
||||||
@Override
|
@NotNull DataContext context,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int count,
|
||||||
@NotNull Caret caret,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
return VimPlugin.getChange().deleteEndOfLine(editor, caret, count);
|
||||||
int rawCount,
|
|
||||||
@Nullable Argument argument) {
|
|
||||||
return VimPlugin.getChange().deleteEndOfLine(editor, caret, count);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.delete;
|
package com.maddyhome.idea.vim.action.change.delete;
|
||||||
@@ -22,12 +22,10 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.util.Ref;
|
import com.intellij.openapi.util.Ref;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import com.maddyhome.idea.vim.option.OptionsManager;
|
import com.maddyhome.idea.vim.option.OptionsManager;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
@@ -37,7 +35,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class DeleteJoinLinesAction extends VimCommandAction {
|
public class DeleteJoinLinesAction extends ChangeEditorActionHandler.SingleExecution {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -56,29 +54,23 @@ public class DeleteJoinLinesAction extends VimCommandAction {
|
|||||||
return Command.Type.DELETE;
|
return Command.Type.DELETE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.SingleExecution() {
|
@NotNull DataContext context,
|
||||||
@Override
|
int count,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
if (editor.isOneLineMode()) return false;
|
||||||
int rawCount,
|
|
||||||
@Nullable Argument argument) {
|
|
||||||
if (editor.isOneLineMode()) return false;
|
|
||||||
|
|
||||||
if (OptionsManager.INSTANCE.getIdeajoin().isSet()) {
|
if (OptionsManager.INSTANCE.getIdeajoin().isSet()) {
|
||||||
return VimPlugin.getChange().joinViaIdeaByCount(editor, context, count);
|
return VimPlugin.getChange().joinViaIdeaByCount(editor, context, count);
|
||||||
}
|
}
|
||||||
VimPlugin.getEditor().notifyIdeaJoin(editor.getProject());
|
VimPlugin.getEditor().notifyIdeaJoin(editor.getProject());
|
||||||
|
|
||||||
Ref<Boolean> res = Ref.create(true);
|
Ref<Boolean> res = Ref.create(true);
|
||||||
editor.getCaretModel().runForEachCaret(caret -> {
|
editor.getCaretModel().runForEachCaret(caret -> {
|
||||||
if (!VimPlugin.getChange().deleteJoinLines(editor, caret, count, false)) res.set(false);
|
if (!VimPlugin.getChange().deleteJoinLines(editor, caret, count, false)) res.set(false);
|
||||||
}, true);
|
}, true);
|
||||||
return res.get();
|
return res.get();
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.delete;
|
package com.maddyhome.idea.vim.action.change.delete;
|
||||||
@@ -22,12 +22,10 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.util.Ref;
|
import com.intellij.openapi.util.Ref;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import com.maddyhome.idea.vim.option.OptionsManager;
|
import com.maddyhome.idea.vim.option.OptionsManager;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
@@ -37,7 +35,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class DeleteJoinLinesSpacesAction extends VimCommandAction {
|
public class DeleteJoinLinesSpacesAction extends ChangeEditorActionHandler.SingleExecution {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -56,30 +54,24 @@ public class DeleteJoinLinesSpacesAction extends VimCommandAction {
|
|||||||
return Command.Type.DELETE;
|
return Command.Type.DELETE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.SingleExecution() {
|
@NotNull DataContext context,
|
||||||
@Override
|
int count,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
if (editor.isOneLineMode()) return false;
|
||||||
int rawCount,
|
|
||||||
@Nullable Argument argument) {
|
|
||||||
if (editor.isOneLineMode()) return false;
|
|
||||||
|
|
||||||
if (OptionsManager.INSTANCE.getIdeajoin().isSet()) {
|
if (OptionsManager.INSTANCE.getIdeajoin().isSet()) {
|
||||||
return VimPlugin.getChange().joinViaIdeaByCount(editor, context, count);
|
return VimPlugin.getChange().joinViaIdeaByCount(editor, context, count);
|
||||||
}
|
}
|
||||||
VimPlugin.getEditor().notifyIdeaJoin(editor.getProject());
|
VimPlugin.getEditor().notifyIdeaJoin(editor.getProject());
|
||||||
|
|
||||||
Ref<Boolean> res = Ref.create(true);
|
Ref<Boolean> res = Ref.create(true);
|
||||||
editor.getCaretModel().runForEachCaret(caret -> {
|
editor.getCaretModel().runForEachCaret(caret -> {
|
||||||
if (!VimPlugin.getChange().deleteJoinLines(editor, caret, count, true)) res.set(false);
|
if (!VimPlugin.getChange().deleteJoinLines(editor, caret, count, true)) res.set(false);
|
||||||
}, true);
|
}, true);
|
||||||
return res.get();
|
return res.get();
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.delete;
|
package com.maddyhome.idea.vim.action.change.delete;
|
||||||
@@ -23,12 +23,10 @@ import com.intellij.openapi.editor.Caret;
|
|||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.util.Ref;
|
import com.intellij.openapi.util.Ref;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
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.handler.VisualOperatorActionHandler;
|
||||||
import com.maddyhome.idea.vim.option.OptionsManager;
|
import com.maddyhome.idea.vim.option.OptionsManager;
|
||||||
import org.jetbrains.annotations.Contract;
|
import org.jetbrains.annotations.Contract;
|
||||||
@@ -43,39 +41,7 @@ import java.util.Set;
|
|||||||
/**
|
/**
|
||||||
* @author vlan
|
* @author vlan
|
||||||
*/
|
*/
|
||||||
final public class DeleteJoinVisualLinesAction extends VimCommandAction {
|
final public class DeleteJoinVisualLinesAction extends VisualOperatorActionHandler.SingleExecution {
|
||||||
@Contract(" -> new")
|
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
final protected VimActionHandler makeActionHandler() {
|
|
||||||
return new VisualOperatorActionHandler.SingleExecution() {
|
|
||||||
@Override
|
|
||||||
public boolean executeForAllCarets(@NotNull Editor editor,
|
|
||||||
@NotNull DataContext context,
|
|
||||||
@NotNull Command cmd,
|
|
||||||
@NotNull Map<Caret, ? extends VimSelection> caretsAndSelections) {
|
|
||||||
if (editor.isOneLineMode()) return false;
|
|
||||||
|
|
||||||
if (OptionsManager.INSTANCE.getIdeajoin().isSet()) {
|
|
||||||
VimPlugin.getChange().joinViaIdeaBySelections(editor, context, caretsAndSelections);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
Ref<Boolean> res = Ref.create(true);
|
|
||||||
editor.getCaretModel().runForEachCaret(caret -> {
|
|
||||||
if (!caret.isValid()) return;
|
|
||||||
final VimSelection range = caretsAndSelections.get(caret);
|
|
||||||
if (range == null) return;
|
|
||||||
|
|
||||||
if (!VimPlugin.getChange().deleteJoinRange(editor, caret, range.toVimTextRange(true).normalize(), false)) {
|
|
||||||
res.set(false);
|
|
||||||
}
|
|
||||||
}, true);
|
|
||||||
return res.get();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Contract(pure = true)
|
@Contract(pure = true)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
@@ -102,4 +68,29 @@ final public class DeleteJoinVisualLinesAction extends VimCommandAction {
|
|||||||
final public EnumSet<CommandFlags> getFlags() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return EnumSet.of(CommandFlags.FLAG_EXIT_VISUAL);
|
return EnumSet.of(CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean executeForAllCarets(@NotNull Editor editor,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull Map<Caret, ? extends VimSelection> caretsAndSelections) {
|
||||||
|
if (editor.isOneLineMode()) return false;
|
||||||
|
|
||||||
|
if (OptionsManager.INSTANCE.getIdeajoin().isSet()) {
|
||||||
|
VimPlugin.getChange().joinViaIdeaBySelections(editor, context, caretsAndSelections);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Ref<Boolean> res = Ref.create(true);
|
||||||
|
editor.getCaretModel().runForEachCaret(caret -> {
|
||||||
|
if (!caret.isValid()) return;
|
||||||
|
final VimSelection range = caretsAndSelections.get(caret);
|
||||||
|
if (range == null) return;
|
||||||
|
|
||||||
|
if (!VimPlugin.getChange().deleteJoinRange(editor, caret, range.toVimTextRange(true).normalize(), false)) {
|
||||||
|
res.set(false);
|
||||||
|
}
|
||||||
|
}, true);
|
||||||
|
return res.get();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.delete;
|
package com.maddyhome.idea.vim.action.change.delete;
|
||||||
@@ -23,12 +23,10 @@ import com.intellij.openapi.editor.Caret;
|
|||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.util.Ref;
|
import com.intellij.openapi.util.Ref;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
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.handler.VisualOperatorActionHandler;
|
||||||
import com.maddyhome.idea.vim.option.OptionsManager;
|
import com.maddyhome.idea.vim.option.OptionsManager;
|
||||||
import org.jetbrains.annotations.Contract;
|
import org.jetbrains.annotations.Contract;
|
||||||
@@ -43,40 +41,7 @@ import java.util.Set;
|
|||||||
/**
|
/**
|
||||||
* @author vlan
|
* @author vlan
|
||||||
*/
|
*/
|
||||||
final public class DeleteJoinVisualLinesSpacesAction extends VimCommandAction {
|
final public class DeleteJoinVisualLinesSpacesAction extends VisualOperatorActionHandler.SingleExecution {
|
||||||
@Contract(" -> new")
|
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
final protected VimActionHandler makeActionHandler() {
|
|
||||||
return new VisualOperatorActionHandler.SingleExecution() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean executeForAllCarets(@NotNull Editor editor,
|
|
||||||
@NotNull DataContext context,
|
|
||||||
@NotNull Command cmd,
|
|
||||||
@NotNull Map<Caret, ? extends VimSelection> caretsAndSelections) {
|
|
||||||
if (editor.isOneLineMode()) return false;
|
|
||||||
|
|
||||||
if (OptionsManager.INSTANCE.getIdeajoin().isSet()) {
|
|
||||||
VimPlugin.getChange().joinViaIdeaBySelections(editor, context, caretsAndSelections);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
Ref<Boolean> res = Ref.create(true);
|
|
||||||
editor.getCaretModel().runForEachCaret(caret -> {
|
|
||||||
if (!caret.isValid()) return;
|
|
||||||
final VimSelection range = caretsAndSelections.get(caret);
|
|
||||||
if (range == null) return;
|
|
||||||
|
|
||||||
if (!VimPlugin.getChange().deleteJoinRange(editor, caret, range.toVimTextRange(true).normalize(), true)) {
|
|
||||||
res.set(false);
|
|
||||||
}
|
|
||||||
}, true);
|
|
||||||
return res.get();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Contract(pure = true)
|
@Contract(pure = true)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
@@ -102,4 +67,29 @@ final public class DeleteJoinVisualLinesSpacesAction extends VimCommandAction {
|
|||||||
final public EnumSet<CommandFlags> getFlags() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return EnumSet.of(CommandFlags.FLAG_EXIT_VISUAL);
|
return EnumSet.of(CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean executeForAllCarets(@NotNull Editor editor,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull Map<Caret, ? extends VimSelection> caretsAndSelections) {
|
||||||
|
if (editor.isOneLineMode()) return false;
|
||||||
|
|
||||||
|
if (OptionsManager.INSTANCE.getIdeajoin().isSet()) {
|
||||||
|
VimPlugin.getChange().joinViaIdeaBySelections(editor, context, caretsAndSelections);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Ref<Boolean> res = Ref.create(true);
|
||||||
|
editor.getCaretModel().runForEachCaret(caret -> {
|
||||||
|
if (!caret.isValid()) return;
|
||||||
|
final VimSelection range = caretsAndSelections.get(caret);
|
||||||
|
if (range == null) return;
|
||||||
|
|
||||||
|
if (!VimPlugin.getChange().deleteJoinRange(editor, caret, range.toVimTextRange(true).normalize(), true)) {
|
||||||
|
res.set(false);
|
||||||
|
}
|
||||||
|
}, true);
|
||||||
|
return res.get();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.delete;
|
package com.maddyhome.idea.vim.action.change.delete;
|
||||||
@@ -22,13 +22,11 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@@ -38,11 +36,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class DeleteLineAction extends VimCommandAction {
|
public class DeleteLineAction extends ChangeEditorActionHandler.ForEachCaret {
|
||||||
public DeleteLineAction() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -67,19 +61,13 @@ public class DeleteLineAction extends VimCommandAction {
|
|||||||
return EnumSet.of(CommandFlags.FLAG_ALLOW_MID_COUNT);
|
return EnumSet.of(CommandFlags.FLAG_ALLOW_MID_COUNT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.ForEachCaret() {
|
@NotNull Caret caret,
|
||||||
@Override
|
@NotNull DataContext context,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int count,
|
||||||
@NotNull Caret caret,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
return VimPlugin.getChange().deleteLine(editor, caret, count);
|
||||||
int rawCount,
|
|
||||||
@Nullable Argument argument) {
|
|
||||||
return VimPlugin.getChange().deleteLine(editor, caret, count);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.delete;
|
package com.maddyhome.idea.vim.action.change.delete;
|
||||||
@@ -22,13 +22,11 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@@ -38,7 +36,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class DeleteMotionAction extends VimCommandAction {
|
public class DeleteMotionAction extends ChangeEditorActionHandler.ForEachCaret {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -69,20 +67,14 @@ public class DeleteMotionAction extends VimCommandAction {
|
|||||||
return EnumSet.of(CommandFlags.FLAG_OP_PEND);
|
return EnumSet.of(CommandFlags.FLAG_OP_PEND);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.ForEachCaret() {
|
@NotNull Caret caret,
|
||||||
@Override
|
@NotNull DataContext context,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int count,
|
||||||
@NotNull Caret caret,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
return argument != null &&
|
||||||
int rawCount,
|
VimPlugin.getChange().deleteMotion(editor, caret, context, count, rawCount, argument, false);
|
||||||
@Nullable Argument argument) {
|
|
||||||
return argument != null &&
|
|
||||||
VimPlugin.getChange().deleteMotion(editor, caret, context, count, rawCount, argument, false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.delete;
|
package com.maddyhome.idea.vim.action.change.delete;
|
||||||
@@ -22,13 +22,11 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.command.SelectionType;
|
import com.maddyhome.idea.vim.command.SelectionType;
|
||||||
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
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.handler.VisualOperatorActionHandler;
|
||||||
import org.jetbrains.annotations.Contract;
|
import org.jetbrains.annotations.Contract;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@@ -41,24 +39,7 @@ import java.util.Set;
|
|||||||
/**
|
/**
|
||||||
* @author vlan
|
* @author vlan
|
||||||
*/
|
*/
|
||||||
final public class DeleteVisualAction extends VimCommandAction {
|
final public class DeleteVisualAction extends VisualOperatorActionHandler.ForEachCaret {
|
||||||
@Contract(" -> new")
|
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
final protected VimActionHandler makeActionHandler() {
|
|
||||||
return new VisualOperatorActionHandler.ForEachCaret() {
|
|
||||||
@Override
|
|
||||||
public boolean executeAction(@NotNull Editor editor,
|
|
||||||
@NotNull Caret caret,
|
|
||||||
@NotNull DataContext context,
|
|
||||||
@NotNull Command cmd,
|
|
||||||
@NotNull VimSelection range) {
|
|
||||||
SelectionType selectionType = range.getType();
|
|
||||||
return VimPlugin.getChange().deleteRange(editor, caret, range.toVimTextRange(false), selectionType, false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Contract(pure = true)
|
@Contract(pure = true)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
@@ -84,4 +65,14 @@ final public class DeleteVisualAction extends VimCommandAction {
|
|||||||
final public EnumSet<CommandFlags> getFlags() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return EnumSet.of(CommandFlags.FLAG_EXIT_VISUAL);
|
return EnumSet.of(CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean executeAction(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull VimSelection range) {
|
||||||
|
SelectionType selectionType = range.getType();
|
||||||
|
return VimPlugin.getChange().deleteRange(editor, caret, range.toVimTextRange(false), selectionType, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.delete;
|
package com.maddyhome.idea.vim.action.change.delete;
|
||||||
@@ -22,11 +22,9 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.*;
|
import com.maddyhome.idea.vim.command.*;
|
||||||
import com.maddyhome.idea.vim.common.TextRange;
|
import com.maddyhome.idea.vim.common.TextRange;
|
||||||
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
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.handler.VisualOperatorActionHandler;
|
||||||
import com.maddyhome.idea.vim.helper.EditorHelper;
|
import com.maddyhome.idea.vim.helper.EditorHelper;
|
||||||
import org.jetbrains.annotations.Contract;
|
import org.jetbrains.annotations.Contract;
|
||||||
@@ -40,33 +38,7 @@ import java.util.Set;
|
|||||||
/**
|
/**
|
||||||
* @author vlan
|
* @author vlan
|
||||||
*/
|
*/
|
||||||
final public class DeleteVisualLinesAction extends VimCommandAction {
|
final public class DeleteVisualLinesAction extends VisualOperatorActionHandler.ForEachCaret {
|
||||||
@Contract(" -> new")
|
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
final protected VimActionHandler makeActionHandler() {
|
|
||||||
return new VisualOperatorActionHandler.ForEachCaret() {
|
|
||||||
@Override
|
|
||||||
public boolean executeAction(@NotNull Editor editor,
|
|
||||||
@NotNull Caret caret,
|
|
||||||
@NotNull DataContext context,
|
|
||||||
@NotNull Command cmd,
|
|
||||||
@NotNull VimSelection range) {
|
|
||||||
final CommandState.SubMode mode = CommandState.getInstance(editor).getSubMode();
|
|
||||||
final TextRange textRange = range.toVimTextRange(false);
|
|
||||||
if (mode == CommandState.SubMode.VISUAL_BLOCK) {
|
|
||||||
return VimPlugin.getChange()
|
|
||||||
.deleteRange(editor, editor.getCaretModel().getPrimaryCaret(), textRange,
|
|
||||||
SelectionType.fromSubMode(mode), false);
|
|
||||||
} else {
|
|
||||||
final TextRange lineRange = new TextRange(EditorHelper.getLineStartForOffset(editor, textRange.getStartOffset()),
|
|
||||||
EditorHelper.getLineEndForOffset(editor, textRange.getEndOffset()) + 1);
|
|
||||||
return VimPlugin.getChange().deleteRange(editor, caret, lineRange, SelectionType.LINE_WISE, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Contract(pure = true)
|
@Contract(pure = true)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
@@ -92,4 +64,24 @@ final public class DeleteVisualLinesAction extends VimCommandAction {
|
|||||||
final public EnumSet<CommandFlags> getFlags() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return EnumSet.of(CommandFlags.FLAG_MOT_LINEWISE, CommandFlags.FLAG_EXIT_VISUAL);
|
return EnumSet.of(CommandFlags.FLAG_MOT_LINEWISE, CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean executeAction(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull VimSelection range) {
|
||||||
|
final CommandState.SubMode mode = CommandState.getInstance(editor).getSubMode();
|
||||||
|
final TextRange textRange = range.toVimTextRange(false);
|
||||||
|
if (mode == CommandState.SubMode.VISUAL_BLOCK) {
|
||||||
|
return VimPlugin.getChange()
|
||||||
|
.deleteRange(editor, editor.getCaretModel().getPrimaryCaret(), textRange, SelectionType.fromSubMode(mode),
|
||||||
|
false);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
final TextRange lineRange = new TextRange(EditorHelper.getLineStartForOffset(editor, textRange.getStartOffset()),
|
||||||
|
EditorHelper.getLineEndForOffset(editor, textRange.getEndOffset()) + 1);
|
||||||
|
return VimPlugin.getChange().deleteRange(editor, caret, lineRange, SelectionType.LINE_WISE, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.delete;
|
package com.maddyhome.idea.vim.action.change.delete;
|
||||||
@@ -22,14 +22,12 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.command.SelectionType;
|
import com.maddyhome.idea.vim.command.SelectionType;
|
||||||
import com.maddyhome.idea.vim.common.TextRange;
|
import com.maddyhome.idea.vim.common.TextRange;
|
||||||
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
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.handler.VisualOperatorActionHandler;
|
||||||
import com.maddyhome.idea.vim.helper.EditorHelper;
|
import com.maddyhome.idea.vim.helper.EditorHelper;
|
||||||
import org.jetbrains.annotations.Contract;
|
import org.jetbrains.annotations.Contract;
|
||||||
@@ -43,40 +41,7 @@ import java.util.Set;
|
|||||||
/**
|
/**
|
||||||
* @author vlan
|
* @author vlan
|
||||||
*/
|
*/
|
||||||
final public class DeleteVisualLinesEndAction extends VimCommandAction {
|
final public class DeleteVisualLinesEndAction extends VisualOperatorActionHandler.ForEachCaret {
|
||||||
@Contract(" -> new")
|
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
final protected VimActionHandler makeActionHandler() {
|
|
||||||
return new VisualOperatorActionHandler.ForEachCaret() {
|
|
||||||
@Override
|
|
||||||
public boolean executeAction(@NotNull Editor editor,
|
|
||||||
@NotNull Caret caret,
|
|
||||||
@NotNull DataContext context,
|
|
||||||
@NotNull Command cmd,
|
|
||||||
@NotNull VimSelection range) {
|
|
||||||
TextRange vimTextRange = range.toVimTextRange(true);
|
|
||||||
if (range.getType() == SelectionType.BLOCK_WISE) {
|
|
||||||
final int[] starts = vimTextRange.getStartOffsets();
|
|
||||||
final int[] ends = vimTextRange.getEndOffsets();
|
|
||||||
for (int i = 0; i < starts.length; i++) {
|
|
||||||
if (ends[i] > starts[i]) {
|
|
||||||
ends[i] = EditorHelper.getLineEndForOffset(editor, starts[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
final TextRange blockRange = new TextRange(starts, ends);
|
|
||||||
return VimPlugin.getChange()
|
|
||||||
.deleteRange(editor, editor.getCaretModel().getPrimaryCaret(), blockRange, SelectionType.BLOCK_WISE, false);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
final TextRange lineRange = new TextRange(EditorHelper.getLineStartForOffset(editor, vimTextRange.getStartOffset()),
|
|
||||||
EditorHelper.getLineEndForOffset(editor, vimTextRange.getEndOffset()) + 1);
|
|
||||||
return VimPlugin.getChange().deleteRange(editor, caret, lineRange, SelectionType.LINE_WISE, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Contract(pure = true)
|
@Contract(pure = true)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
@@ -102,4 +67,31 @@ final public class DeleteVisualLinesEndAction extends VimCommandAction {
|
|||||||
final public EnumSet<CommandFlags> getFlags() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return EnumSet.of(CommandFlags.FLAG_MOT_LINEWISE, CommandFlags.FLAG_EXIT_VISUAL);
|
return EnumSet.of(CommandFlags.FLAG_MOT_LINEWISE, CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean executeAction(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull VimSelection range) {
|
||||||
|
TextRange vimTextRange = range.toVimTextRange(true);
|
||||||
|
if (range.getType() == SelectionType.BLOCK_WISE) {
|
||||||
|
final int[] starts = vimTextRange.getStartOffsets();
|
||||||
|
final int[] ends = vimTextRange.getEndOffsets();
|
||||||
|
for (int i = 0; i < starts.length; i++) {
|
||||||
|
if (ends[i] > starts[i]) {
|
||||||
|
ends[i] = EditorHelper.getLineEndForOffset(editor, starts[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
final TextRange blockRange = new TextRange(starts, ends);
|
||||||
|
return VimPlugin.getChange()
|
||||||
|
.deleteRange(editor, editor.getCaretModel().getPrimaryCaret(), blockRange, SelectionType.BLOCK_WISE, false);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
final TextRange lineRange =
|
||||||
|
new TextRange(EditorHelper.getLineStartForOffset(editor, vimTextRange.getStartOffset()),
|
||||||
|
EditorHelper.getLineEndForOffset(editor, vimTextRange.getEndOffset()) + 1);
|
||||||
|
return VimPlugin.getChange().deleteRange(editor, caret, lineRange, SelectionType.LINE_WISE, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.insert;
|
package com.maddyhome.idea.vim.action.change.insert;
|
||||||
@@ -21,13 +21,11 @@ package com.maddyhome.idea.vim.action.change.insert;
|
|||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@@ -37,7 +35,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class InsertAfterCursorAction extends VimCommandAction {
|
public class InsertAfterCursorAction extends ChangeEditorActionHandler.SingleExecution {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -62,19 +60,13 @@ public class InsertAfterCursorAction extends VimCommandAction {
|
|||||||
return EnumSet.of(CommandFlags.FLAG_MULTIKEY_UNDO);
|
return EnumSet.of(CommandFlags.FLAG_MULTIKEY_UNDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.SingleExecution() {
|
@NotNull DataContext context,
|
||||||
@Override
|
int count,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
VimPlugin.getChange().insertAfterCursor(editor, context);
|
||||||
int rawCount,
|
return true;
|
||||||
@Nullable Argument argument) {
|
|
||||||
VimPlugin.getChange().insertAfterCursor(editor, context);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.insert;
|
package com.maddyhome.idea.vim.action.change.insert;
|
||||||
@@ -21,13 +21,11 @@ package com.maddyhome.idea.vim.action.change.insert;
|
|||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@@ -37,7 +35,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class InsertAfterLineEndAction extends VimCommandAction {
|
public class InsertAfterLineEndAction extends ChangeEditorActionHandler.SingleExecution {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -62,19 +60,13 @@ public class InsertAfterLineEndAction extends VimCommandAction {
|
|||||||
return EnumSet.of(CommandFlags.FLAG_MULTIKEY_UNDO);
|
return EnumSet.of(CommandFlags.FLAG_MULTIKEY_UNDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.SingleExecution() {
|
@NotNull DataContext context,
|
||||||
@Override
|
int count,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
VimPlugin.getChange().insertAfterLineEnd(editor, context);
|
||||||
int rawCount,
|
return true;
|
||||||
@Nullable Argument argument) {
|
|
||||||
VimPlugin.getChange().insertAfterLineEnd(editor, context);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.insert;
|
package com.maddyhome.idea.vim.action.change.insert;
|
||||||
@@ -21,13 +21,11 @@ package com.maddyhome.idea.vim.action.change.insert;
|
|||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@@ -37,7 +35,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class InsertAtPreviousInsertAction extends VimCommandAction {
|
public class InsertAtPreviousInsertAction extends ChangeEditorActionHandler.SingleExecution {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -62,19 +60,13 @@ public class InsertAtPreviousInsertAction extends VimCommandAction {
|
|||||||
return EnumSet.of(CommandFlags.FLAG_MULTIKEY_UNDO);
|
return EnumSet.of(CommandFlags.FLAG_MULTIKEY_UNDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.SingleExecution() {
|
@NotNull DataContext context,
|
||||||
@Override
|
int count,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
VimPlugin.getChange().insertAtPreviousInsert(editor, context);
|
||||||
int rawCount,
|
return true;
|
||||||
@Nullable Argument argument) {
|
|
||||||
VimPlugin.getChange().insertAtPreviousInsert(editor, context);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.insert;
|
package com.maddyhome.idea.vim.action.change.insert;
|
||||||
@@ -21,13 +21,11 @@ package com.maddyhome.idea.vim.action.change.insert;
|
|||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import org.jetbrains.annotations.Contract;
|
import org.jetbrains.annotations.Contract;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
@@ -37,21 +35,7 @@ import java.util.EnumSet;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
final public class InsertBeforeCursorAction extends VimCommandAction {
|
final public class InsertBeforeCursorAction extends ChangeEditorActionHandler.SingleExecution {
|
||||||
@Contract(" -> new")
|
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
final protected VimActionHandler makeActionHandler() {
|
|
||||||
return new ChangeEditorActionHandler.SingleExecution() {
|
|
||||||
@Override
|
|
||||||
final public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount,
|
|
||||||
@Nullable Argument argument) {
|
|
||||||
VimPlugin.getChange().insertBeforeCursor(editor, context);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Contract(pure = true)
|
@Contract(pure = true)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
@@ -77,4 +61,14 @@ final public class InsertBeforeCursorAction extends VimCommandAction {
|
|||||||
final public EnumSet<CommandFlags> getFlags() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return EnumSet.of(CommandFlags.FLAG_MULTIKEY_UNDO);
|
return EnumSet.of(CommandFlags.FLAG_MULTIKEY_UNDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
final public boolean execute(@NotNull Editor editor,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
int count,
|
||||||
|
int rawCount,
|
||||||
|
@Nullable Argument argument) {
|
||||||
|
VimPlugin.getChange().insertBeforeCursor(editor, context);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.insert;
|
package com.maddyhome.idea.vim.action.change.insert;
|
||||||
@@ -21,13 +21,11 @@ package com.maddyhome.idea.vim.action.change.insert;
|
|||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@@ -37,7 +35,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class InsertBeforeFirstNonBlankAction extends VimCommandAction {
|
public class InsertBeforeFirstNonBlankAction extends ChangeEditorActionHandler.SingleExecution {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -62,19 +60,13 @@ public class InsertBeforeFirstNonBlankAction extends VimCommandAction {
|
|||||||
return EnumSet.of(CommandFlags.FLAG_MULTIKEY_UNDO);
|
return EnumSet.of(CommandFlags.FLAG_MULTIKEY_UNDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.SingleExecution() {
|
@NotNull DataContext context,
|
||||||
@Override
|
int count,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
VimPlugin.getChange().insertBeforeFirstNonBlank(editor, context);
|
||||||
int rawCount,
|
return true;
|
||||||
@Nullable Argument argument) {
|
|
||||||
VimPlugin.getChange().insertBeforeFirstNonBlank(editor, context);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.insert;
|
package com.maddyhome.idea.vim.action.change.insert;
|
||||||
@@ -22,12 +22,10 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@@ -36,7 +34,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class InsertCharacterAboveCursorAction extends VimCommandAction {
|
public class InsertCharacterAboveCursorAction extends ChangeEditorActionHandler.ForEachCaret {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -55,23 +53,17 @@ public class InsertCharacterAboveCursorAction extends VimCommandAction {
|
|||||||
return Command.Type.INSERT;
|
return Command.Type.INSERT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.ForEachCaret() {
|
@NotNull Caret caret,
|
||||||
@Override
|
@NotNull DataContext context,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int count,
|
||||||
@NotNull Caret caret,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
if (editor.isOneLineMode()) {
|
||||||
int rawCount,
|
return false;
|
||||||
@Nullable Argument argument) {
|
}
|
||||||
if (editor.isOneLineMode()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return VimPlugin.getChange().insertCharacterAroundCursor(editor, caret, -1);
|
return VimPlugin.getChange().insertCharacterAroundCursor(editor, caret, -1);
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.insert;
|
package com.maddyhome.idea.vim.action.change.insert;
|
||||||
@@ -22,12 +22,10 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@@ -36,7 +34,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class InsertCharacterBelowCursorAction extends VimCommandAction {
|
public class InsertCharacterBelowCursorAction extends ChangeEditorActionHandler.ForEachCaret {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -55,23 +53,17 @@ public class InsertCharacterBelowCursorAction extends VimCommandAction {
|
|||||||
return Command.Type.INSERT;
|
return Command.Type.INSERT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.ForEachCaret() {
|
@NotNull Caret caret,
|
||||||
@Override
|
@NotNull DataContext context,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int count,
|
||||||
@NotNull Caret caret,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
if (editor.isOneLineMode()) {
|
||||||
int rawCount,
|
return false;
|
||||||
@Nullable Argument argument) {
|
}
|
||||||
if (editor.isOneLineMode()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return VimPlugin.getChange().insertCharacterAroundCursor(editor, caret, 1);
|
return VimPlugin.getChange().insertCharacterAroundCursor(editor, caret, 1);
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.insert;
|
package com.maddyhome.idea.vim.action.change.insert;
|
||||||
@@ -22,13 +22,11 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@@ -38,7 +36,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class InsertDeleteInsertedTextAction extends VimCommandAction {
|
public class InsertDeleteInsertedTextAction extends ChangeEditorActionHandler.ForEachCaret {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -63,19 +61,13 @@ public class InsertDeleteInsertedTextAction extends VimCommandAction {
|
|||||||
return EnumSet.of(CommandFlags.FLAG_CLEAR_STROKES);
|
return EnumSet.of(CommandFlags.FLAG_CLEAR_STROKES);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.ForEachCaret() {
|
@NotNull Caret caret,
|
||||||
@Override
|
@NotNull DataContext context,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int count,
|
||||||
@NotNull Caret caret,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
return VimPlugin.getChange().insertDeleteInsertedText(editor, caret);
|
||||||
int rawCount,
|
|
||||||
@Nullable Argument argument) {
|
|
||||||
return VimPlugin.getChange().insertDeleteInsertedText(editor, caret);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.insert;
|
package com.maddyhome.idea.vim.action.change.insert;
|
||||||
@@ -22,13 +22,11 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@@ -38,7 +36,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class InsertDeletePreviousWordAction extends VimCommandAction {
|
public class InsertDeletePreviousWordAction extends ChangeEditorActionHandler.ForEachCaret {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -63,19 +61,13 @@ public class InsertDeletePreviousWordAction extends VimCommandAction {
|
|||||||
return EnumSet.of(CommandFlags.FLAG_CLEAR_STROKES);
|
return EnumSet.of(CommandFlags.FLAG_CLEAR_STROKES);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.ForEachCaret() {
|
@NotNull Caret caret,
|
||||||
@Override
|
@NotNull DataContext context,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int count,
|
||||||
@NotNull Caret caret,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
return VimPlugin.getChange().insertDeletePreviousWord(editor, caret);
|
||||||
int rawCount,
|
|
||||||
@Nullable Argument argument) {
|
|
||||||
return VimPlugin.getChange().insertDeletePreviousWord(editor, caret);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.insert;
|
package com.maddyhome.idea.vim.action.change.insert;
|
||||||
@@ -21,7 +21,6 @@ package com.maddyhome.idea.vim.action.change.insert;
|
|||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
@@ -35,7 +34,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class InsertEnterAction extends VimCommandAction {
|
public class InsertEnterAction extends VimActionHandler.SingleExecution {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -60,15 +59,9 @@ public class InsertEnterAction extends VimCommandAction {
|
|||||||
return EnumSet.of(CommandFlags.FLAG_SAVE_STROKE);
|
return EnumSet.of(CommandFlags.FLAG_SAVE_STROKE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
||||||
return new VimActionHandler.SingleExecution() {
|
VimPlugin.getChange().processEnter(HelperKt.getTopLevelEditor(editor), context);
|
||||||
@Override
|
return true;
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
|
||||||
VimPlugin.getChange().processEnter(HelperKt.getTopLevelEditor(editor), context);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,18 +13,18 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.insert;
|
package com.maddyhome.idea.vim.action.change.insert;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.ActionManager;
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
|
import com.maddyhome.idea.vim.RegisterActions;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
|
import com.maddyhome.idea.vim.handler.EditorActionHandlerBase;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import org.jetbrains.annotations.Contract;
|
import org.jetbrains.annotations.Contract;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@@ -33,20 +33,12 @@ import javax.swing.*;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
final public class InsertExitModeAction extends VimCommandAction {
|
final public class InsertExitModeAction extends VimActionHandler.SingleExecution {
|
||||||
private static final String ACTION_ID = "VimInsertExitMode";
|
private static final String ACTION_ID = "VimInsertExitModeAction";
|
||||||
|
|
||||||
@Contract(" -> new")
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
public static EditorActionHandlerBase getInstance() {
|
||||||
final protected VimActionHandler makeActionHandler() {
|
return RegisterActions.findActionOrDie(ACTION_ID);
|
||||||
return new VimActionHandler.SingleExecution() {
|
|
||||||
@Override
|
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
|
||||||
VimPlugin.getChange().processEscape(editor, context);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Contract(pure = true)
|
@Contract(pure = true)
|
||||||
@@ -69,8 +61,9 @@ final public class InsertExitModeAction extends VimCommandAction {
|
|||||||
return Command.Type.INSERT;
|
return Command.Type.INSERT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@Override
|
||||||
public static VimCommandAction getInstance() {
|
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
||||||
return (VimCommandAction)ActionManager.getInstance().getAction(ACTION_ID);
|
VimPlugin.getChange().processEscape(editor, context);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.insert;
|
package com.maddyhome.idea.vim.action.change.insert;
|
||||||
@@ -21,7 +21,6 @@ package com.maddyhome.idea.vim.action.change.insert;
|
|||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
@@ -34,7 +33,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class InsertInsertAction extends VimCommandAction {
|
public class InsertInsertAction extends VimActionHandler.SingleExecution {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -59,15 +58,9 @@ public class InsertInsertAction extends VimCommandAction {
|
|||||||
return EnumSet.of(CommandFlags.FLAG_SAVE_STROKE);
|
return EnumSet.of(CommandFlags.FLAG_SAVE_STROKE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
||||||
return new VimActionHandler.SingleExecution() {
|
VimPlugin.getChange().processInsert(editor);
|
||||||
@Override
|
return true;
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
|
||||||
VimPlugin.getChange().processInsert(editor);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.insert;
|
package com.maddyhome.idea.vim.action.change.insert;
|
||||||
@@ -21,13 +21,11 @@ package com.maddyhome.idea.vim.action.change.insert;
|
|||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@@ -37,7 +35,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class InsertLineStartAction extends VimCommandAction {
|
public class InsertLineStartAction extends ChangeEditorActionHandler.SingleExecution {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -62,19 +60,13 @@ public class InsertLineStartAction extends VimCommandAction {
|
|||||||
return EnumSet.of(CommandFlags.FLAG_MULTIKEY_UNDO);
|
return EnumSet.of(CommandFlags.FLAG_MULTIKEY_UNDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.SingleExecution() {
|
@NotNull DataContext context,
|
||||||
@Override
|
int count,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
VimPlugin.getChange().insertLineStart(editor, context);
|
||||||
int rawCount,
|
return true;
|
||||||
@Nullable Argument argument) {
|
|
||||||
VimPlugin.getChange().insertLineStart(editor, context);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.insert;
|
package com.maddyhome.idea.vim.action.change.insert;
|
||||||
@@ -21,13 +21,11 @@ package com.maddyhome.idea.vim.action.change.insert;
|
|||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@@ -37,7 +35,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class InsertNewLineAboveAction extends VimCommandAction {
|
public class InsertNewLineAboveAction extends ChangeEditorActionHandler.SingleExecution {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -62,24 +60,18 @@ public class InsertNewLineAboveAction extends VimCommandAction {
|
|||||||
return EnumSet.of(CommandFlags.FLAG_MULTIKEY_UNDO);
|
return EnumSet.of(CommandFlags.FLAG_MULTIKEY_UNDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.SingleExecution() {
|
@NotNull DataContext context,
|
||||||
@Override
|
int count,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
if (editor.isOneLineMode()) {
|
||||||
int rawCount,
|
return false;
|
||||||
@Nullable Argument argument) {
|
}
|
||||||
if (editor.isOneLineMode()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
VimPlugin.getChange().insertNewLineAbove(editor, context);
|
VimPlugin.getChange().insertNewLineAbove(editor, context);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.insert;
|
package com.maddyhome.idea.vim.action.change.insert;
|
||||||
@@ -21,13 +21,11 @@ package com.maddyhome.idea.vim.action.change.insert;
|
|||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@@ -37,7 +35,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class InsertNewLineBelowAction extends VimCommandAction {
|
public class InsertNewLineBelowAction extends ChangeEditorActionHandler.SingleExecution {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -62,24 +60,18 @@ public class InsertNewLineBelowAction extends VimCommandAction {
|
|||||||
return EnumSet.of(CommandFlags.FLAG_MULTIKEY_UNDO);
|
return EnumSet.of(CommandFlags.FLAG_MULTIKEY_UNDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.SingleExecution() {
|
@NotNull DataContext context,
|
||||||
@Override
|
int count,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
if (editor.isOneLineMode()) {
|
||||||
int rawCount,
|
return false;
|
||||||
@Nullable Argument argument) {
|
}
|
||||||
if (editor.isOneLineMode()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
VimPlugin.getChange().insertNewLineBelow(editor, context);
|
VimPlugin.getChange().insertNewLineBelow(editor, context);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.insert;
|
package com.maddyhome.idea.vim.action.change.insert;
|
||||||
@@ -21,12 +21,10 @@ package com.maddyhome.idea.vim.action.change.insert;
|
|||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@@ -35,7 +33,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class InsertPreviousInsertAction extends VimCommandAction {
|
public class InsertPreviousInsertAction extends ChangeEditorActionHandler.SingleExecution {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -54,19 +52,13 @@ public class InsertPreviousInsertAction extends VimCommandAction {
|
|||||||
return Command.Type.INSERT;
|
return Command.Type.INSERT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.SingleExecution() {
|
@NotNull DataContext context,
|
||||||
@Override
|
int count,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
VimPlugin.getChange().insertPreviousInsert(editor, context, false);
|
||||||
int rawCount,
|
return true;
|
||||||
@Nullable Argument argument) {
|
|
||||||
VimPlugin.getChange().insertPreviousInsert(editor, context, false);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.insert;
|
package com.maddyhome.idea.vim.action.change.insert;
|
||||||
@@ -21,12 +21,10 @@ package com.maddyhome.idea.vim.action.change.insert;
|
|||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@@ -38,7 +36,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class InsertPreviousInsertExitAction extends VimCommandAction {
|
public class InsertPreviousInsertExitAction extends ChangeEditorActionHandler.SingleExecution {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -49,7 +47,8 @@ public class InsertPreviousInsertExitAction extends VimCommandAction {
|
|||||||
@Override
|
@Override
|
||||||
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
Set<List<KeyStroke>> keys = new HashSet<>();
|
Set<List<KeyStroke>> keys = new HashSet<>();
|
||||||
keys.add(Collections.singletonList(KeyStroke.getKeyStroke(KeyEvent.VK_2, KeyEvent.CTRL_MASK | KeyEvent.SHIFT_MASK)));
|
keys
|
||||||
|
.add(Collections.singletonList(KeyStroke.getKeyStroke(KeyEvent.VK_2, KeyEvent.CTRL_MASK | KeyEvent.SHIFT_MASK)));
|
||||||
keys.add(Collections.singletonList(KeyStroke.getKeyStroke(KeyEvent.VK_2, KeyEvent.CTRL_MASK)));
|
keys.add(Collections.singletonList(KeyStroke.getKeyStroke(KeyEvent.VK_2, KeyEvent.CTRL_MASK)));
|
||||||
keys.add(Collections.singletonList(KeyStroke.getKeyStroke(KeyEvent.VK_AT, KeyEvent.CTRL_MASK)));
|
keys.add(Collections.singletonList(KeyStroke.getKeyStroke(KeyEvent.VK_AT, KeyEvent.CTRL_MASK)));
|
||||||
return keys;
|
return keys;
|
||||||
@@ -61,19 +60,13 @@ public class InsertPreviousInsertExitAction extends VimCommandAction {
|
|||||||
return Command.Type.INSERT;
|
return Command.Type.INSERT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.SingleExecution() {
|
@NotNull DataContext context,
|
||||||
@Override
|
int count,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
VimPlugin.getChange().insertPreviousInsert(editor, context, true);
|
||||||
int rawCount,
|
return false;
|
||||||
@Nullable Argument argument) {
|
|
||||||
VimPlugin.getChange().insertPreviousInsert(editor, context, true);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.insert;
|
package com.maddyhome.idea.vim.action.change.insert;
|
||||||
@@ -21,7 +21,6 @@ package com.maddyhome.idea.vim.action.change.insert;
|
|||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
@@ -33,7 +32,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class InsertRegisterAction extends VimCommandAction {
|
public class InsertRegisterAction extends VimActionHandler.SingleExecution {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -58,15 +57,9 @@ public class InsertRegisterAction extends VimCommandAction {
|
|||||||
return Argument.Type.CHARACTER;
|
return Argument.Type.CHARACTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
||||||
return new VimActionHandler.SingleExecution() {
|
final Argument argument = cmd.getArgument();
|
||||||
@Override
|
return argument != null && VimPlugin.getChange().insertRegister(editor, context, argument.getCharacter());
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
|
||||||
final Argument argument = cmd.getArgument();
|
|
||||||
return argument != null && VimPlugin.getChange().insertRegister(editor, context, argument.getCharacter());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.insert;
|
package com.maddyhome.idea.vim.action.change.insert;
|
||||||
@@ -21,7 +21,6 @@ package com.maddyhome.idea.vim.action.change.insert;
|
|||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
@@ -34,7 +33,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class InsertSingleCommandAction extends VimCommandAction {
|
public class InsertSingleCommandAction extends VimActionHandler.SingleExecution {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -59,15 +58,9 @@ public class InsertSingleCommandAction extends VimCommandAction {
|
|||||||
return EnumSet.of(CommandFlags.FLAG_CLEAR_STROKES, CommandFlags.FLAG_EXPECT_MORE);
|
return EnumSet.of(CommandFlags.FLAG_CLEAR_STROKES, CommandFlags.FLAG_EXPECT_MORE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
||||||
return new VimActionHandler.SingleExecution() {
|
VimPlugin.getChange().processSingleCommand(editor);
|
||||||
@Override
|
return true;
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
|
||||||
VimPlugin.getChange().processSingleCommand(editor);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.insert;
|
package com.maddyhome.idea.vim.action.change.insert;
|
||||||
@@ -22,13 +22,11 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.command.SelectionType;
|
import com.maddyhome.idea.vim.command.SelectionType;
|
||||||
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
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.handler.VisualOperatorActionHandler;
|
||||||
import org.jetbrains.annotations.Contract;
|
import org.jetbrains.annotations.Contract;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@@ -42,31 +40,7 @@ import java.util.Set;
|
|||||||
/**
|
/**
|
||||||
* @author vlan
|
* @author vlan
|
||||||
*/
|
*/
|
||||||
final public class VisualBlockAppendAction extends VimCommandAction {
|
final public class VisualBlockAppendAction extends VisualOperatorActionHandler.SingleExecution {
|
||||||
@Contract(" -> new")
|
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
final protected VimActionHandler makeActionHandler() {
|
|
||||||
return new VisualOperatorActionHandler.SingleExecution() {
|
|
||||||
@Override
|
|
||||||
final public boolean executeForAllCarets(@NotNull Editor editor,
|
|
||||||
@NotNull DataContext context,
|
|
||||||
@NotNull Command cmd,
|
|
||||||
@NotNull Map<Caret, ? extends VimSelection> caretsAndSelections) {
|
|
||||||
if (editor.isOneLineMode()) return false;
|
|
||||||
VimSelection range = caretsAndSelections.values().stream().findFirst().orElse(null);
|
|
||||||
if (range == null) return false;
|
|
||||||
if (range.getType() == SelectionType.BLOCK_WISE) {
|
|
||||||
return VimPlugin.getChange().blockInsert(editor, context, range.toVimTextRange(false), true);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
VimPlugin.getChange().insertAfterLineEnd(editor, context);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Contract(pure = true)
|
@Contract(pure = true)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
@@ -93,4 +67,21 @@ final public class VisualBlockAppendAction extends VimCommandAction {
|
|||||||
final public EnumSet<CommandFlags> getFlags() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return EnumSet.of(CommandFlags.FLAG_MULTIKEY_UNDO, CommandFlags.FLAG_EXIT_VISUAL);
|
return EnumSet.of(CommandFlags.FLAG_MULTIKEY_UNDO, CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
final public boolean executeForAllCarets(@NotNull Editor editor,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull Map<Caret, ? extends VimSelection> caretsAndSelections) {
|
||||||
|
if (editor.isOneLineMode()) return false;
|
||||||
|
VimSelection range = caretsAndSelections.values().stream().findFirst().orElse(null);
|
||||||
|
if (range == null) return false;
|
||||||
|
if (range.getType() == SelectionType.BLOCK_WISE) {
|
||||||
|
return VimPlugin.getChange().blockInsert(editor, context, range.toVimTextRange(false), true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
VimPlugin.getChange().insertAfterLineEnd(editor, context);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.insert;
|
package com.maddyhome.idea.vim.action.change.insert;
|
||||||
@@ -22,13 +22,11 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.command.SelectionType;
|
import com.maddyhome.idea.vim.command.SelectionType;
|
||||||
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
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.handler.VisualOperatorActionHandler;
|
||||||
import org.jetbrains.annotations.Contract;
|
import org.jetbrains.annotations.Contract;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@@ -42,31 +40,7 @@ import java.util.Set;
|
|||||||
/**
|
/**
|
||||||
* @author vlan
|
* @author vlan
|
||||||
*/
|
*/
|
||||||
final public class VisualBlockInsertAction extends VimCommandAction {
|
final public class VisualBlockInsertAction extends VisualOperatorActionHandler.SingleExecution {
|
||||||
@Contract(" -> new")
|
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
final protected VimActionHandler makeActionHandler() {
|
|
||||||
return new VisualOperatorActionHandler.SingleExecution() {
|
|
||||||
@Override
|
|
||||||
final public boolean executeForAllCarets(@NotNull Editor editor,
|
|
||||||
@NotNull DataContext context,
|
|
||||||
@NotNull Command cmd,
|
|
||||||
@NotNull Map<Caret, ? extends VimSelection> caretsAndSelections) {
|
|
||||||
if (editor.isOneLineMode()) return false;
|
|
||||||
VimSelection vimSelection = caretsAndSelections.values().stream().findFirst().orElse(null);
|
|
||||||
if (vimSelection == null) return false;
|
|
||||||
if (vimSelection.getType() == SelectionType.BLOCK_WISE) {
|
|
||||||
return VimPlugin.getChange().blockInsert(editor, context, vimSelection.toVimTextRange(false), false);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
VimPlugin.getChange().insertBeforeFirstNonBlank(editor, context);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Contract(pure = true)
|
@Contract(pure = true)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
@@ -92,4 +66,21 @@ final public class VisualBlockInsertAction extends VimCommandAction {
|
|||||||
final public EnumSet<CommandFlags> getFlags() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return EnumSet.of(CommandFlags.FLAG_MULTIKEY_UNDO, CommandFlags.FLAG_EXIT_VISUAL);
|
return EnumSet.of(CommandFlags.FLAG_MULTIKEY_UNDO, CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
final public boolean executeForAllCarets(@NotNull Editor editor,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull Map<Caret, ? extends VimSelection> caretsAndSelections) {
|
||||||
|
if (editor.isOneLineMode()) return false;
|
||||||
|
VimSelection vimSelection = caretsAndSelections.values().stream().findFirst().orElse(null);
|
||||||
|
if (vimSelection == null) return false;
|
||||||
|
if (vimSelection.getType() == SelectionType.BLOCK_WISE) {
|
||||||
|
return VimPlugin.getChange().blockInsert(editor, context, vimSelection.toVimTextRange(false), false);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
VimPlugin.getChange().insertBeforeFirstNonBlank(editor, context);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.shift;
|
package com.maddyhome.idea.vim.action.change.shift;
|
||||||
@@ -22,12 +22,10 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@@ -36,7 +34,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class AutoIndentLinesAction extends VimCommandAction {
|
public class AutoIndentLinesAction extends ChangeEditorActionHandler.ForEachCaret {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -55,20 +53,14 @@ public class AutoIndentLinesAction extends VimCommandAction {
|
|||||||
return Command.Type.CHANGE;
|
return Command.Type.CHANGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.ForEachCaret() {
|
@NotNull Caret caret,
|
||||||
@Override
|
@NotNull DataContext context,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int count,
|
||||||
@NotNull Caret caret,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
VimPlugin.getChange().autoIndentLines(editor, caret, context, count);
|
||||||
int rawCount,
|
return true;
|
||||||
@Nullable Argument argument) {
|
|
||||||
VimPlugin.getChange().autoIndentLines(editor, caret, context, count);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.shift;
|
package com.maddyhome.idea.vim.action.change.shift;
|
||||||
@@ -22,13 +22,11 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@@ -40,7 +38,7 @@ import java.util.Set;
|
|||||||
/**
|
/**
|
||||||
* @author Aleksey Lagoshin
|
* @author Aleksey Lagoshin
|
||||||
*/
|
*/
|
||||||
public class AutoIndentMotionAction extends VimCommandAction {
|
public class AutoIndentMotionAction extends ChangeEditorActionHandler.ForEachCaret {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -71,20 +69,18 @@ public class AutoIndentMotionAction extends VimCommandAction {
|
|||||||
return Argument.Type.MOTION;
|
return Argument.Type.MOTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.ForEachCaret() {
|
@NotNull Caret caret,
|
||||||
@Override
|
@NotNull DataContext context,
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull Caret caret, @NotNull DataContext context, int count,
|
int count,
|
||||||
int rawCount, @Nullable Argument argument) {
|
int rawCount,
|
||||||
if (argument == null) {
|
@Nullable Argument argument) {
|
||||||
return false;
|
if (argument == null) {
|
||||||
}
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
VimPlugin.getChange().autoIndentMotion(editor, caret, context, count, rawCount, argument);
|
VimPlugin.getChange().autoIndentMotion(editor, caret, context, count, rawCount, argument);
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.shift
|
package com.maddyhome.idea.vim.action.change.shift
|
||||||
@@ -22,18 +22,16 @@ import com.intellij.openapi.actionSystem.DataContext
|
|||||||
import com.intellij.openapi.editor.Caret
|
import com.intellij.openapi.editor.Caret
|
||||||
import com.intellij.openapi.editor.Editor
|
import com.intellij.openapi.editor.Editor
|
||||||
import com.maddyhome.idea.vim.VimPlugin
|
import com.maddyhome.idea.vim.VimPlugin
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction
|
|
||||||
import com.maddyhome.idea.vim.command.Argument
|
import com.maddyhome.idea.vim.command.Argument
|
||||||
import com.maddyhome.idea.vim.command.Command
|
import com.maddyhome.idea.vim.command.Command
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags
|
import com.maddyhome.idea.vim.command.CommandFlags
|
||||||
import com.maddyhome.idea.vim.command.MappingMode
|
import com.maddyhome.idea.vim.command.MappingMode
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import javax.swing.KeyStroke
|
import javax.swing.KeyStroke
|
||||||
|
|
||||||
|
|
||||||
class ShiftLeftLinesAction : VimCommandAction() {
|
class ShiftLeftLinesAction : ChangeEditorActionHandler.ForEachCaret() {
|
||||||
override val mappingModes: Set<MappingMode> = MappingMode.I
|
override val mappingModes: Set<MappingMode> = MappingMode.I
|
||||||
|
|
||||||
override val keyStrokesSet: Set<List<KeyStroke>> = parseKeysSet("<C-D>")
|
override val keyStrokesSet: Set<List<KeyStroke>> = parseKeysSet("<C-D>")
|
||||||
@@ -42,20 +40,25 @@ class ShiftLeftLinesAction : VimCommandAction() {
|
|||||||
|
|
||||||
override val flags: EnumSet<CommandFlags> = EnumSet.of(CommandFlags.FLAG_SAVE_STROKE)
|
override val flags: EnumSet<CommandFlags> = EnumSet.of(CommandFlags.FLAG_SAVE_STROKE)
|
||||||
|
|
||||||
override fun makeActionHandler(): VimActionHandler = ShiftLeftLinesActionHandler
|
override fun execute(editor: Editor,
|
||||||
}
|
caret: Caret,
|
||||||
|
context: DataContext,
|
||||||
class ShiftLeftLinesNormalModeAction : VimCommandAction() {
|
count: Int,
|
||||||
override val mappingModes: Set<MappingMode> = MappingMode.N
|
rawCount: Int,
|
||||||
|
argument: Argument?): Boolean {
|
||||||
override val keyStrokesSet: Set<List<KeyStroke>> = parseKeysSet("<<")
|
VimPlugin.getChange().indentLines(editor, caret, context, count, -1)
|
||||||
|
|
||||||
override val type: Command.Type = Command.Type.CHANGE
|
return true
|
||||||
|
}
|
||||||
override fun makeActionHandler(): VimActionHandler = ShiftLeftLinesActionHandler
|
}
|
||||||
}
|
|
||||||
|
class ShiftLeftLinesNormalModeAction : ChangeEditorActionHandler.ForEachCaret() {
|
||||||
private object ShiftLeftLinesActionHandler : ChangeEditorActionHandler.ForEachCaret() {
|
override val mappingModes: Set<MappingMode> = MappingMode.N
|
||||||
|
|
||||||
|
override val keyStrokesSet: Set<List<KeyStroke>> = parseKeysSet("<<")
|
||||||
|
|
||||||
|
override val type: Command.Type = Command.Type.CHANGE
|
||||||
|
|
||||||
override fun execute(editor: Editor,
|
override fun execute(editor: Editor,
|
||||||
caret: Caret,
|
caret: Caret,
|
||||||
context: DataContext,
|
context: DataContext,
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.shift;
|
package com.maddyhome.idea.vim.action.change.shift;
|
||||||
@@ -22,13 +22,11 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@@ -38,7 +36,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class ShiftLeftMotionAction extends VimCommandAction {
|
public class ShiftLeftMotionAction extends ChangeEditorActionHandler.ForEachCaret {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
@@ -69,25 +67,19 @@ public class ShiftLeftMotionAction extends VimCommandAction {
|
|||||||
return EnumSet.of(CommandFlags.FLAG_OP_PEND);
|
return EnumSet.of(CommandFlags.FLAG_OP_PEND);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
protected VimActionHandler makeActionHandler() {
|
public boolean execute(@NotNull Editor editor,
|
||||||
return new ChangeEditorActionHandler.ForEachCaret() {
|
@NotNull Caret caret,
|
||||||
@Override
|
@NotNull DataContext context,
|
||||||
public boolean execute(@NotNull Editor editor,
|
int count,
|
||||||
@NotNull Caret caret,
|
int rawCount,
|
||||||
@NotNull DataContext context,
|
@Nullable Argument argument) {
|
||||||
int count,
|
if (argument != null) {
|
||||||
int rawCount,
|
VimPlugin.getChange().indentMotion(editor, caret, context, count, rawCount, argument, -1);
|
||||||
@Nullable Argument argument) {
|
return true;
|
||||||
if (argument != null) {
|
}
|
||||||
VimPlugin.getChange().indentMotion(editor, caret, context, count, rawCount, argument, -1);
|
else {
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.shift;
|
package com.maddyhome.idea.vim.action.change.shift;
|
||||||
@@ -22,12 +22,10 @@ import com.intellij.openapi.actionSystem.DataContext;
|
|||||||
import com.intellij.openapi.editor.Caret;
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
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.handler.VisualOperatorActionHandler;
|
||||||
import org.jetbrains.annotations.Contract;
|
import org.jetbrains.annotations.Contract;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@@ -40,24 +38,7 @@ import java.util.Set;
|
|||||||
/**
|
/**
|
||||||
* @author vlan
|
* @author vlan
|
||||||
*/
|
*/
|
||||||
final public class ShiftLeftVisualAction extends VimCommandAction {
|
final public class ShiftLeftVisualAction extends VisualOperatorActionHandler.ForEachCaret {
|
||||||
@Contract(" -> new")
|
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
final protected VimActionHandler makeActionHandler() {
|
|
||||||
return new VisualOperatorActionHandler.ForEachCaret() {
|
|
||||||
@Override
|
|
||||||
public boolean executeAction(@NotNull Editor editor,
|
|
||||||
@NotNull Caret caret,
|
|
||||||
@NotNull DataContext context,
|
|
||||||
@NotNull Command cmd,
|
|
||||||
@NotNull VimSelection range) {
|
|
||||||
VimPlugin.getChange().indentRange(editor, caret, context, range.toVimTextRange(false), cmd.getCount(), -1);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Contract(pure = true)
|
@Contract(pure = true)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
@@ -83,4 +64,14 @@ final public class ShiftLeftVisualAction extends VimCommandAction {
|
|||||||
final public EnumSet<CommandFlags> getFlags() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return EnumSet.of(CommandFlags.FLAG_EXIT_VISUAL);
|
return EnumSet.of(CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean executeAction(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull VimSelection range) {
|
||||||
|
VimPlugin.getChange().indentRange(editor, caret, context, range.toVimTextRange(false), cmd.getCount(), -1);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.shift
|
package com.maddyhome.idea.vim.action.change.shift
|
||||||
@@ -22,18 +22,16 @@ import com.intellij.openapi.actionSystem.DataContext
|
|||||||
import com.intellij.openapi.editor.Caret
|
import com.intellij.openapi.editor.Caret
|
||||||
import com.intellij.openapi.editor.Editor
|
import com.intellij.openapi.editor.Editor
|
||||||
import com.maddyhome.idea.vim.VimPlugin
|
import com.maddyhome.idea.vim.VimPlugin
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction
|
|
||||||
import com.maddyhome.idea.vim.command.Argument
|
import com.maddyhome.idea.vim.command.Argument
|
||||||
import com.maddyhome.idea.vim.command.Command
|
import com.maddyhome.idea.vim.command.Command
|
||||||
import com.maddyhome.idea.vim.command.CommandFlags
|
import com.maddyhome.idea.vim.command.CommandFlags
|
||||||
import com.maddyhome.idea.vim.command.MappingMode
|
import com.maddyhome.idea.vim.command.MappingMode
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import javax.swing.KeyStroke
|
import javax.swing.KeyStroke
|
||||||
|
|
||||||
|
|
||||||
class ShiftRightLinesAction : VimCommandAction() {
|
class ShiftRightLinesAction : ChangeEditorActionHandler.ForEachCaret() {
|
||||||
override val mappingModes: Set<MappingMode> = MappingMode.I
|
override val mappingModes: Set<MappingMode> = MappingMode.I
|
||||||
|
|
||||||
override val keyStrokesSet: Set<List<KeyStroke>> = parseKeysSet("<C-T>")
|
override val keyStrokesSet: Set<List<KeyStroke>> = parseKeysSet("<C-T>")
|
||||||
@@ -42,20 +40,25 @@ class ShiftRightLinesAction : VimCommandAction() {
|
|||||||
|
|
||||||
override val flags: EnumSet<CommandFlags> = EnumSet.of(CommandFlags.FLAG_SAVE_STROKE)
|
override val flags: EnumSet<CommandFlags> = EnumSet.of(CommandFlags.FLAG_SAVE_STROKE)
|
||||||
|
|
||||||
override fun makeActionHandler(): VimActionHandler = ShiftRightLinesActionHandler
|
override fun execute(editor: Editor,
|
||||||
|
caret: Caret,
|
||||||
|
context: DataContext,
|
||||||
|
count: Int,
|
||||||
|
rawCount: Int,
|
||||||
|
argument: Argument?): Boolean {
|
||||||
|
VimPlugin.getChange().indentLines(editor, caret, context, count, -1)
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ShiftRightLinesNormalModeAction : VimCommandAction() {
|
class ShiftRightLinesNormalModeAction : ChangeEditorActionHandler.ForEachCaret() {
|
||||||
override val mappingModes: Set<MappingMode> = MappingMode.N
|
override val mappingModes: Set<MappingMode> = MappingMode.N
|
||||||
|
|
||||||
override val keyStrokesSet: Set<List<KeyStroke>> = parseKeysSet(">>")
|
override val keyStrokesSet: Set<List<KeyStroke>> = parseKeysSet(">>")
|
||||||
|
|
||||||
override val type: Command.Type = Command.Type.CHANGE
|
override val type: Command.Type = Command.Type.CHANGE
|
||||||
|
|
||||||
override fun makeActionHandler(): VimActionHandler = ShiftRightLinesActionHandler
|
|
||||||
}
|
|
||||||
|
|
||||||
private object ShiftRightLinesActionHandler : ChangeEditorActionHandler.ForEachCaret() {
|
|
||||||
override fun execute(editor: Editor, caret: Caret, context: DataContext, count: Int,
|
override fun execute(editor: Editor, caret: Caret, context: DataContext, count: Int,
|
||||||
rawCount: Int, argument: Argument?): Boolean {
|
rawCount: Int, argument: Argument?): Boolean {
|
||||||
VimPlugin.getChange().indentLines(editor, caret, context, count, 1)
|
VimPlugin.getChange().indentLines(editor, caret, context, count, 1)
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user