1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2024-10-18 01:42:46 +02:00

Compare commits

..

440 Commits

Author SHA1 Message Date
filipp
9dbe3c3363 Fix(VIM-308) Undo requires one more step if the cursor is not at the position where it was after undo 2022-06-16 18:50:42 +06:00
filipp
8a98f46235 Move mapDepth to MappingState 2022-06-15 16:22:31 +06:00
filipp
9ed8db4d4a Add oldundo option 2022-06-15 16:06:47 +06:00
Alex Plate
5b94276836
Move more methods to vim-engine 2022-06-15 12:58:15 +03:00
filipp
f1e427e2ff Fix command history 2022-06-14 22:10:04 +06:00
filipp
a112cfe35f Add count to undo/redo 2022-06-14 18:47:16 +06:00
filipp
412b60d6b4 Fix selection after undo 2022-06-14 18:36:14 +06:00
Alex Plate
11d9ef7507
Partially move change group to vim-engine 2022-06-14 10:31:23 +03:00
Alex Plate
ca143272f3 Update changelog 2022-06-13 09:54:32 +00:00
Alex Plate
072449825c
Fix(VIM-2675): Fix numbering register in visual mode 2022-06-13 12:53:05 +03:00
Alex Plate
38ed9c206a
Fix compilation 2022-06-13 12:53:05 +03:00
Alex Plate
8235a649a1
Move VisualMotionGroup to vim-engine 2022-06-13 12:53:05 +03:00
Alex Plate
09efdd076e
Remove unused method 2022-06-13 12:53:05 +03:00
Alex Plate
da9b6ea762 Update formatting 2022-06-12 00:17:39 +00:00
Alex Plate
437450a93b
Fix long running test 2022-06-10 16:01:13 +03:00
Alex Plate
50fff8871e Update changelog 2022-06-10 12:28:35 +00:00
Alex Plate
350e9cfca2
Fix(VIM-2595): Support plugins in macro execution 2022-06-10 15:27:03 +03:00
Alex Plate
5639edf173
Refactor mapping stack 2022-06-10 15:27:03 +03:00
Alex Plate
f72313df9c
Fix(VIM-2671): Fix using plugins from mappings 2022-06-10 15:27:03 +03:00
filipp
f52eb5e124 Update formatting 2022-06-10 00:07:27 +06:00
filipp
5da9c5e1cd Move variableService logic to base class 2022-06-09 23:54:43 +06:00
filipp
53fdd891fb Move optionService logic to base class 2022-06-09 02:17:40 +06:00
filipp
94820d7a83 Update formatting 2022-06-08 20:04:50 +06:00
Alex Plate
fe66d06ce2
Move VimMark to vim-injector 2022-06-08 12:06:45 +03:00
Alex Plate
b6e917a2d7
Get rid of DialogDataContext
Actually, it was removed for some time already.
Caused this exception: https://web.ea.pages.jetbrains.team/#/issue/533401
2022-06-07 16:40:38 +03:00
Alex Plate
a6a39d249b
Move key group to vim-engine 2022-06-07 15:53:31 +03:00
Alex Plate
518784c371
Use ShortcutOwnerInfo in savedShortcuts 2022-06-07 15:53:30 +03:00
filipp
51c50cb902 Update formatting 2022-06-07 04:00:06 +06:00
filipp
6355d7765e Add documentation to OptionService.kt and fix some exception messages 2022-06-07 03:59:23 +06:00
filipp
c083631590 Undo changing ideaVersion 2022-06-07 01:13:07 +06:00
filipp
f62575c870 Fix bugs with appending/prepending/removing value from string option 2022-06-07 01:09:19 +06:00
filipp
01e367cadf Delete deprecated OptionsManager.kt 2022-06-07 01:08:10 +06:00
Alex Plate
e248bb5565 Update formatting 2022-06-05 00:23:42 +00:00
filipp
1744ec74c7 Add some info to the Map command 2022-06-05 00:12:09 +06:00
filipp
905f8003da Fix repeating the @@ command 2022-06-04 01:02:01 +06:00
filipp
3b3a036806 Remove StringHelper.kt & CommonStringHelper.kt 2022-06-03 22:22:49 +06:00
Alex Plate
ccf48d1e53
Add some more notes to injector about it's status 2022-06-01 13:59:51 +03:00
Alex Plate
d7a74fdf5e
Mark the states of the injector 2022-05-31 10:44:00 +03:00
Alex Plate
462c1bc75e
Fix resetting the modes to empty state 2022-05-31 10:20:31 +03:00
Alex Plate
96b05dcc94
Mute some neovim tests 2022-05-31 09:54:34 +03:00
Alex Plate
ceafe9d4e7
Rename base for property tests 2022-05-31 09:31:00 +03:00
Alex Plate
fc9b09cf72
Update ij plugin to 1.6.0 2022-05-31 09:29:40 +03:00
filipp
11c80b2ea9 Fix cast :action mappings to <Action> 2022-05-30 16:22:40 +06:00
filipp
eb536766db Fix exception during parsing of empty stings 2022-05-30 15:34:17 +06:00
Alex Plate
f3b6687d79
Update kotlin version 2022-05-30 11:22:24 +03:00
Alex Plate
adf483a748
Enable property based and long running tests 2022-05-30 09:52:12 +03:00
Alex Plate
7332cd1ed1
Start implementing Troubleshooter 2022-05-30 09:52:11 +03:00
Alex Plate
7726f4347b
Unmap removed mappings after using ReloadVimRc action 2022-05-30 09:52:11 +03:00
Alex Plate
ee092d988b Update formatting 2022-05-29 00:17:16 +00:00
Alex Plate
b3db3bb940
Add a note that :action should not be used in mappings 2022-05-26 11:05:00 +03:00
Alex Plate
edcb17a436
Update changes 2022-05-26 11:05:00 +03:00
filipp
f3b4933ef2 Fix number options 2022-05-25 19:33:40 +06:00
Alex Plate
c6fdf9cdf4
[VIM-2643]: Implement a redo-register feature 2022-05-25 11:30:55 +03:00
Alex Plate
2244d0f776
Downgrade intellij-plugin due to https://github.com/JetBrains/gradle-intellij-plugin/issues/998 2022-05-25 11:30:54 +03:00
Matt Ellis
d7c4e4a8dd Add support for "-Command" flag for powershell
Fixes VIM-2622
2022-05-25 11:30:36 +03:00
Matt Ellis
b7c54d02cb Fix minor scroll bug
If caret is less than 'sidescrolloff' columns from the left of the screen, moving down one line will animate. Greater than 'sidescrolloff' does not animate. This is because the scroll model tries to scroll to a negative horizontal offset, to try and put the caret in the middle of the screen. This isn't possible, but the scroll model sees a large enough distance to trigger an animation.
2022-05-25 11:30:36 +03:00
Alex Plate
620eca3a0d
Correctly fix the test 2022-05-24 15:16:45 +03:00
Alex Plate
aa3b2e988f
Update TC constant 2022-05-24 15:14:36 +03:00
Alex Plate
753f589ea5
Mark a test as VimBehDiffers 2022-05-24 14:34:34 +03:00
Alex Plate
831e4e8c42
Fix services initialization in VimInjectorBase 2022-05-24 13:49:01 +03:00
Alex Plate
329722f338
Turn off experimental api 2022-05-24 13:05:12 +03:00
filipp
2ff429cc76 Update changelog 2022-05-23 22:54:51 +06:00
filipp
47d4aee986 Support return without expression 2022-05-23 22:47:47 +06:00
filipp
938325b93e Update formatting 2022-05-23 21:02:39 +06:00
filipp
12d0a2ffb7 Update gradle & gradle wrapper 2022-05-23 21:00:52 +06:00
filipp
4ff7e9aefa Move some logic to base classes 2022-05-23 21:00:32 +06:00
filipp
f52792e7f0 Move Regexp from engine 2022-05-23 00:10:57 +06:00
filipp
cbc6662ef7 Update formatting 2022-05-08 21:10:40 +06:00
filipp
26ffc2ad32 Move some classes to vim-engine 2022-05-08 21:09:52 +06:00
filipp
df32e573b0 Move some classes to vim-engine 2022-05-08 15:49:53 +06:00
filipp
19647d96b2 Move some classes to vim-engine 2022-05-08 12:23:14 +06:00
Alex Plate
b1714a2fc1 Update formatting 2022-05-08 00:16:10 +00:00
filipp
83199d5475 Move some classes to vim-engine 2022-05-07 22:45:52 +06:00
Alex Plate
4c0af66dff Update formatting 2022-05-01 00:20:06 +00:00
Alex Plate
ccd7204b21
Update changelog 2022-04-27 10:56:37 +03:00
Alex Plate
b82f1e6602
Move more classes to vim-engine 2022-04-27 10:40:44 +03:00
Alex Plate
4104258219
Move playbackregister to vim-engine 2022-04-26 14:21:10 +03:00
Alex Plate
11054f908b
Move some classes from file package to vim-engine 2022-04-26 10:02:23 +03:00
Alex Plate
e0dc6f7214 Update changelog 2022-04-25 11:44:22 +00:00
Alex Plate
735686c415
Update TC constant 2022-04-25 14:42:24 +03:00
Alex Plate
385bcbc383
fix(VIM-2604): Update action execution rules 2022-04-25 14:41:32 +03:00
aleksei.plate
f273620466 TeamCity change in 'IntelliJ IDEA plugins / IdeaVim' project: runners of 'Qodana checks' build configuration were updated 2022-04-25 07:11:28 +00:00
Alex Plate
acb27d5ccc
[TC] Update qodana configs 2022-04-25 09:45:49 +03:00
Alex Plate
62c79e1470
Move yank package to vim-engine 2022-04-25 09:45:48 +03:00
Alex Plate
1a99918819
Move some put actions to vim-engine 2022-04-25 09:45:48 +03:00
Alex Plate
7e3a9e0b38
Move window actions to vim-engine 2022-04-25 09:45:48 +03:00
Alex Plate
f51d74f2b8
Use correct name of notifications toolwindow for Track Action Ids 2022-04-25 09:45:24 +03:00
Alex Plate
987cba6072
Change implementation of configurable for lazy loading 2022-04-25 09:45:24 +03:00
Alex Plate
770e6371df
Rename .java to .kt 2022-04-25 09:45:24 +03:00
Alex Plate
30e660cf19
Update changelog 2022-04-25 09:45:24 +03:00
Alex Plate
8ccf0b5364
Update changelog 2022-04-25 09:45:23 +03:00
filipp
3ef86186eb Fix parsing strings with \r in the end 2022-04-25 00:30:56 +06:00
filipp
b8b3669b04 Fix antlr4 and antlr4-runtime dependency version conflict 2022-04-24 19:33:21 +06:00
Alex Plate
ac41890759 Update formatting 2022-04-24 00:15:29 +00:00
dependabot[bot]
cf85e0f25e Bump github-api from 1.303 to 1.305
Bumps [github-api](https://github.com/hub4j/github-api) from 1.303 to 1.305.
- [Release notes](https://github.com/hub4j/github-api/releases)
- [Changelog](https://github.com/hub4j/github-api/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hub4j/github-api/compare/github-api-1.303...github-api-1.305)

---
updated-dependencies:
- dependency-name: org.kohsuke:github-api
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-21 10:45:24 +03:00
dependabot[bot]
a4b52be833 Bump antlr4-runtime from 4.9.3 to 4.10.1
Bumps [antlr4-runtime](https://github.com/antlr/antlr4) from 4.9.3 to 4.10.1.
- [Release notes](https://github.com/antlr/antlr4/releases)
- [Changelog](https://github.com/antlr/antlr4/blob/master/CHANGES.txt)
- [Commits](https://github.com/antlr/antlr4/compare/4.9.3...4.10.1)

---
updated-dependencies:
- dependency-name: org.antlr:antlr4-runtime
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-21 10:45:13 +03:00
dependabot[bot]
4cb8f27ca5 Bump org.jetbrains.intellij from 1.5.2 to 1.5.3
Bumps org.jetbrains.intellij from 1.5.2 to 1.5.3.

---
updated-dependencies:
- dependency-name: org.jetbrains.intellij
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-21 10:44:59 +03:00
Matt Ellis
9a06ee97c4 Refactor CaretVisualAttributesHelper 2022-04-21 10:36:15 +03:00
Matt Ellis
d7dfc6dc05 Remove pre-212 caret attribute helpers 2022-04-21 10:36:15 +03:00
Alex Pláte
5a6de3afaa
Merge pull request #493 from citizenmatt/feature/commentary
Improvements to Commentary extension
2022-04-21 10:28:30 +03:00
Matt Ellis
cd242511a8
Fallback to line comment if block is unavailable
Fixes VIM-2381
2022-04-20 12:37:11 +01:00
Matt Ellis
745ae6caa4
Migrate Commentary tests to VimTestCase 2022-04-20 12:23:17 +01:00
Matt Ellis
acc7d0954d
Maintain old mappings for compatibility 2022-04-20 00:16:22 +01:00
Alex Plate
330d64c7cb
Move mark package to vim-engine 2022-04-19 18:43:33 +03:00
Alex Plate
673e43dd77
Move scroll package to vim-engine 2022-04-19 10:20:15 +03:00
Alex Plate
c2c5c60899
Move select package to vim-engine 2022-04-19 09:56:38 +03:00
Matt Ellis
7d5176829b
Merge branch 'master' into feature/commentary 2022-04-18 17:12:02 +01:00
Matt Ellis
fd0dc0d445
Remove unnecessary setting of sub mode 2022-04-15 13:36:44 +01:00
Matt Ellis
be11317667
Use comment actions instead of low level handlers 2022-04-13 10:53:25 +01:00
Matt Ellis
22fce51640
Fix Exchange tests after operator changes
OperatorAction no longer normalises linewise ranges, but Exchange doesn't need this
2022-04-12 23:47:46 +01:00
Matt Ellis
4223da47d6
Refactor and simplify Commentary objects
Also introduces Visual support for the `g@` operator action
2022-04-12 22:05:48 +01:00
Matt Ellis
64100fea59
Add Commentary command 2022-04-12 16:53:21 +01:00
Matt Ellis
2244c65233
Reposition caret after commenting 2022-04-12 16:26:28 +01:00
Matt Ellis
e08bffd7ba
Add gcu mapping 2022-04-12 15:33:24 +01:00
Matt Ellis
0d5aa52af2
Add gc text object
Fixes VIM-2589
2022-04-12 15:33:23 +01:00
filipp
e617fc4c34 Move some classes from vimscript package to engine 2022-04-10 15:57:46 +06:00
Alex Plate
c34a7f123d Update formatting 2022-04-10 00:15:21 +00:00
Matt Ellis
cc029fc98e
Implement gcc as gc_ motion
gcc now respects count

Fixes VIM-1687
2022-04-08 16:50:10 +01:00
Matt Ellis
feae15c48c
Use same mapping as Commentary plugin 2022-04-08 16:47:54 +01:00
Matt Ellis
07485727c4
Use Kotlin helper functions 2022-04-08 16:46:08 +01:00
Matt Ellis
8b0ad7680b
Rearrange code 2022-04-08 16:44:04 +01:00
Matt Ellis
43d70cd467
Convert to Kotlin 2022-04-08 16:35:03 +01:00
Matt Ellis
d73b605ef0
Rename Java to Kotlin 2022-04-08 16:32:59 +01:00
aleksei.plate
5afd4df69a TeamCity change in 'IntelliJ IDEA plugins / IdeaVim' project: 'Tests with nvim' build configuration settings were updated 2022-04-08 07:08:06 +00:00
aleksei.plate
323c611f87 TeamCity change in 'IntelliJ IDEA plugins / IdeaVim' project: 'Qodana checks' build configuration settings were updated 2022-04-08 07:07:47 +00:00
aleksei.plate
0dd0a4976b TeamCity change in 'IntelliJ IDEA plugins / IdeaVim' project: 'Plugin verification' build configuration settings were updated 2022-04-08 06:58:58 +00:00
Alex Plate
48820d4dff
Fix compilation 2022-04-08 09:54:52 +03:00
Alex Plate
2fbab395f1
Fix incorrect code 2022-04-08 09:54:43 +03:00
filipp
a9fd32f64e Move some actions from change.insert 2022-04-07 23:49:18 +06:00
filipp
da7a2226d4 Move actions from change.shift 2022-04-07 23:49:18 +06:00
filipp
44b37339dc Moved actions from change.delete 2022-04-07 23:49:18 +06:00
Alex Plate
db1ec29470
Update plugin verifier version 2022-04-07 15:44:23 +03:00
filipp
713c3f0a3c Moved some actions from change.change package 2022-04-07 17:50:10 +06:00
Alex Plate
c6c2bc5e74
Update changelog 2022-04-07 12:03:25 +03:00
Alex Plate
c8352158b8
Add a note about the refactoring 2022-04-07 12:03:24 +03:00
dependabot[bot]
8927c0acfa Bump github-api from 1.301 to 1.303
Bumps [github-api](https://github.com/hub4j/github-api) from 1.301 to 1.303.
- [Release notes](https://github.com/hub4j/github-api/releases)
- [Changelog](https://github.com/hub4j/github-api/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hub4j/github-api/compare/github-api-1.301...github-api-1.303)

---
updated-dependencies:
- dependency-name: org.kohsuke:github-api
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-07 12:03:18 +03:00
dependabot[bot]
02dfac8a34 Bump markdown from 0.2.4 to 0.3.1
Bumps [markdown](https://github.com/JetBrains/markdown) from 0.2.4 to 0.3.1.
- [Release notes](https://github.com/JetBrains/markdown/releases)
- [Commits](https://github.com/JetBrains/markdown/commits)

---
updated-dependencies:
- dependency-name: org.jetbrains:markdown
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-07 11:57:50 +03:00
Martin Yzeiri
8ab3664992 Matchit: Add CMake Patterns 2022-04-07 11:55:31 +03:00
Martin Yzeiri
03e6101747 Matchit: Add GNU Make Patterns 2022-04-07 11:55:31 +03:00
Martin Yzeiri
9f47995c10 Matchit: Add C patterns 2022-04-07 11:55:31 +03:00
Martin Yzeiri
d58f36ea1a Matchit: Enhance pattern creation
The new LanguagePatterns class lets us easily configure the patterns for
a language in a similar way to the original plugin. Most language
features can be configured by passing strings to the alternate
constructor. And the overloaded + operator makes combining patterns easy.

findMatchingPair() was refactored to work with the new class.

In addition, the concept of prefixes was removed. The cursor should jump
if it's anywhere inside or before an extended pair (excluding the
default pairs). Instead of appending a prefix to each regex, we simply
check in findMatchingPair() what the closest pair to the cursor is. The
original plugin behaves the same way.

We prefer matches containing the cursor over matches after the cursor.
If the cursor in inside multiple patterns, we pick the smaller one. And
a default pair after the cursor is preferred over any extended pairs
after the cursor.
2022-04-07 11:55:31 +03:00
Martin Yzeiri
442970a986 Matchit: Refactor parsePatternAtOffset()
The ending offset of the initial match isn't enough information for some
language features. For example, if the cursor is on "i" in the "else if"
of a Makefile, the previous implementation would jump to the "else" on a
reverse jump instead of treating "else if" as a single structure.

parsePatternAtOffset() needs to return both the match start and end for
us to correctly handle such a distinction.
2022-04-07 11:55:31 +03:00
Martin Yzeiri
fcc6c8a3c5 Matchit: Simplify findClosingPair() and findOpeningPair()
findClosingPair() always moves forward and findOpeningPair() always
moves backwards. That fact lets us simplify both implementations.

Using a stack of Pairs to track the match starts and ends is unnecessary 
since we know ahead of time whether the jump needs to go to the start or
end of the target pair.

findOpeningPair() can be further simplified since it doesn't need to
check the isInOpPending flag -- the distinction between operator pending
mode and regular jumps only matters when moving forward in the buffer.
2022-04-07 11:55:31 +03:00
Martin Yzeiri
1dbd4b4391 Matchit: Use setOf for sets 2022-04-07 11:55:31 +03:00
dependabot[bot]
1943c72c1c Bump org.eclipse.jgit from 6.0.0.202111291000-r to 6.1.0.202203080745-r
Bumps org.eclipse.jgit from 6.0.0.202111291000-r to 6.1.0.202203080745-r.

---
updated-dependencies:
- dependency-name: org.eclipse.jgit:org.eclipse.jgit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-07 11:39:05 +03:00
dependabot[bot]
7816da3f2d Bump org.jetbrains.changelog from 1.3.0 to 1.3.1
Bumps org.jetbrains.changelog from 1.3.0 to 1.3.1.

---
updated-dependencies:
- dependency-name: org.jetbrains.changelog
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-07 11:38:33 +03:00
Alex Plate
b25d7e358d
Update gradle plugin 2022-04-05 12:36:31 +03:00
filipp
04b62e6392 Update changelog 2022-04-05 14:20:05 +06:00
Alex Plate
4ecfb796d4
Move some classes of scroll package to vim-engine 2022-04-04 23:53:14 +03:00
Alex Plate
de9fa81da3
Move objects to vim-engine 2022-04-04 23:53:14 +03:00
Alex Plate
be484d381c Update changelog 2022-04-04 19:50:19 +00:00
Alex Plate
351e3b15ea
Move leftright package to vim-engine 2022-04-04 22:48:41 +03:00
Alex Plate
2b9b48ac2f
Split PutGroup into base class 2022-04-03 23:48:21 +03:00
Alex Plate
7c4ac5f561
Move toggle recording to vim-engine 2022-04-03 23:39:41 +03:00
Alex Plate
def09b0be8 Update formatting 2022-04-03 00:15:00 +00:00
Alex Plate
2415b167fb Add Simon Rainer to contributors list 2022-04-02 07:54:35 +00:00
Simon Rainer
dfc7aef07d Fix(VIM-2553): Substitute consecutive matches
We need to set newend after the content of match is final, otherwise we
can end up in an endless loop. This allows us to remove the
startoff != latestOff check that previously prevented this endless
loop and caused this bug.
2022-04-02 13:52:58 +06:00
Alex Plate
276ad276ec
Move few more classes to vim-engine 2022-03-30 18:44:38 +03:00
Alex Plate
83da2d304e
Move some actions to vim-engine 2022-03-30 18:36:32 +03:00
Alex Plate
6ddc40d080
Move folder actions to vim-engine 2022-03-30 13:52:27 +03:00
Alex Plate
42fb5487e5
Move gn package to vim-engine 2022-03-30 13:48:06 +03:00
Alex Plate
1ce35ac233
Move updown package to vim-engine 2022-03-30 13:20:40 +03:00
Alex Plate
2734202e12
Move visual package to vim-engine 2022-03-29 19:10:19 +03:00
Alex Plate
6a31fd2732
Move text package to vim-engine 2022-03-29 17:54:17 +03:00
Alex Plate
5d84aa6939
Move some actions to engine 2022-03-29 17:43:43 +03:00
Alex Plate
7173b7960d
Move MotionSentenceEndAction to vim-engine 2022-03-29 16:17:14 +03:00
Alex Plate
bb1c30d6c8
Move paragraph action to vim-engine 2022-03-29 15:01:11 +03:00
Alex Plate
d70abf6e27
Move an action to a different module 2022-03-29 14:48:43 +03:00
Alex Plate
8931fdf82a
Fix incorrect tests 2022-03-29 12:45:17 +03:00
Alex Plate
25ba72e46b
Reformat code 2022-03-29 12:25:37 +03:00
Alex Plate
ebd71d41dc
Update TC constant 2022-03-29 12:23:08 +03:00
Alex Plate
4b49bb4737
Fix ]] and ][ commands
Discussion: 486
2022-03-29 12:12:48 +03:00
Alex Plate
eeac47e522
Fix neovim tests 2022-03-29 12:12:34 +03:00
Alex Plate
335267c0af
Update gradle wrapper 2022-03-29 12:12:19 +03:00
Alex Plate
c4254dc6dd
Refactor history group 2022-03-29 11:08:21 +03:00
Alex Plate
12cb359967 Update changelog 2022-03-28 15:07:36 +00:00
Alex Plate
d73cb274b4
Refactoring of some methods 2022-03-28 18:06:05 +03:00
Alex Plate
6cb6afe032
Fix(VIM-2590): Fix caret shape in PyCharm 2022-03-28 17:01:49 +03:00
Alex Plate
3686f0eb24
Update some usages 2022-03-28 16:10:58 +03:00
Alex Plate
6cc24fe99e
Convert VimActionHandler to using VimEditor 2022-03-28 16:10:58 +03:00
Alex Plate
3784f1957f
Some refactoring of change group 2022-03-28 16:09:25 +03:00
Alex Plate
69fd8d68af
Small refactoring of change group 2022-03-28 16:09:25 +03:00
Alex Plate
301d72c169
Refactor Direction class 2022-03-28 16:09:24 +03:00
Alex Plate
ca11974b12
Move all methods to the base class 2022-03-28 16:09:24 +03:00
Alex Plate
8917dbf4bb Update formatting 2022-03-27 00:15:32 +00:00
Alex Plate
56afa6d564
Move some methods of marks group to engine 2022-03-26 01:38:03 +03:00
Alex Plate
8ecac1a8cf
Start moving mark group to vim-engine 2022-03-26 01:05:05 +03:00
Alex Plate
f742e414e6
Extract vim mark constants into the separate file 2022-03-25 16:44:10 +03:00
Alex Plate
c462af2d10
Small refactoring 2022-03-25 16:22:39 +03:00
Alex Plate
66ede93d95
Close some fields of VimRegisterGroupBase.kt 2022-03-25 16:21:50 +03:00
Alex Plate
c97f5be3fa
Small refactoring of VimRegisterGroupBase.kt 2022-03-25 16:11:08 +03:00
Alex Plate
c4d35849fd
Move listener to base 2022-03-25 15:30:45 +03:00
Alex Plate
88c191bc61
Move some methods from RegisterGroup to clipboard 2022-03-24 18:07:13 +03:00
Alex Plate
a1e6318bce
Move register classes into the separate package 2022-03-24 17:42:03 +03:00
Alex Plate
3606f5ea14
Move a lot of methods to RegisterBase 2022-03-24 17:07:23 +03:00
Alex Plate
38c3b206e2
Move a method to RegisterGroupBase 2022-03-24 16:21:04 +03:00
Alex Plate
e69bf9760d
Move a method to RegisterGroupBase 2022-03-24 16:08:21 +03:00
Alex Plate
0b763e23cf
Move Register to vim-engine 2022-03-24 14:39:13 +03:00
Alex Plate
311cb0bada
Get rid of TransferableData 2022-03-24 14:25:40 +03:00
Alex Plate
a78782b73a
Extract VimClipboardManager 2022-03-24 14:17:10 +03:00
Alex Plate
54df803ee1
Move some code from register group to base class 2022-03-23 19:32:03 +03:00
Alex Plate
2819b782c9
Move isCloseKeyStroke to extension method 2022-03-23 19:00:37 +03:00
Alex Plate
38c12660b0
Update usages of vimLogger 2022-03-23 18:40:48 +03:00
Alex Plate
3917a8c5e3
Move KeyHandler to vim-engine 2022-03-22 19:20:17 +03:00
Alex Plate
17c642d5ed
Move some classes to vim-engine 2022-03-22 19:17:31 +03:00
Alex Plate
2d84e2d788
Move argument capturing to vim engine 2022-03-22 19:09:09 +03:00
Alex Plate
ca19d2bfd5
Move injector fully to vim-engine 2022-03-22 16:20:28 +03:00
Alex Plate
cd56fb87d0
Rename .java to .kt 2022-03-22 16:20:27 +03:00
Alex Plate
7290edd3ae
Move all members of injector to vim-engine 2022-03-22 15:47:34 +03:00
Alex Plate
8d4e9b8514
Move VimChangeGroup to vim-engine 2022-03-22 15:46:20 +03:00
Alex Plate
db87b51784
Move some base classes to vim-engine 2022-03-22 15:44:33 +03:00
Alex Plate
96dc9af1e3
Move NativeActionManager to injectorBasfe 2022-03-22 12:36:32 +03:00
Alex Plate
a453cb2582
Move DigraphSequence to vim-engine 2022-03-21 19:04:33 +03:00
Alex Plate
b0d53330bb
Move some classes to vim-engine 2022-03-21 19:04:33 +03:00
Alex Plate
99ebcacf31
Extract injector base for easier refactoring 2022-03-21 19:04:33 +03:00
Alex Plate
3ec90194d7
Move VimStringParser.kt to a different package 2022-03-21 19:04:33 +03:00
Alex Plate
5ce52f7189 Update changelog 2022-03-21 14:36:04 +00:00
Alex Plate
d163837d8d
fix(VIM-2587): Use ctrl-6 as ctrl-^ 2022-03-21 17:31:39 +03:00
Alex Plate
81811530de
Extract StringParser from IJ API 2022-02-28 12:00:05 +03:00
Alex Plate
7276bc49a7
Move runWrite/Read actions to VimApplication 2022-02-28 12:00:05 +03:00
Alex Plate
90cff7e574
Unbind concrete actions from keyHandler 2022-02-28 12:00:05 +03:00
Alex Plate
c673550901
Initialize injector in VimPlugin 2022-02-28 12:00:05 +03:00
Alex Plate
5b360b6de2
Move ExException to vim-engine 2022-02-28 12:00:05 +03:00
Alex Plate
8e2783962f
Move OptionService to vim-engine 2022-02-28 12:00:04 +03:00
Alex Plate
866b319c5b
Move VimDataType to vim-engine 2022-02-28 12:00:04 +03:00
Alex Plate
6eb47567e8
Unbind VimDataType from Variable 2022-02-28 12:00:04 +03:00
Alex Plate
d27f87fbb8
Push down addOption 2022-02-28 12:00:03 +03:00
Alex Plate
b2a2299347
Move OptionListener to vim-engine 2022-02-28 11:59:36 +03:00
Alex Plate
905862ab9f
Move some classes to vim-engine 2022-02-28 11:58:44 +03:00
Alex Plate
5c307fd22c
Rename .java to .kt 2022-02-28 11:58:43 +03:00
Alex Plate
e92b69ad3f Update formatting 2022-02-27 00:16:40 +00:00
Alex Plate
c6a5f9c268
Update changelog 2022-02-24 11:53:36 +03:00
Alex Plate
54f91f2a64 Add Thomas Schouten to contributors list 2022-02-24 07:40:28 +00:00
Thomas Schouten
4b2ed33cdd Implement UserDataHolder for EditorDataContext, so that handlers like AutoHardWrapHandler can store user data in the context delegate. 2022-02-24 10:38:33 +03:00
Alex Plate
5fa48fc7dd
Extract KeyMappingLayer and MappingInfoLayer 2022-02-22 18:45:38 +03:00
Alex Plate
e028c269b7
Move VimRegisterGroup to vim-engine 2022-02-22 18:11:05 +03:00
Alex Plate
9798c7aca2
Rename .java to .kt 2022-02-22 17:58:14 +03:00
Alex Plate
b5bca78ef4
Move register group to vim-engine 2022-02-22 17:12:15 +03:00
Alex Plate
1c619cfc74
Rename .java to .kt 2022-02-22 17:12:14 +03:00
Alex Plate
dc5832a44c
Convert TextObjectAction to new API 2022-02-22 16:40:57 +03:00
Alex Plate
8fd64afc90
Move CommandFlags to vim-engine 2022-02-22 15:45:04 +03:00
Alex Plate
1484f4e370
Use VimCaret api in MotionActionHandler 2022-02-22 15:44:05 +03:00
Alex Plate
32df1597c4
Move noneOfEnum to engine 2022-02-22 14:44:22 +03:00
Alex Plate
707b750ff1
Unbind VimSelection from IJ 2022-02-22 12:39:11 +03:00
Alex Plate
3388c8517b
Remove unused OptionService import 2022-02-22 12:39:11 +03:00
Alex Plate
60a8e0d5f5
Rename Scope to OptionsScope and move it to vim-engine 2022-02-22 12:39:10 +03:00
Alex Plate
5a757a58b5
Move OptionConstants.kt to vim-engine 2022-02-22 12:39:10 +03:00
Alex Plate
2e555b6eaa
Move CommandState.kt to injector 2022-02-22 12:39:10 +03:00
Alex Plate
c57277cc15
Move Nodes.kt to vim-engine 2022-02-22 12:39:09 +03:00
Alex Plate
bf035d42af
Add some methods to VimEditor 2022-02-22 12:39:09 +03:00
Alex Plate
8cb6f9b65f
Move MessageHelper to injector 2022-02-22 12:39:09 +03:00
Alex Plate
fcbc4a0688
Rename some methods in messages 2022-02-22 12:39:09 +03:00
Alex Plate
42bc15c8ea
Remove VimPlugin from DigraphSequence 2022-02-22 12:39:09 +03:00
Alex Plate
992231bcad
Use services in vim injector 2022-02-22 12:39:09 +03:00
Alex Plate
6d494c99e3
Use vimlogger and injector in MappingState 2022-02-22 12:39:08 +03:00
Alex Plate
a848f2175a
Move CurrentCommandState to vim-engine 2022-02-22 12:39:08 +03:00
Alex Plate
4e6a2f951b
Move MappingMode to vim-engine 2022-02-22 12:39:08 +03:00
Alex Plate
5a41bbe806
Update usage of toUpperCase 2022-02-22 12:39:08 +03:00
lippfi
066e6619af Fix ActionTracker rule 2022-02-21 18:53:00 +03:00
Alex Plate
f0dbabd20f
Update formatting 2022-02-21 11:56:52 +03:00
Alex Plate
35c0e33ec4
Upgrade API to kotlin 1.5 2022-02-21 11:56:26 +03:00
Alex Plate
a5715dac7d
Inline capitalize function 2022-02-21 11:56:26 +03:00
Alex Plate
cdb9af5ab6
Convert StringHelper to kotlin 2022-02-21 11:56:25 +03:00
Alex Plate
19c05c23f3
Rename .java to .kt 2022-02-21 11:56:25 +03:00
Alex Plate
12c744c1ba Update formatting 2022-02-20 00:15:01 +00:00
Alex Plate
604a6a5140
Convert DigraphSequence.kt to kotlin 2022-02-18 19:21:50 +03:00
Alex Plate
62aae7b7c4
Rename .java to .kt 2022-02-18 19:21:50 +03:00
Alex Plate
2ea899330c
Move DigraphResult.kt to vim-engine 2022-02-18 19:12:29 +03:00
Alex Plate
3574db020f
Convert DigraphResult.kt to kotlin 2022-02-18 19:10:19 +03:00
Alex Plate
b2ae2a38ec
Rename .java to .kt 2022-02-18 19:10:19 +03:00
Alex Plate
04ebb6077a
Move some classes to vim engine 2022-02-18 19:08:07 +03:00
Alex Plate
d5062944d0
Rename vim-engin folder to kotlin and change VimEditor package 2022-02-18 18:21:49 +03:00
Alex Plate
dc181ce0ce
Exclude kotlin runtime from IdeaVim builds 2022-02-18 13:09:53 +03:00
Alex Plate
042e3388b0
Move VimEditor to vim-engine 2022-02-17 19:00:35 +03:00
Alex Plate
d4a1ffa9a9
Update package structure 2022-02-17 19:00:35 +03:00
Alex Plate
54927d0af7
Move VimLogger to vim-engine 2022-02-17 19:00:35 +03:00
Alex Plate
d26765e217
Create vim-engine module 2022-02-17 19:00:35 +03:00
Alex Plate
277b4e63c3
Introduce ActionInitiator 2022-02-17 19:00:34 +03:00
Alex Plate
848514405b
Remove usages of VimPlugin from keyHandler 2022-02-17 19:00:34 +03:00
Alex Plate
7b8fd0ee55
Extract vim messages into a separate service 2022-02-17 19:00:34 +03:00
Alex Plate
d373ebac58
Use optionService from injector 2022-02-17 19:00:34 +03:00
lippfi
370ccc5254 Hardcode extension names 2022-02-17 14:31:25 +03:00
lippfi
9272fc8cd7 Fix parseKeys 2022-02-17 14:24:57 +03:00
dependabot[bot]
22cfdbae0a Bump mockito-kotlin from 3.2.0 to 4.0.0
Bumps [mockito-kotlin](https://github.com/mockito/mockito-kotlin) from 3.2.0 to 4.0.0.
- [Release notes](https://github.com/mockito/mockito-kotlin/releases)
- [Commits](https://github.com/mockito/mockito-kotlin/compare/3.2.0...4.0.0)

---
updated-dependencies:
- dependency-name: org.mockito.kotlin:mockito-kotlin
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-17 12:56:36 +03:00
Alex Plate
f49f5e5d25
Roll back working version of changelog plugin 2022-02-17 12:45:09 +03:00
Alex Plate
118c12e7fe
Prepare to 1.10.0 release 2022-02-17 11:44:55 +03:00
Alex Plate
02a7eb34ee
[TC]: Update version 2022-02-17 11:42:00 +03:00
Alex Plate
739390739e
[TC]: Register VCS root 2022-02-17 10:56:57 +03:00
Alex Plate
6b2ead0d4e
[TC]: Remove old tests from TC build 2022-02-17 10:52:51 +03:00
Alex Plate
1eaf9e7b17
[TC]: Apply patches 2022-02-17 10:45:12 +03:00
Alex Plate
954e1a9099
Remove IJ api from MotionActionHandler 2022-02-16 18:28:38 +03:00
Alex Plate
5aeff6f914
Remove IJ api from EditorActionHandlerBase 2022-02-16 17:16:01 +03:00
Alex Plate
fb15049fbf
Include forEachCaret to VimEditor 2022-02-16 16:39:31 +03:00
Alex Plate
6f3a9c210e
Convert Argument to new API 2022-02-16 14:21:17 +03:00
Alex Plate
6fdd6d839e
Remove IJ API from CommandBuilder 2022-02-16 14:00:03 +03:00
Alex Plate
ac1101a410
Update wrapInsertedTextWithVisualMarks code 2022-02-16 12:53:40 +03:00
Alex Plate
2fd33e6ec2
Unbind command state from IJ api 2022-02-15 21:46:20 +03:00
Alex Plate
779c69a982
Abstract action executor 2022-02-15 21:46:20 +03:00
Alex Plate
3494286e66
Rename .java to .kt 2022-02-15 21:46:20 +03:00
Alex Plate
139b78d7f4
Add a protection from an accidental usage of equals in VimCaret and VimEditor 2022-02-15 21:46:19 +03:00
Alex Plate
daee2f615c
Remove IjVimEditor usages from KeyHandler 2022-02-15 21:46:19 +03:00
Alex Plate
710825ec28
Fix incorrect usage of template presentation 2022-02-15 21:46:19 +03:00
Alex Plate
478539911b
Update MappingInfo to use new api 2022-02-15 21:46:19 +03:00
Alex Plate
b21d984cf8
Switch from application service to singleton 2022-02-15 21:46:19 +03:00
Alex Plate
1a92cebf6b
Reformat KeyHandler 2022-02-15 21:46:18 +03:00
Alex Plate
fd3f939526
Remove few dependencies to IJ API 2022-02-15 21:46:18 +03:00
Alex Plate
7d28760fa1
Inline several methods into beforHandleKey 2022-02-15 21:46:18 +03:00
Alex Plate
4a0a1c95a9
Remove a few IJ classes from KeyHandler 2022-02-15 21:46:18 +03:00
Alex Plate
9da0c10141
Remove Ref from KeyHandler 2022-02-15 21:46:18 +03:00
Alex Plate
43b9ecdf3c
Get rid of Editor in KeyHandler.kt 2022-02-15 21:46:18 +03:00
Alex Plate
987952a2f2
Get rid of DataContext in KeyHandler.kt 2022-02-15 21:46:17 +03:00
Alex Plate
92f6ac57ad
Remove usages of flushDelayedKeyEvents
I'm not sure about this commit, but currently it seems like this method does nothing because of fixes in JBR

See 39265c4773de6a8e26e7ac376428687e1332dffe in IJ repository
2022-02-15 21:46:17 +03:00
Alex Plate
b4af51f3cc
Add vim implementation of logger 2022-02-15 21:46:17 +03:00
lippfi
4ba6e62ada Fix gv 2022-02-15 13:42:40 +03:00
Alex Plate
58d5924e80
Update changelist 2022-02-14 14:31:59 +03:00
lippfi
8f55551339 Mocked tests for tabmove 2022-02-14 13:11:58 +03:00
Alex Plate
9229497be8 Add David Dadon to contributors list 2022-02-14 08:25:42 +00:00
Alex Pláte
99e77cd8ed Update ideajoin-examples.md 2022-02-14 11:24:12 +03:00
David Dadon
8d8809238c Add shortcut to ideajoin example 2022-02-14 11:24:12 +03:00
Alex Plate
f03d574e86 Update formatting 2022-02-13 00:12:41 +00:00
lippfi
cbb5fbe92e Add vimscript statistic 2022-02-11 14:54:34 +03:00
lippfi
6a376ad62c Add shortcut conflict statistic 2022-02-11 14:53:09 +03:00
lippfi
8e61853459 Add PluginState statistic 2022-02-11 14:51:44 +03:00
lippfi
b17bc1bb3e Add ActionTracker statistic 2022-02-11 14:48:15 +03:00
lippfi
1343c7603b Rename VimStatistic to OptionState 2022-02-11 14:46:18 +03:00
Alex Plate
5b5a4b1347
Fix tests 2022-02-11 11:26:12 +03:00
Alex Plate
62fb3f9c5a
Make IdeaVim compatible with 213+ only 2022-02-11 10:58:38 +03:00
Alex Plate
986378db42
Comment out two incompatipable tests 2022-02-11 10:21:58 +03:00
Alex Plate
ce99c26c03
Introduce ExecutionContext - abstract context holder 2022-02-10 18:03:40 +03:00
Alex Plate
3571595838
Use VimEditor in Local scope of options 2022-02-10 17:10:30 +03:00
Alex Plate
c0c450124f
Fix test 2022-02-10 17:07:39 +03:00
Alex Plate
aa62022218
Reorder functions 2022-02-10 16:26:36 +03:00
Alex Plate
71c27babfd
Update tests 2022-02-10 16:24:13 +03:00
Alex Plate
2ff93270d7
Konvert keyHandler to kotlin 2022-02-10 16:17:59 +03:00
Alex Plate
c07719dd3d
Rename KeyHandler.java to KeyHandler.kt 2022-02-10 16:17:41 +03:00
Alex Plate
6b7ef88418
Fix test 2022-02-10 16:07:11 +03:00
Alex Plate
ee9f12180d
Extract VimActionExecutor 2022-02-10 13:18:23 +03:00
Alex Plate
8df3bc57c5
Execute action execution to a separate class 2022-02-10 13:15:54 +03:00
Alex Plate
0aabb2971e
Support extension handlers with a callback
After the refactoring of AceJump, the current approach is not synchronous anymore.
So, it's needed to explicitly notify IdeaVim that the motion was finished and IdeaVim can continue the execution
2022-02-10 12:55:44 +03:00
Alex Plate
e5740bf496
Add kotlin test as a dependency 2022-02-10 11:03:28 +03:00
Alex Plate
e8f1dff61c
Add some comments for handler injector 2022-02-09 11:46:04 +03:00
Alex Plate
267fc62865
Add TC tests for 213 2022-02-09 09:54:07 +03:00
Alex Plate
05a64f51f7 Update changelog 2022-02-08 15:23:00 +00:00
Alex Plate
e5460d7a31
Extract keyHandlerKeeper 2022-02-08 18:20:12 +03:00
Alex Plate
1826a31e2f
Update changelog 2022-02-08 14:20:35 +03:00
Alex Plate
2bb44c414f
Refactoring for the new api 2022-02-08 14:20:35 +03:00
Alex Plate
ef7442c488
Create carets() method in VimEditor 2022-02-08 14:20:34 +03:00
Alex Plate
775bde62c8
VimEditor update 2022-02-08 14:20:34 +03:00
Alex Plate
c5a504bde3
Top level editor is hidden behind VimEditor 2022-02-08 14:20:34 +03:00
Alex Plate
f7f7e010c4
Update dic 2022-02-08 14:20:34 +03:00
Alex Plate
aa82f7ed64 Add Alex Pláte to contributors list 2022-02-08 11:15:12 +00:00
Alex Pláte
684d192b4b Remove unnecessary code update 2022-02-08 14:13:49 +03:00
Matt Ellis
aed2d1159d fix(VIM-2470): Fix incorrect reset of cursor shape 2022-02-08 14:13:49 +03:00
lippfi
d2500df05e Better digraph support 2022-02-07 13:47:02 +03:00
lippfi
8922303a72 Fix paste 2022-02-07 13:45:11 +03:00
lippfi
cea4de03cd Add tabmove command 2022-02-07 13:44:56 +03:00
Alex Plate
9529c19b9b Update formatting 2022-01-30 00:11:14 +00:00
Alex Plate
b0f5c502d9
Inject VimEditor into keyHandler 2022-01-27 13:17:39 +03:00
Alex Plate
c3fc369bc4
[VIM-1028] Support global state
Not yet documented and enabled
2022-01-27 12:34:28 +03:00
lippfi
a5ef0d5edf Fix tab character for StringHelper.stringToKeys() 2022-01-26 21:37:10 +03:00
Alex Plate
26e9056f17
Fix multicaret test for o 2022-01-26 17:05:49 +03:00
Alex Plate
1553aa774b
Add docs to VimPlugin 2022-01-26 17:01:36 +03:00
Alex Plate
2ebdbc5ac4
Do not update carets in notebook command mode 2022-01-26 16:57:46 +03:00
Alex Plate
e3ca172101
Update changes in plugin.xml 2022-01-26 16:57:46 +03:00
lippfi
17d4ec6c29 Fix option listeners 2022-01-26 16:43:28 +03:00
lippfi
bec317615d Better map <expr> context 2022-01-26 16:42:44 +03:00
Alex Plate
d00fd767ff
Add some docs regarding plugin initialization 2022-01-26 11:20:03 +03:00
Alex Plate
557652c526
Use executeNonCancelableSection for macro execution 2022-01-25 14:44:21 +03:00
Alex Plate
e138541495
Enable experimental api by default 2022-01-25 11:06:10 +03:00
Alex Plate
f6dfbcad0d Update changelog 2022-01-25 07:54:34 +00:00
Alex Plate
2518be2704
Fix(VIM-2504): Fix esc with using python notebooks 2022-01-25 10:52:39 +03:00
Alex Plate
42ec2b9dce
Disable new api for o commands 2022-01-25 10:28:23 +03:00
Alex Plate
9484599bfd
Remove duplicating copyright 2022-01-25 09:42:38 +03:00
Alex Plate
5e6d3ddae8
Update changes 2022-01-24 13:00:25 +03:00
Alex Plate
13cce3afcc
Update changelog 2022-01-24 13:00:25 +03:00
Alex Plate
9743cb1424 Add Lonre Wang to contributors list 2022-01-24 09:59:09 +00:00
Lonre Wang
dbbcf3860a Update VimVisualTimer.kt 2022-01-24 12:57:37 +03:00
Lonre Wang
ae983be0a8 Update OptionsManager.kt 2022-01-24 12:57:37 +03:00
Lonre Wang
f8156fbbca Update NotificationService.kt 2022-01-24 12:57:37 +03:00
lippfi
1909547543 Make OptionConstants non-internal 2022-01-24 12:53:07 +03:00
lippfi
e47c0c1914 Update changes 2022-01-24 12:32:20 +03:00
lippfi
1a122337fe Replace deprecated option data classes with constants 2022-01-24 02:27:33 +03:00
lippfi
bcf2578da9 Replace hardcoded option names with string constants 2022-01-24 00:52:28 +03:00
lippfi
06cd41ba0e Make VimScriptGlobalEnvironment deprecated 2022-01-23 02:35:53 +03:00
lippfi
64ec421cfc Rename parent to vimContext 2022-01-23 02:28:35 +03:00
lippfi
86fcda5afc Fix beep in source command 2022-01-23 02:05:23 +03:00
lippfi
e799d40803 Fix built-in functions with global context 2022-01-23 02:00:26 +03:00
lippfi
c84325a37c Replace Executable with VimLContext 2022-01-23 01:53:07 +03:00
Alex Plate
3b6d57849c Add Piotr Mikulski to contributors list 2022-01-21 12:06:35 +00:00
Piotr Mikulski
9b4825db77 String colors that aren't supported properly 2022-01-21 15:04:51 +03:00
Piotr Mikulski
6a4bb7395b Print stderr when running a command just like vim does 2022-01-21 15:04:51 +03:00
Alex Plate
c8463d9b3e
Update dependencies and reformat 2022-01-21 14:17:13 +03:00
Alex Plate
376ca4e93b
Add merge to changes 2022-01-21 14:17:13 +03:00
Alex Plate
6a43e558fd Add Michael Schertenleib to contributors list 2022-01-21 11:10:35 +00:00
Michael Schertenleib
05414276f2 Support custom element names in vim-surround 2022-01-21 14:05:27 +03:00
Alex Plate
bec73749c2
[VIM-2494] Add logs for registers reading/writing 2022-01-21 11:50:26 +03:00
Alex Plate
0d4f9891c3
Fix(VIM-2471): Fix incorrectness 2022-01-19 17:24:19 +03:00
Alex Plate
f082ab4b68 Update changelog 2022-01-19 13:28:45 +00:00
Alex Plate
d4f4765ffd
Fix(VIM-2471): Multiple [{ and ]} actions 2022-01-19 16:25:45 +03:00
Alex Plate
8902c0839c
Write down the issues for o in new API 2022-01-19 09:56:17 +03:00
Alex Plate
66fc8034ba
Correct indent for o command when the caret is in the middle of the indent 2022-01-18 11:22:39 +03:00
Alex Plate
109cb58d68
Cleanup saved shortcut conflicts after tests 2022-01-18 11:15:15 +03:00
Alex Plate
a71916df84
Allow an accidental whitespace at the end of sethandler command 2022-01-18 10:06:53 +03:00
Alex Plate
5f10eb808e
Fix the O command on the line top 2022-01-17 10:22:25 +03:00
Alex Plate
6c1e7b0b60
Write tests for status string 2022-01-17 10:22:24 +03:00
Alex Plate
792c22a90a Update formatting 2022-01-16 00:12:11 +00:00
lippfi
eff2cd02f9 Add <C-char> support to VimL's double quoted strings 2022-01-15 12:40:34 +03:00
Alex Pláte
163e7751f2
Merge pull request #420 from JetBrains/dependabot/gradle/org.eclipse.jgit-org.eclipse.jgit-6.0.0.202111291000-r
Bump org.eclipse.jgit from 5.13.0.202109080827-r to 6.0.0.202111291000-r
2022-01-14 19:06:28 +03:00
Alex Plate
370c22b2f5
Add Kevin Suen to contributors list 2022-01-14 19:05:30 +03:00
Alex Plate
a251ac55e5
Update changelog 2022-01-14 19:03:46 +03:00
Alex Plate
987df6958e
Manually specify the list of IDEs to verify 2022-01-14 19:03:46 +03:00
Alex Pláte
60ae189442
Merge pull request #440 from ksrb/feat/matchitHandlebars
Add matchit support for handlebars
2022-01-14 19:01:58 +03:00
Alex Pláte
ce734906d4
Merge branch 'master' into feat/matchitHandlebars 2022-01-14 19:01:30 +03:00
Alex Plate
3b26572731 Add DanEEStar to contributors list 2022-01-14 15:57:33 +00:00
Daniel Egger
4d9c606c79 Add Matchit support for Vue.js files 2022-01-14 18:56:00 +03:00
Alex Plate
22050fc16d
Specify untilBuild 2022-01-14 18:16:34 +03:00
Alex Plate
2fb419253c
Setup sinceBuild for plugin verifier 2022-01-14 17:45:16 +03:00
Alex Plate
3bb4fc67bf Update changelog 2022-01-14 13:41:29 +00:00
Alex Plate
a0a009cb59
fix(VIM-2523): i command for the folder in the project tree 2022-01-14 15:45:29 +03:00
Alex Plate
ce2bb85e18
Fix test for non-experimental api 2022-01-14 15:23:48 +03:00
Alex Plate
7ff8ac76fa
Disable guarded tests for old api 2022-01-14 15:05:21 +03:00
Alex Plate
935c51c985
Support operations with python notebooks guarded blocks 2022-01-14 14:05:41 +03:00
Alex Plate
a8d0e698eb
New approach for folder processing in o command 2022-01-13 14:47:26 +03:00
Alex Plate
5b13ad6726
Allow guards creation in tests 2022-01-13 13:51:39 +03:00
Alex Plate
e88d0d1493
Corrections for o command 2022-01-13 12:28:33 +03:00
Alex Plate
898af47f89
o command with repeat 2022-01-13 11:14:11 +03:00
Alex Plate
84868c0fb5
Move O to new API 2022-01-13 09:59:22 +03:00
Alex Plate
8e2b7d2089
Fix repeating after o command with count 2022-01-13 09:54:41 +03:00
Alex Plate
f359ac49f3
Fix o command with folders 2022-01-13 09:18:19 +03:00
Alex Plate
37ce0925a5
Massive copyright data update 2022-01-13 08:59:49 +03:00
Alex Plate
23985aea7d
Move experimental api to the separate package 2022-01-13 08:57:09 +03:00
Alex Plate
3bd5ab970f
Use new api in o command 2022-01-13 08:52:37 +03:00
Kevin Suen
fbdcbdc626 Add matchit support for handlebars 2022-01-12 11:50:20 -08:00
Alex Plate
f197ee54d1
Fix cc with indenting 2022-01-12 19:38:29 +03:00
Alex Plate
efa0489f7b
Introduce Pointer 2022-01-12 07:02:20 +03:00
Alex Plate
66dd90a090
Update some docs for experimental API 2022-01-11 21:15:38 +03:00
Alex Plate
68cfb12746
Rename line pointers 2022-01-11 19:50:56 +03:00
Alex Plate
4ad14f3404
Add docs about offsets 2022-01-11 17:55:50 +03:00
Alex Plate
4bcf44570b
Use offsets in experimental api 2022-01-11 17:23:48 +03:00
dependabot[bot]
b6128418be
Bump org.eclipse.jgit from 5.13.0.202109080827-r to 6.0.0.202111291000-r
Bumps org.eclipse.jgit from 5.13.0.202109080827-r to 6.0.0.202111291000-r.

---
updated-dependencies:
- dependency-name: org.eclipse.jgit:org.eclipse.jgit
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-01 15:02:01 +00:00
1180 changed files with 39215 additions and 31168 deletions

6
.gitignore vendored
View File

@ -10,9 +10,9 @@
!/.idea/runConfigurations !/.idea/runConfigurations
!/.idea/codeStyles !/.idea/codeStyles
/build/ **/build/
/out/ **/out/
/tmp/ **/tmp/
*.DS_Store *.DS_Store

View File

@ -5,11 +5,10 @@ object Constants {
const val EAP_CHANNEL = "eap" const val EAP_CHANNEL = "eap"
const val DEV_CHANNEL = "Dev" const val DEV_CHANNEL = "Dev"
const val VERSION = "1.9.3" const val VERSION = "1.10.3"
const val DEV_VERSION = "1.10.0" const val DEV_VERSION = "1.11.0"
const val GITHUB_TESTS = "LATEST-EAP-SNAPSHOT" const val GITHUB_TESTS = "LATEST-EAP-SNAPSHOT"
const val LINTING_TESTS = "LATEST-EAP-SNAPSHOT"
const val NVIM_TESTS = "LATEST-EAP-SNAPSHOT" const val NVIM_TESTS = "LATEST-EAP-SNAPSHOT"
const val PROPERTY_TESTS = "LATEST-EAP-SNAPSHOT" const val PROPERTY_TESTS = "LATEST-EAP-SNAPSHOT"
const val LONG_RUNNING_TESTS = "LATEST-EAP-SNAPSHOT" const val LONG_RUNNING_TESTS = "LATEST-EAP-SNAPSHOT"

View File

@ -9,6 +9,8 @@ import _Self.vcsRoots.Branch_183
import _Self.vcsRoots.Branch_191_193 import _Self.vcsRoots.Branch_191_193
import _Self.vcsRoots.Branch_201 import _Self.vcsRoots.Branch_201
import _Self.vcsRoots.Branch_202 import _Self.vcsRoots.Branch_202
import _Self.vcsRoots.Branch_203_212
import _Self.vcsRoots.Branch_Release
import _Self.vcsRoots.GitHubPullRequest import _Self.vcsRoots.GitHubPullRequest
import jetbrains.buildServer.configs.kotlin.v2019_2.Project import jetbrains.buildServer.configs.kotlin.v2019_2.Project
@ -23,12 +25,12 @@ object Project : Project({
vcsRoot(Branch_191_193) vcsRoot(Branch_191_193)
vcsRoot(Branch_201) vcsRoot(Branch_201)
vcsRoot(Branch_202) vcsRoot(Branch_202)
vcsRoot(Branch_203_212)
vcsRoot(Branch_Release)
vcsRoot(GitHubPullRequest) vcsRoot(GitHubPullRequest)
// Builds // Builds
buildType(TestsForIntelliJ20203) buildType(TestsForIntelliJ20213)
buildType(TestsForIntelliJ20211)
buildType(TestsForIntelliJ20212)
buildType(TestsForIntelliJEAP) buildType(TestsForIntelliJEAP)
buildType(PropertyBased) buildType(PropertyBased)

View File

@ -55,6 +55,4 @@ sealed class ActiveTests(buildName: String, ijVersion: String) : BuildType({
}) })
object TestsForIntelliJEAP : ActiveTests("Tests for IntelliJ Latest EAP", "LATEST-EAP-SNAPSHOT") object TestsForIntelliJEAP : ActiveTests("Tests for IntelliJ Latest EAP", "LATEST-EAP-SNAPSHOT")
object TestsForIntelliJ20212 : ActiveTests("Tests for IntelliJ 2021.2", "2021.2.2") object TestsForIntelliJ20213 : ActiveTests("Tests for IntelliJ 2021.3", "2021.3.2")
object TestsForIntelliJ20211 : ActiveTests("Tests for IntelliJ 2021.1", "2021.1")
object TestsForIntelliJ20203 : ActiveTests("Tests for IntelliJ 2020.3", "2020.3")

View File

@ -28,11 +28,15 @@ object Qodana : BuildType({
steps { steps {
qodana { qodana {
name = "Qodana" name = "Qodana"
/*
reportAsTestsEnable = "" reportAsTestsEnable = ""
failBuildOnErrors = "" failBuildOnErrors = ""
codeInspectionXmlConfig = "Custom" codeInspectionXmlConfig = "Custom"
codeInspectionCustomXmlConfigPath = ".idea/inspectionProfiles/Qodana.xml" codeInspectionCustomXmlConfigPath = ".idea/inspectionProfiles/Qodana.xml"
reportAsTestsEnable = "true" reportAsTestsEnable = "true"
*/
clearConditions()
param("licenseaudit-enable", "true")
param("clonefinder-languages", "Java") param("clonefinder-languages", "Java")
param("clonefinder-mode", "") param("clonefinder-mode", "")
param("report-version", "") param("report-version", "")

View File

@ -5,6 +5,7 @@ import _Self.Constants.DEV_CHANNEL
import _Self.Constants.EAP_CHANNEL import _Self.Constants.EAP_CHANNEL
import _Self.Constants.RELEASE import _Self.Constants.RELEASE
import _Self.Constants.VERSION import _Self.Constants.VERSION
import _Self.vcsRoots.Branch_Release
import jetbrains.buildServer.configs.kotlin.v2019_2.BuildType import jetbrains.buildServer.configs.kotlin.v2019_2.BuildType
import jetbrains.buildServer.configs.kotlin.v2019_2.CheckoutMode import jetbrains.buildServer.configs.kotlin.v2019_2.CheckoutMode
import jetbrains.buildServer.configs.kotlin.v2019_2.DslContext import jetbrains.buildServer.configs.kotlin.v2019_2.DslContext
@ -38,7 +39,7 @@ object Release : BuildType({
} }
vcs { vcs {
root(DslContext.settingsRoot) root(Branch_Release)
checkoutMode = CheckoutMode.AUTO checkoutMode = CheckoutMode.AUTO
} }

View File

@ -0,0 +1,64 @@
@file:Suppress("ClassName")
package _Self.buildTypes
import jetbrains.buildServer.configs.kotlin.v2019_2.BuildType
import jetbrains.buildServer.configs.kotlin.v2019_2.CheckoutMode
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.gradle
import jetbrains.buildServer.configs.kotlin.v2019_2.failureConditions.BuildFailureOnMetric
import jetbrains.buildServer.configs.kotlin.v2019_2.failureConditions.failOnMetricChange
import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.vcs
sealed class TestsForIntelliJ_203_212_branch(private val version: String) : BuildType({
name = "Tests for IntelliJ $version"
params {
param("env.ORG_GRADLE_PROJECT_downloadIdeaSources", "false")
param("env.ORG_GRADLE_PROJECT_legacyNoJavaPlugin", "true")
param("env.ORG_GRADLE_PROJECT_ideaVersion", "IC-$version")
param("env.ORG_GRADLE_PROJECT_instrumentPluginCode", "false")
param("env.ORG_GRADLE_PROJECT_javaVersion", "1.8")
}
vcs {
root(_Self.vcsRoots.Branch_203_212)
checkoutMode = CheckoutMode.AUTO
}
steps {
gradle {
tasks = "clean test"
buildFile = ""
enableStacktrace = true
param("org.jfrog.artifactory.selectedDeployableServer.defaultModuleVersionConfiguration", "GLOBAL")
}
}
triggers {
vcs {
branchFilter = ""
}
}
requirements {
noLessThanVer("teamcity.agent.jvm.version", "1.8")
}
failureConditions {
failOnMetricChange {
metric = BuildFailureOnMetric.MetricType.TEST_COUNT
threshold = 20
units = BuildFailureOnMetric.MetricUnit.PERCENTS
comparison = BuildFailureOnMetric.MetricComparison.LESS
compareTo = build {
buildRule = lastSuccessful()
}
}
}
})
object TestsForIntelliJ20212 : TestsForIntelliJ_203_212_branch("2021.2.2")
object TestsForIntelliJ20211 : TestsForIntelliJ_203_212_branch("2021.1")
object TestsForIntelliJ20203 : TestsForIntelliJ_203_212_branch("2020.3")

View File

@ -8,18 +8,24 @@ import _Self.buildTypes.TestsForIntelliJ20192
import _Self.buildTypes.TestsForIntelliJ20193 import _Self.buildTypes.TestsForIntelliJ20193
import _Self.buildTypes.TestsForIntelliJ20201 import _Self.buildTypes.TestsForIntelliJ20201
import _Self.buildTypes.TestsForIntelliJ20202 import _Self.buildTypes.TestsForIntelliJ20202
import _Self.buildTypes.TestsForIntelliJ20203
import _Self.buildTypes.TestsForIntelliJ20211
import _Self.buildTypes.TestsForIntelliJ20212
import jetbrains.buildServer.configs.kotlin.v2019_2.Project import jetbrains.buildServer.configs.kotlin.v2019_2.Project
object OldTests : Project({ object OldTests : Project({
name = "Old IdeaVim tests" name = "Old IdeaVim tests"
description = "Tests for older versions of IJ" description = "Tests for older versions of IJ"
buildType(TestsForIntelliJ20202)
buildType(TestsForIntelliJ20201)
buildType(TestsForIntelliJ20191)
buildType(TestsForIntelliJ20181) buildType(TestsForIntelliJ20181)
buildType(TestsForIntelliJ20192)
buildType(TestsForIntelliJ20182) buildType(TestsForIntelliJ20182)
buildType(TestsForIntelliJ20193)
buildType(TestsForIntelliJ20183) buildType(TestsForIntelliJ20183)
buildType(TestsForIntelliJ20191)
buildType(TestsForIntelliJ20192)
buildType(TestsForIntelliJ20193)
buildType(TestsForIntelliJ20201)
buildType(TestsForIntelliJ20202)
buildType(TestsForIntelliJ20203)
buildType(TestsForIntelliJ20211)
buildType(TestsForIntelliJ20212)
}) })

View File

@ -0,0 +1,12 @@
@file:Suppress("ClassName")
package _Self.vcsRoots
import jetbrains.buildServer.configs.kotlin.v2019_2.vcs.GitVcsRoot
object Branch_203_212 : GitVcsRoot({
name = "https://github.com/JetBrains/ideavim (branch 203-212)"
url = "https://github.com/JetBrains/ideavim.git"
branch = "203-212"
useMirrors = false
})

View File

@ -0,0 +1,11 @@
@file:Suppress("ClassName")
package _Self.vcsRoots
import jetbrains.buildServer.configs.kotlin.v2019_2.vcs.GitVcsRoot
object Branch_Release : GitVcsRoot({
name = "https://github.com/JetBrains/ideavim (branch release)"
url = "https://github.com/JetBrains/ideavim.git"
branch = "release"
})

25
.teamcity/patches/buildTypes/Nvim.kts vendored Normal file
View File

@ -0,0 +1,25 @@
package patches.buildTypes
import jetbrains.buildServer.configs.kotlin.v2019_2.*
import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.VcsTrigger
import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.vcs
import jetbrains.buildServer.configs.kotlin.v2019_2.ui.*
/*
This patch script was generated by TeamCity on settings change in UI.
To apply the patch, change the buildType with id = 'Nvim'
accordingly, and delete the patch script.
*/
changeBuildType(RelativeId("Nvim")) {
triggers {
val trigger1 = find<VcsTrigger> {
vcs {
branchFilter = ""
}
}
trigger1.apply {
enabled = false
}
}
}

View File

@ -0,0 +1,25 @@
package patches.buildTypes
import jetbrains.buildServer.configs.kotlin.v2019_2.*
import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.VcsTrigger
import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.vcs
import jetbrains.buildServer.configs.kotlin.v2019_2.ui.*
/*
This patch script was generated by TeamCity on settings change in UI.
To apply the patch, change the buildType with id = 'PluginVerifier'
accordingly, and delete the patch script.
*/
changeBuildType(RelativeId("PluginVerifier")) {
triggers {
val trigger1 = find<VcsTrigger> {
vcs {
branchFilter = ""
}
}
trigger1.apply {
enabled = false
}
}
}

View File

@ -3,6 +3,8 @@ package patches.buildTypes
import jetbrains.buildServer.configs.kotlin.v2019_2.* import jetbrains.buildServer.configs.kotlin.v2019_2.*
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.Qodana import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.Qodana
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.qodana import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.qodana
import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.ScheduleTrigger
import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.schedule
import jetbrains.buildServer.configs.kotlin.v2019_2.ui.* import jetbrains.buildServer.configs.kotlin.v2019_2.ui.*
/* /*
@ -14,16 +16,18 @@ changeBuildType(RelativeId("Qodana")) {
expectSteps { expectSteps {
qodana { qodana {
name = "Qodana" name = "Qodana"
reportAsTestsEnable = "true" reportAsTests = true
failBuildOnErrors = "" inspectionProfile = customProfile {
codeInspectionXmlConfig = "Custom" path = ".idea/inspectionProfiles/Qodana.xml"
codeInspectionCustomXmlConfigPath = ".idea/inspectionProfiles/Qodana.xml" }
param("clonefinder-enable", "true") param("clonefinder-enable", "true")
param("clonefinder-languages", "Java") param("clonefinder-languages", "Java")
param("clonefinder-languages-container", "Java Kotlin") param("clonefinder-languages-container", "Java Kotlin")
param("clonefinder-mode", "") param("clonefinder-mode", "")
param("clonefinder-queried-project", "src") param("clonefinder-queried-project", "src")
param("clonefinder-reference-projects", "src") param("clonefinder-reference-projects", "src")
param("fail-build-on-errors", "")
param("licenseaudit-enable", "true")
param("namesAndTagsCustom", "repo.labs.intellij.net/static-analyser/qodana") param("namesAndTagsCustom", "repo.labs.intellij.net/static-analyser/qodana")
param("report-version", "") param("report-version", "")
param("yaml-configuration", "") param("yaml-configuration", "")
@ -32,7 +36,25 @@ changeBuildType(RelativeId("Qodana")) {
steps { steps {
update<Qodana>(0) { update<Qodana>(0) {
clearConditions() clearConditions()
param("licenseaudit-enable", "true") linter = jvm {
version = Qodana.JVMVersion.LATEST
}
}
}
triggers {
val trigger1 = find<ScheduleTrigger> {
schedule {
schedulingPolicy = weekly {
dayOfWeek = ScheduleTrigger.DAY.Tuesday
}
branchFilter = ""
triggerBuild = always()
}
}
trigger1.apply {
enabled = false
} }
} }
} }

View File

@ -1,16 +0,0 @@
package patches.buildTypes
import jetbrains.buildServer.configs.kotlin.v2019_2.*
import jetbrains.buildServer.configs.kotlin.v2019_2.ui.*
/*
This patch script was generated by TeamCity on settings change in UI.
To apply the patch, change the buildType with id = 'Release'
accordingly, and delete the patch script.
*/
changeBuildType(RelativeId("Release")) {
vcs {
remove(DslContext.settingsRoot.id!!)
add(RelativeId("Branch_Release"))
}
}

View File

@ -1,18 +0,0 @@
package patches.vcsRoots
import jetbrains.buildServer.configs.kotlin.v2019_2.*
import jetbrains.buildServer.configs.kotlin.v2019_2.ui.*
import jetbrains.buildServer.configs.kotlin.v2019_2.vcs.GitVcsRoot
/*
This patch script was generated by TeamCity on settings change in UI.
To apply the patch, create a vcsRoot with id = 'Branch_Release'
in the root project, and delete the patch script.
*/
create(DslContext.projectId, GitVcsRoot({
id("Branch_Release")
name = "https://github.com/JetBrains/ideavim (branch release)"
url = "https://github.com/JetBrains/ideavim.git"
branch = "release"
}))

View File

@ -380,6 +380,42 @@ Contributors:
[![icon][github]](https://github.com/chylex) [![icon][github]](https://github.com/chylex)
&nbsp; &nbsp;
chylex chylex
* [![icon][mail]](mailto:daniel.egger@gmail.com)
[![icon][github]](https://github.com/DanEEStar)
&nbsp;
DanEEStar
* [![icon][mail]](mailto:ksrbkevinsuen@gmail.com)
[![icon][github]](https://github.com/ksrb)
&nbsp;
Kevin Suen
* [![icon][mail]](mailto:michael.schertenleib@inftec.ch)
[![icon][github]](https://github.com/cravay)
&nbsp;
Michael Schertenleib
* [![icon][mail]](mailto:piotr@near.org)
[![icon][github]](https://github.com/pmnoxx)
&nbsp;
Piotr Mikulski
* [![icon][mail]](mailto:lonrevip@gmail.com)
[![icon][github]](https://github.com/lonre)
&nbsp;
Lonre Wang
* [![icon][mail]](mailto:AlexPl292@gmail.com)
[![icon][github]](https://github.com/AlexPl292)
&nbsp;
Alex Pláte
* [![icon][mail]](mailto:david@dadon.fr)
[![icon][github]](https://github.com/ddadon10)
&nbsp;
David Dadon
* [![icon][mail]](mailto:hollandpirates@gmail.com)
[![icon][github]](https://github.com/PHPirates)
&nbsp;
Thomas Schouten
* [![icon][mail]](mailto:sr@mail25.de)
[![icon][github]](https://github.com/Vvalter)
&nbsp;
Simon Rainer
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 maintainers. contact the maintainers.

View File

@ -26,14 +26,70 @@ usual beta standards.
## To Be Released ## To Be Released
### Features: ### Features:
* Add register support to let command | [VIM-749](https://youtrack.jetbrains.com/issue/VIM-749) * Add `gcu` command for Commentary plugin
* Add register support to let command | [VIM-1783](https://youtrack.jetbrains.com/issue/VIM-1783) * Add `:Commentary` command, which works great for commands such as `:%g/fun/Commentary`
* Add `trackactionids`/`tai` option to track action ids * Support `gc` commentary text objects. E.g. `dgc`: delete commented text.
* Support `redo-register feature` | [VIM-2643](https://youtrack.jetbrains.com/issue/VIM-2643/Dot-operator-doesn-t-increment-number-register-after-pasting-fro) | [viminfo](http://vimdoc.sourceforge.net/htmldoc/undo.html#redo-register)
### Changes:
* Uses the same mappings as Commentary, so custom bindings for the Vim plugin will work with IdeaVim, too.
E.g. `<Plug>Commentary` instead of `<Plug>(CommentMotion)`. Old mappings are maintained for compatibility.
* If you open `~/.ideavimrc` in IDE, remove a mapping, and reload the config using the reload button,
the mapping will actually be unmapped.
### Fixes:
* [VIM-2587](https://youtrack.jetbrains.com/issue/VIM-2587) Use ctrl-6 as ctrl-^
* [VIM-2590](https://youtrack.jetbrains.com/issue/VIM-2590) Fix caret shape in PyCharm
* [VIM-2553](https://youtrack.jetbrains.com/issue/VIM-2553) Substitute consecutive matches
* [VIM-1687](https://youtrack.jetbrains.com/issue/VIM-1687) Support count for `gcc`
* [VIM-2381](https://youtrack.jetbrains.com/issue/VIM-2381) Fall back to line comment if block comment is not available
* [VIM-2589](https://youtrack.jetbrains.com/issue/VIM-2589) Add `gc` text object
* [VIM-2604](https://youtrack.jetbrains.com/issue/VIM-2604) Update action execution rules
* [VIM-2654](https://youtrack.jetbrains.com/issue/VIM-2654) Add support for `return` without expression
* [VIM-2630](https://youtrack.jetbrains.com/issue/VIM-2630/Please-fix-warning-Shall-not-be-called-on-a-template-presentatio) Fix IDE freeze
* [VIM-2661](https://youtrack.jetbrains.com/issue/VIM-2661/Spamming-does-not-work) Fix repeating the `@@` command
* [VIM-2668](https://youtrack.jetbrains.com/issue/VIM-2668/tabm-or-tabm-with-no-number-does-not-match-vim-behavior) Fix omitted numbers in `tabm` command
* [VIM-2595](https://youtrack.jetbrains.com/issue/VIM-2595) Support plugins in macro execution
* [VIM-2671](https://youtrack.jetbrains.com/issue/VIM-2671) Fix using plugins from mappings
* [VIM-2675](https://youtrack.jetbrains.com/issue/VIM-2675) Fix numbering register in visual mode
* [VIM-696](https://youtrack.jetbrains.com/issue/VIM-696/vim-selection-issue-after-undo) Fix selection after undo
* [VIM-744](https://youtrack.jetbrains.com/issue/VIM-744/Use-undoredo-with-count-modifier) Add count to undo/redo
* [VIM-1862](https://youtrack.jetbrains.com/issue/VIM-1862/Ex-commands-executed-in-keymaps-and-macros-are-added-to-the-command-history) Fix command history
### Merged PRs:
* [468](https://github.com/JetBrains/ideavim/pull/468) by [Thomas Schouten](https://github.com/PHPirates): Implement UserDataHolder for EditorDataContext
* [483](https://github.com/JetBrains/ideavim/pull/483) by [Simon Rainer](https://github.com/Vvalter): Fix(VIM-2553): Substitute consecutive matches
* [488](https://github.com/JetBrains/ideavim/pull/488) by [Martin Yzeiri](https://github.com/myzeiri): Add Matchit support for the C family of languages
* [493](https://github.com/JetBrains/ideavim/pull/493) by [Matt Ellis](https://github.com/citizenmatt): Improvements to Commentary extension
* [494](https://github.com/JetBrains/ideavim/pull/494) by [Matt Ellis](https://github.com/citizenmatt): Cleanup pre-212 CaretVisualAttributes compatibility code
* [504](https://github.com/JetBrains/ideavim/pull/504) by [Matt Ellis](https://github.com/citizenmatt): Minor bug fixes
## 1.10.0, 2022-02-17
### Features:
* Add register support to let command | [VIM-749](https://youtrack.jetbrains.com/issue/VIM-749), [VIM-1783](https://youtrack.jetbrains.com/issue/VIM-1783)
* Add tabmove command | [VIM-1164](https://youtrack.jetbrains.com/issue/VIM-1164)
### Fixes: ### Fixes:
* [VIM-2502](https://youtrack.jetbrains.com/issue/VIM-2502) Fix the shape of new carets * [VIM-2502](https://youtrack.jetbrains.com/issue/VIM-2502) Fix the shape of new carets
* [VIM-2499](https://youtrack.jetbrains.com/issue/VIM-2499) Fix mapping to esc * [VIM-2499](https://youtrack.jetbrains.com/issue/VIM-2499) Fix mapping to esc
* [VIM-2500](https://youtrack.jetbrains.com/issue/VIM-2500) Fix esc for normal mode * [VIM-2500](https://youtrack.jetbrains.com/issue/VIM-2500) Fix esc for normal mode
* [VIM-2523](https://youtrack.jetbrains.com/issue/VIM-2523) `i` command for the folder in the project tree
* [VIM-2471](https://youtrack.jetbrains.com/issue/VIM-2471) Multiple [{ and ]} actions
* [VIM-2504](https://youtrack.jetbrains.com/issue/VIM-2504) Fix esc with using python notebooks
* [VIM-2540](https://youtrack.jetbrains.com/issue/VIM-2540) Fix option listeners
* [VIM-2548](https://youtrack.jetbrains.com/issue/VIM-2548) Fix paste
* [VIM-2470](https://youtrack.jetbrains.com/issue/VIM-2470) Fix incorrect reset of cursor shape
* [VIM-2223](https://youtrack.jetbrains.com/issue/VIM-2223), [VIM-1684](https://youtrack.jetbrains.com/issue/VIM-1684), [VIM-2491](https://youtrack.jetbrains.com/issue/VIM-2491) Fix `gv`
### Merged PRs:
* [441](https://github.com/JetBrains/ideavim/pull/441) by [DanEEStar](https://github.com/DanEEStar): Add Matchit support for Vue.js files
* [440](https://github.com/JetBrains/ideavim/pull/440) by [Kevin Suen](https://github.com/ksrb): Add matchit support for handlebars
* [448](https://github.com/JetBrains/ideavim/pull/448) by [Michael Schertenleib](https://github.com/cravay): Support custom element names in vim-surround
* [435](https://github.com/JetBrains/ideavim/pull/435) by [Piotr Mikulski](https://github.com/pmnoxx): Print stderr when running a command just like vim does
* [449](https://github.com/JetBrains/ideavim/pull/449) by [Lonre Wang](https://github.com/lonre): Typo fix
* [453](https://github.com/JetBrains/ideavim/pull/453) by [Matt Ellis](https://github.com/citizenmatt): fix(VIM-2470): Fix incorrect reset of cursor shape
* [461](https://github.com/JetBrains/ideavim/pull/461) by [David Dadon](https://github.com/ddadon10): Add shortcut to ideajoin example
## 1.9.0, 2021-12-10 ## 1.9.0, 2021-12-10

View File

@ -4,6 +4,9 @@ IdeaVim is an open source project created by 80+ contributors. Would you like to
This page is created to help you start contributing. And who knows, maybe in a few days this project will be brighter than ever! This page is created to help you start contributing. And who knows, maybe in a few days this project will be brighter than ever!
:warning: The plugin is currently under a huge refactoring aiming to split into vim-engine and IdeaVim in order to
support the new [Fleet IDE](https://www.jetbrains.com/fleet/).
## Before you begin ## Before you begin
- The project is written in Kotlin and Java. Choose whichever language you feel more comfortable with, - The project is written in Kotlin and Java. Choose whichever language you feel more comfortable with,
@ -71,7 +74,7 @@ If you are looking for:
- Common features: - Common features:
- State machine. How every particular keystroke is parsed in IdeaVim: `KeyHandler.handleKey()`. - State machine. How every particular keystroke is parsed in IdeaVim: `KeyHandler.handleKey()`.
- Options (`incsearch`, `iskeyword`, `relativenumber`): `OptionsManager`. - Options (`incsearch`, `iskeyword`, `relativenumber`): `OptionServiceImpl`.
- Plugin startup: `PluginStartup`. - Plugin startup: `PluginStartup`.
- Notifications: `NotificationService`. - Notifications: `NotificationService`.
- Status bar icon: `StatusBar.kt`. - Status bar icon: `StatusBar.kt`.

View File

@ -212,6 +212,7 @@ Ex commands or via `:map` command mappings:
### Executing actions: ### Executing actions:
* `:action {action_id}` * `:action {action_id}`
* Execute an action by `{action_id}`. Works from Ex command line. * Execute an action by `{action_id}`. Works from Ex command line.
* Please don't use `:action` in mappings. Use `<Action>` instead.
* `<Action>({action_id})` * `<Action>({action_id})`
* For the mappings you can use a special `<Action>` keyword. Don't forget the parentheses. * For the mappings you can use a special `<Action>` keyword. Don't forget the parentheses.
* E.g. `map gh <Action>(ShowErrorDescription)` <- execute hover on `gh`. * E.g. `map gh <Action>(ShowErrorDescription)` <- execute hover on `gh`.

View File

@ -11,24 +11,24 @@ buildscript {
} }
dependencies { dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.10") classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21")
classpath("com.github.AlexPl292:mark-down-to-slack:1.1.2") classpath("com.github.AlexPl292:mark-down-to-slack:1.1.2")
classpath("org.eclipse.jgit:org.eclipse.jgit:5.13.0.202109080827-r") classpath("org.eclipse.jgit:org.eclipse.jgit:6.1.0.202203080745-r")
classpath("org.kohsuke:github-api:1.301") classpath("org.kohsuke:github-api:1.305")
classpath("org.jetbrains:markdown:0.2.4") classpath("org.jetbrains:markdown:0.3.1")
} }
} }
plugins { plugins {
antlr antlr
java java
kotlin("jvm") version "1.5.10" kotlin("jvm") version "1.6.21"
id("org.jetbrains.intellij") version "1.3.0" id("org.jetbrains.intellij") version "1.6.0"
id("org.jetbrains.changelog") version "1.3.1" id("org.jetbrains.changelog") version "1.3.1"
// ktlint linter - read more: https://github.com/JLLeitschuh/ktlint-gradle // ktlint linter - read more: https://github.com/JLLeitschuh/ktlint-gradle
id("org.jlleitschuh.gradle.ktlint") version "10.2.0" id("org.jlleitschuh.gradle.ktlint") version "10.2.1"
} }
// Import variables from gradle.properties file // Import variables from gradle.properties file
@ -38,6 +38,7 @@ val ideaVersion: String by project
val downloadIdeaSources: String by project val downloadIdeaSources: String by project
val instrumentPluginCode: String by project val instrumentPluginCode: String by project
val remoteRobotVersion: String by project val remoteRobotVersion: String by project
val antlrVersion: String by project
val publishChannels: String by project val publishChannels: String by project
val publishToken: String by project val publishToken: String by project
@ -57,11 +58,19 @@ dependencies {
testImplementation("com.ensarsarajcic.neovim.java:neovim-api:0.2.3") testImplementation("com.ensarsarajcic.neovim.java:neovim-api:0.2.3")
testImplementation("com.ensarsarajcic.neovim.java:core-rpc:0.2.3") testImplementation("com.ensarsarajcic.neovim.java:core-rpc:0.2.3")
// https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-test
testImplementation("org.jetbrains.kotlin:kotlin-test:$kotlinVersion")
// https://mvnrepository.com/artifact/org.mockito.kotlin/mockito-kotlin
testImplementation("org.mockito.kotlin:mockito-kotlin:4.0.0")
testImplementation("com.intellij.remoterobot:remote-robot:$remoteRobotVersion") testImplementation("com.intellij.remoterobot:remote-robot:$remoteRobotVersion")
testImplementation("com.intellij.remoterobot:remote-fixtures:$remoteRobotVersion") testImplementation("com.intellij.remoterobot:remote-fixtures:$remoteRobotVersion")
testImplementation("com.automation-remarks:video-recorder-junit:2.0") testImplementation("com.automation-remarks:video-recorder-junit:2.0")
runtimeOnly("org.antlr:antlr4-runtime:4.9.3") runtimeOnly("org.antlr:antlr4-runtime:$antlrVersion")
antlr("org.antlr:antlr4:4.9.3") antlr("org.antlr:antlr4:$antlrVersion")
implementation(project(":vim-engine"))
} }
configurations { configurations {
@ -71,6 +80,22 @@ configurations {
} }
// --- Compilation // --- Compilation
// This can be moved to other test registration when issue with tests in gradle will be fixed
tasks.register<Test>("testWithNeovim") {
group = "verification"
systemProperty("ideavim.nvim.test", "true")
exclude("/ui/**")
}
tasks.register<Test>("testPropertyBased") {
group = "verification"
// include("**/propertybased/**")
}
tasks.register<Test>("testLongRunning") {
group = "verification"
// include("**/longrunning/**")
}
tasks { tasks {
// Issue in gradle 7.3 // Issue in gradle 7.3
@ -83,6 +108,32 @@ tasks {
exclude("**/ParserTest.class") exclude("**/ParserTest.class")
} }
val testWithNeovim by getting(Test::class) {
isScanForTestClasses = false
// Only run tests from classes that end with "Test"
include("**/*Test.class")
include("**/*test.class")
include("**/*Tests.class")
exclude("**/ParserTest.class")
}
val testPropertyBased by getting(Test::class) {
isScanForTestClasses = false
// Only run tests from classes that end with "Test"
include("**/propertybased/*Test.class")
include("**/propertybased/*test.class")
include("**/propertybased/*Tests.class")
}
val testLongRunning by getting(Test::class) {
isScanForTestClasses = false
// Only run tests from classes that end with "Test"
include("**/longrunning/**/*Test.class")
include("**/longrunning/**/*test.class")
include("**/longrunning/**/*Tests.class")
exclude("**/longrunning/**/ParserTest.class")
}
compileJava { compileJava {
sourceCompatibility = javaVersion sourceCompatibility = javaVersion
targetCompatibility = javaVersion targetCompatibility = javaVersion
@ -93,14 +144,14 @@ tasks {
compileKotlin { compileKotlin {
kotlinOptions { kotlinOptions {
jvmTarget = javaVersion jvmTarget = javaVersion
apiVersion = "1.4" apiVersion = "1.5"
// allWarningsAsErrors = true // allWarningsAsErrors = true
} }
} }
compileTestKotlin { compileTestKotlin {
kotlinOptions { kotlinOptions {
jvmTarget = javaVersion jvmTarget = javaVersion
apiVersion = "1.4" apiVersion = "1.5"
// allWarningsAsErrors = true // allWarningsAsErrors = true
} }
} }
@ -118,11 +169,14 @@ gradle.projectsEvaluated {
intellij { intellij {
version.set(ideaVersion) version.set(ideaVersion)
pluginName.set("IdeaVim") pluginName.set("IdeaVim")
updateSinceUntilBuild.set(false) updateSinceUntilBuild.set(false)
downloadSources.set(downloadIdeaSources.toBoolean()) downloadSources.set(downloadIdeaSources.toBoolean())
instrumentCode.set(instrumentPluginCode.toBoolean()) instrumentCode.set(instrumentPluginCode.toBoolean())
intellijRepository.set("https://www.jetbrains.com/intellij-repository") intellijRepository.set("https://www.jetbrains.com/intellij-repository")
plugins.set(listOf("java", "AceJump:3.8.4")) // Yaml is only used for testing. It's part of the IdeaIC distribution, but needs to be included as a reference
plugins.set(listOf("java", "AceJump:3.8.4", "yaml"))
} }
tasks { tasks {
@ -145,6 +199,7 @@ tasks {
runPluginVerifier { runPluginVerifier {
downloadDir.set("${project.buildDir}/pluginVerifier/ides") downloadDir.set("${project.buildDir}/pluginVerifier/ides")
teamCityOutputFormat.set(true) teamCityOutputFormat.set(true)
ideVersions.set(listOf("IC-2021.3.4"))
} }
generateGrammarSource { generateGrammarSource {
@ -174,22 +229,6 @@ tasks {
} }
} }
tasks.register<Test>("testWithNeovim") {
group = "verification"
systemProperty("ideavim.nvim.test", "true")
exclude("/ui/**")
}
tasks.register<Test>("testPropertyBased") {
group = "verification"
include("**/propertybased/**")
}
tasks.register<Test>("testLongRunning") {
group = "verification"
include("**/longrunning/**")
}
tasks.register<Test>("testUi") { tasks.register<Test>("testUi") {
group = "verification" group = "verification"
include("/ui/**") include("/ui/**")

View File

@ -1,6 +1,8 @@
Some examples of join command with `ideajoin` option enabled. Some examples of join command with `ideajoin` option enabled.
Put `set ideajoin` to your `~/.ideavimrc` to enable this functionality. Put `set ideajoin` to your `~/.ideavimrc` to enable this functionality.
Now, you can press `J` (`shift+j`) on a line or a selected block of text to join the lines together.
* Automatic join concatenated lines: * Automatic join concatenated lines:
``` ```
@ -55,4 +57,4 @@ sb.append("a"); -> sb.append("a").append("b");
sb.append("b"); sb.append("b");
``` ```
And other features provided by the plugins. And other features provided by the plugins.

View File

@ -6,9 +6,10 @@ instrumentPluginCode=true
version=SNAPSHOT version=SNAPSHOT
javaVersion=11 javaVersion=11
remoteRobotVersion=0.11.10 remoteRobotVersion=0.11.10
antlrVersion=4.10.1
# Please don't forget to update kotlin version in buildscript section # Please don't forget to update kotlin version in buildscript section
kotlinVersion=1.5.10 kotlinVersion=1.6.21
publishToken=token publishToken=token
publishChannels=eap publishChannels=eap

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View File

@ -1,19 +1,3 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
rootProject.name = 'IdeaVIM' rootProject.name = 'IdeaVIM'
include 'vim-engine'

View File

@ -28,7 +28,7 @@ comment: (WS | COLON)* QUOTE ~(NEW_LINE)* NEW_LINE;
finishStatement: (WS | COLON)* FINISH WS* (NEW_LINE | BAR); finishStatement: (WS | COLON)* FINISH WS* (NEW_LINE | BAR);
continueStatement: (WS | COLON)* CONTINUE WS* (NEW_LINE | BAR); continueStatement: (WS | COLON)* CONTINUE WS* (NEW_LINE | BAR);
breakStatement: (WS | COLON)* BREAK WS* (NEW_LINE | BAR); breakStatement: (WS | COLON)* BREAK WS* (NEW_LINE | BAR);
returnStatement: (WS | COLON)* range? (WS | COLON)* RETURN WS+ expr WS* (NEW_LINE | BAR); returnStatement: (WS | COLON)* range? (WS | COLON)* RETURN (WS+ expr)? WS* (NEW_LINE | BAR);
throwStatement: (WS | COLON)* THROW WS+ expr WS* (NEW_LINE | BAR); throwStatement: (WS | COLON)* THROW WS+ expr WS* (NEW_LINE | BAR);
ifStatement: ifBlock ifStatement: ifBlock
@ -117,7 +117,7 @@ command:
| MARK_COMMAND | JUMPS | J_LOWERCASE | JOIN_LINES | HISTORY | GO_TO_CHAR | SYMBOL | FIND | CLASS | F_LOWERCASE | MARK_COMMAND | JUMPS | J_LOWERCASE | JOIN_LINES | HISTORY | GO_TO_CHAR | SYMBOL | FIND | CLASS | F_LOWERCASE
| FILE | EXIT | E_LOWERCASE | EDIT_FILE | DUMP_LINE | DIGRAPH | DEL_MARKS | D_LOWERCASE | DEL_LINES | DELCMD | FILE | EXIT | E_LOWERCASE | EDIT_FILE | DUMP_LINE | DIGRAPH | DEL_MARKS | D_LOWERCASE | DEL_LINES | DELCMD
| T_LOWERCASE | COPY | CMD_CLEAR | BUFFER_LIST | BUFFER_CLOSE | B_LOWERCASE | BUFFER | ASCII | T_LOWERCASE | COPY | CMD_CLEAR | BUFFER_LIST | BUFFER_CLOSE | B_LOWERCASE | BUFFER | ASCII
| ACTIONLIST | ACTION | LOCKVAR | UNLOCKVAR | PACKADD | ACTIONLIST | ACTION | LOCKVAR | UNLOCKVAR | PACKADD | TABMOVE
) )
WS* ((commandArgumentWithoutBars? inline_comment NEW_LINE) | (commandArgumentWithoutBars? NEW_LINE) | (commandArgumentWithoutBars? BAR)) (NEW_LINE | BAR)* WS* ((commandArgumentWithoutBars? inline_comment NEW_LINE) | (commandArgumentWithoutBars? NEW_LINE) | (commandArgumentWithoutBars? BAR)) (NEW_LINE | BAR)*
#CommandWithComment| #CommandWithComment|
@ -492,6 +492,7 @@ existingCommands: RETURN
| EXECUTE | EXECUTE
| CALL | CALL
| NORMAL | NORMAL
| TABMOVE
; ;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// //
@ -684,6 +685,7 @@ EXECUTE: 'exe' | 'exec' | 'execu' | 'execut' | 'execute';
LOCKVAR: 'lockv' | 'lockva' | 'lockvar'; LOCKVAR: 'lockv' | 'lockva' | 'lockvar';
UNLOCKVAR: 'unlo' | 'unloc' | 'unlock' | 'unlockv' | 'unlockva' | 'unlockvar'; UNLOCKVAR: 'unlo' | 'unloc' | 'unlock' | 'unlockv' | 'unlockva' | 'unlockvar';
NORMAL: 'norm' | 'norma' | 'normal'; NORMAL: 'norm' | 'norma' | 'normal';
TABMOVE: 'tabm' | 'tabmo' | 'tabmov' | 'tabmove';
// Types // Types
DIGIT: [0-9]; DIGIT: [0-9];

View File

@ -1,6 +1,6 @@
/* /*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors * Copyright (C) 2003-2022 The IdeaVim authors
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/* /*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors * Copyright (C) 2003-2022 The IdeaVim authors
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -53,7 +53,7 @@ public class EventFacade {
public void setupTypedActionHandler(@NotNull VimTypedActionHandler handler) { public void setupTypedActionHandler(@NotNull VimTypedActionHandler handler) {
final TypedAction typedAction = getTypedAction(); final TypedAction typedAction = getTypedAction();
if (HandlerInjector.notebookCommandMode()) { if (HandlerInjector.notebookCommandMode(null)) {
TypedActionHandler result = HandlerInjector.inject(); TypedActionHandler result = HandlerInjector.inject();
if (result != null) { if (result != null) {
myOriginalTypedActionHandler = result; myOriginalTypedActionHandler = result;

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
/* /*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors * Copyright (C) 2003-2022 The IdeaVim authors
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/* /*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors * Copyright (C) 2003-2022 The IdeaVim authors
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -22,6 +22,7 @@ import com.maddyhome.idea.vim.group.KeyGroup;
import com.maddyhome.idea.vim.handler.ActionBeanClass; import com.maddyhome.idea.vim.handler.ActionBeanClass;
import com.maddyhome.idea.vim.handler.EditorActionHandlerBase; import com.maddyhome.idea.vim.handler.EditorActionHandlerBase;
import com.maddyhome.idea.vim.key.MappingOwner; import com.maddyhome.idea.vim.key.MappingOwner;
import com.maddyhome.idea.vim.newapi.IjVimActionsInitiator;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@ -71,7 +72,7 @@ public class RegisterActions {
private static void registerVimCommandActions() { private static void registerVimCommandActions() {
KeyGroup parser = VimPlugin.getKey(); KeyGroup parser = VimPlugin.getKey();
VIM_ACTIONS_EP.extensions().forEach(parser::registerCommandAction); VIM_ACTIONS_EP.extensions().map(IjVimActionsInitiator::new).forEach(parser::registerCommandAction);
} }
private static void registerEmptyShortcuts() { private static void registerEmptyShortcuts() {
@ -80,6 +81,6 @@ public class RegisterActions {
// The {char1} <BS> {char2} shortcut is handled directly by KeyHandler#handleKey, so doesn't have an action. But we // The {char1} <BS> {char2} shortcut is handled directly by KeyHandler#handleKey, so doesn't have an action. But we
// still need to register the shortcut, to make sure the editor doesn't swallow it. // still need to register the shortcut, to make sure the editor doesn't swallow it.
parser parser
.registerShortcutWithoutAction(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0), MappingOwner.IdeaVim.INSTANCE); .registerShortcutWithoutAction(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0), MappingOwner.IdeaVim.System.INSTANCE);
} }
} }

View File

@ -1,6 +1,6 @@
/* /*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors * Copyright (C) 2003-2022 The IdeaVim authors
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/* /*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors * Copyright (C) 2003-2022 The IdeaVim authors
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -25,7 +25,6 @@ import com.intellij.openapi.Disposable;
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.components.PersistentStateComponent; import com.intellij.openapi.components.PersistentStateComponent;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.components.State; import com.intellij.openapi.components.State;
import com.intellij.openapi.components.Storage; import com.intellij.openapi.components.Storage;
import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.diagnostic.Logger;
@ -35,11 +34,10 @@ import com.intellij.openapi.keymap.ex.KeymapManagerEx;
import com.intellij.openapi.keymap.impl.DefaultKeymap; import com.intellij.openapi.keymap.impl.DefaultKeymap;
import com.intellij.openapi.options.ShowSettingsUtil; import com.intellij.openapi.options.ShowSettingsUtil;
import com.intellij.openapi.project.Project; import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectManager;
import com.intellij.openapi.ui.Messages; import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.util.SystemInfo; import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.wm.StatusBar; import com.maddyhome.idea.vim.api.VimInjectorKt;
import com.intellij.openapi.wm.WindowManager; import com.maddyhome.idea.vim.api.VimKeyGroup;
import com.maddyhome.idea.vim.config.VimState; import com.maddyhome.idea.vim.config.VimState;
import com.maddyhome.idea.vim.config.migration.ApplicationConfigurationMigrator; import com.maddyhome.idea.vim.config.migration.ApplicationConfigurationMigrator;
import com.maddyhome.idea.vim.extension.VimExtensionRegistrar; import com.maddyhome.idea.vim.extension.VimExtensionRegistrar;
@ -49,21 +47,20 @@ import com.maddyhome.idea.vim.group.copy.YankGroup;
import com.maddyhome.idea.vim.group.visual.VisualMotionGroup; import com.maddyhome.idea.vim.group.visual.VisualMotionGroup;
import com.maddyhome.idea.vim.helper.MacKeyRepeat; import com.maddyhome.idea.vim.helper.MacKeyRepeat;
import com.maddyhome.idea.vim.listener.VimListenerManager; import com.maddyhome.idea.vim.listener.VimListenerManager;
import com.maddyhome.idea.vim.option.OptionsManager; import com.maddyhome.idea.vim.newapi.IjVimInjector;
import com.maddyhome.idea.vim.options.OptionService;
import com.maddyhome.idea.vim.ui.StatusBarIconFactory; import com.maddyhome.idea.vim.ui.StatusBarIconFactory;
import com.maddyhome.idea.vim.ui.VimEmulationConfigurable; import com.maddyhome.idea.vim.ui.VimEmulationConfigurable;
import com.maddyhome.idea.vim.ui.ex.ExEntryPanel; import com.maddyhome.idea.vim.ui.ex.ExEntryPanel;
import com.maddyhome.idea.vim.vimscript.services.FunctionStorage; import com.maddyhome.idea.vim.vimscript.services.FunctionStorage;
import com.maddyhome.idea.vim.vimscript.services.OptionService; import com.maddyhome.idea.vim.vimscript.services.IjVimOptionService;
import com.maddyhome.idea.vim.vimscript.services.VariableService; import com.maddyhome.idea.vim.vimscript.services.VimVariableService;
import com.maddyhome.idea.vim.vimscript.services.VariableServiceImpl;
import org.jdom.Element; import org.jdom.Element;
import org.jetbrains.annotations.Nls; import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import javax.swing.event.HyperlinkEvent; import javax.swing.event.HyperlinkEvent;
import java.awt.*;
import static com.maddyhome.idea.vim.group.EditorGroup.EDITOR_STORE_ELEMENT; import static com.maddyhome.idea.vim.group.EditorGroup.EDITOR_STORE_ELEMENT;
import static com.maddyhome.idea.vim.group.KeyGroup.SHORTCUT_CONFLICTS_ELEMENT; import static com.maddyhome.idea.vim.group.KeyGroup.SHORTCUT_CONFLICTS_ELEMENT;
@ -77,18 +74,16 @@ import static com.maddyhome.idea.vim.vimscript.services.VimRcService.executeIdea
* This is an application level plugin meaning that all open projects will share a common instance of the plugin. * This is an application level plugin meaning that all open projects will share a common instance of the plugin.
* Registers and marks are shared across open projects so you can copy and paste between files of different projects. * Registers and marks are shared across open projects so you can copy and paste between files of different projects.
*/ */
@SuppressWarnings("deprecation")
// [VERSION UPDATE] 212+ getService
@State(name = "VimSettings", storages = {@Storage("$APP_CONFIG$/vim_settings.xml")}) @State(name = "VimSettings", storages = {@Storage("$APP_CONFIG$/vim_settings.xml")})
public class VimPlugin implements PersistentStateComponent<Element>, Disposable { public class VimPlugin implements PersistentStateComponent<Element>, Disposable {
static {
VimInjectorKt.setInjector(new IjVimInjector());
}
private static final String IDEAVIM_PLUGIN_ID = "IdeaVIM"; private static final String IDEAVIM_PLUGIN_ID = "IdeaVIM";
public static final int STATE_VERSION = 7; public static final int STATE_VERSION = 7;
private static long lastBeepTimeMillis;
private boolean error = false;
private String message = null;
private int previousStateVersion = 0; private int previousStateVersion = 0;
private String previousKeyMap = ""; private String previousKeyMap = "";
@ -131,10 +126,10 @@ public class VimPlugin implements PersistentStateComponent<Element>, Disposable
*/ */
public static @NotNull NotificationService getNotifications(@Nullable Project project) { public static @NotNull NotificationService getNotifications(@Nullable Project project) {
if (project == null) { if (project == null) {
return ServiceManager.getService(NotificationService.class); return ApplicationManager.getApplication().getService(NotificationService.class);
} }
else { else {
return ServiceManager.getService(project, NotificationService.class); return project.getService(NotificationService.class);
} }
} }
@ -144,35 +139,35 @@ public class VimPlugin implements PersistentStateComponent<Element>, Disposable
public static @NotNull MotionGroup getMotion() { public static @NotNull MotionGroup getMotion() {
return ServiceManager.getService(MotionGroup.class); return ApplicationManager.getApplication().getService(MotionGroup.class);
}
public static @NotNull XMLGroup getXML() {
return ApplicationManager.getApplication().getService(XMLGroup.class);
} }
public static @NotNull ChangeGroup getChange() { public static @NotNull ChangeGroup getChange() {
return ServiceManager.getService(ChangeGroup.class); return ((ChangeGroup)VimInjectorKt.getInjector().getChangeGroup());
} }
public static @NotNull CommandGroup getCommand() { public static @NotNull CommandGroup getCommand() {
return ServiceManager.getService(CommandGroup.class); return ApplicationManager.getApplication().getService(CommandGroup.class);
} }
public static @NotNull MarkGroup getMark() { public static @NotNull MarkGroup getMark() {
return ServiceManager.getService(MarkGroup.class); return ((MarkGroup)VimInjectorKt.getInjector().getMarkGroup());
} }
public static @NotNull RegisterGroup getRegister() { public static @NotNull RegisterGroup getRegister() {
return ServiceManager.getService(RegisterGroup.class); return ((RegisterGroup)VimInjectorKt.getInjector().getRegisterGroup());
}
public static @Nullable RegisterGroup getRegisterIfCreated() {
return ApplicationManager.getApplication().getServiceIfCreated(RegisterGroup.class);
} }
public static @NotNull FileGroup getFile() { public static @NotNull FileGroup getFile() {
return ServiceManager.getService(FileGroup.class); return (FileGroup)VimInjectorKt.getInjector().getFile();
} }
public static @NotNull SearchGroup getSearch() { public static @NotNull SearchGroup getSearch() {
return ServiceManager.getService(SearchGroup.class); return ApplicationManager.getApplication().getService(SearchGroup.class);
} }
public static @Nullable SearchGroup getSearchIfCreated() { public static @Nullable SearchGroup getSearchIfCreated() {
@ -180,35 +175,39 @@ public class VimPlugin implements PersistentStateComponent<Element>, Disposable
} }
public static @NotNull ProcessGroup getProcess() { public static @NotNull ProcessGroup getProcess() {
return ServiceManager.getService(ProcessGroup.class); return ((ProcessGroup)VimInjectorKt.getInjector().getProcessGroup());
} }
public static @NotNull MacroGroup getMacro() { public static @NotNull MacroGroup getMacro() {
return ServiceManager.getService(MacroGroup.class); return (MacroGroup)VimInjectorKt.getInjector().getMacro();
} }
public static @NotNull DigraphGroup getDigraph() { public static @NotNull DigraphGroup getDigraph() {
return ServiceManager.getService(DigraphGroup.class); return (DigraphGroup)VimInjectorKt.getInjector().getDigraphGroup();
} }
public static @NotNull HistoryGroup getHistory() { public static @NotNull HistoryGroup getHistory() {
return ServiceManager.getService(HistoryGroup.class); return ApplicationManager.getApplication().getService(HistoryGroup.class);
} }
public static @NotNull KeyGroup getKey() { public static @NotNull KeyGroup getKey() {
return ServiceManager.getService(KeyGroup.class); return ((KeyGroup)VimInjectorKt.getInjector().getKeyGroup());
} }
public static @Nullable KeyGroup getKeyIfCreated() { public static @Nullable KeyGroup getKeyIfCreated() {
return ApplicationManager.getApplication().getServiceIfCreated(KeyGroup.class); return ((KeyGroup)ApplicationManager.getApplication().getServiceIfCreated(VimKeyGroup.class));
} }
public static @NotNull WindowGroup getWindow() { public static @NotNull WindowGroup getWindow() {
return ServiceManager.getService(WindowGroup.class); return ((WindowGroup)VimInjectorKt.getInjector().getWindow());
}
public static @NotNull TabService getTabService() {
return ApplicationManager.getApplication().getService(TabService.class);
} }
public static @NotNull EditorGroup getEditor() { public static @NotNull EditorGroup getEditor() {
return ServiceManager.getService(EditorGroup.class); return ApplicationManager.getApplication().getService(EditorGroup.class);
} }
public static @Nullable EditorGroup getEditorIfCreated() { public static @Nullable EditorGroup getEditorIfCreated() {
@ -216,23 +215,27 @@ public class VimPlugin implements PersistentStateComponent<Element>, Disposable
} }
public static @NotNull VisualMotionGroup getVisualMotion() { public static @NotNull VisualMotionGroup getVisualMotion() {
return ServiceManager.getService(VisualMotionGroup.class); return (VisualMotionGroup)VimInjectorKt.getInjector().getVisualMotionGroup();
} }
public static @NotNull YankGroup getYank() { public static @NotNull YankGroup getYank() {
return ServiceManager.getService(YankGroup.class); return (YankGroup)VimInjectorKt.getInjector().getYank();
} }
public static @NotNull PutGroup getPut() { public static @NotNull PutGroup getPut() {
return ServiceManager.getService(PutGroup.class); return (PutGroup)VimInjectorKt.getInjector().getPut();
} }
public static @NotNull VariableService getVariableService() { public static @NotNull VimVariableService getVariableService() {
return ServiceManager.getService(VariableService.class); return ApplicationManager.getApplication().getService(VimVariableService.class);
} }
public static @NotNull OptionService getOptionService() { public static @NotNull OptionService getOptionService() {
return ServiceManager.getService(OptionService.class); return VimInjectorKt.getInjector().getOptionService();
}
public static @NotNull IjVimOptionService getOptionServiceImpl() {
return (IjVimOptionService)VimInjectorKt.getInjector().getOptionService();
} }
private static @NotNull NotificationService getNotifications() { private static @NotNull NotificationService getNotifications() {
@ -285,85 +288,79 @@ public class VimPlugin implements PersistentStateComponent<Element>, Disposable
} }
public static boolean isError() { public static boolean isError() {
return getInstance().error; return VimInjectorKt.getInjector().getMessages().isError();
} }
public static String getMessage() { public static String getMessage() {
return getInstance().message; return VimInjectorKt.getInjector().getMessages().getStatusBarMessage();
} }
/** /**
* Indicate to the user that an error has occurred. Just beep. * Indicate to the user that an error has occurred. Just beep.
*/ */
public static void indicateError() { public static void indicateError() {
if (ApplicationManager.getApplication().isUnitTestMode()) { VimInjectorKt.getInjector().getMessages().indicateError();
getInstance().error = true;
}
else if (!VimPlugin.getOptionService().isSet(OptionService.Scope.GLOBAL.INSTANCE, "visualbell", "visualbell")) {
// Vim only allows a beep once every half second - :help 'visualbell'
final long currentTimeMillis = System.currentTimeMillis();
if (currentTimeMillis - lastBeepTimeMillis > 500) {
Toolkit.getDefaultToolkit().beep();
lastBeepTimeMillis = currentTimeMillis;
}
}
} }
public static void clearError() { public static void clearError() {
if (ApplicationManager.getApplication().isUnitTestMode()) { VimInjectorKt.getInjector().getMessages().clearError();
getInstance().error = false;
}
} }
public static void showMode(String msg) { public static void showMode(String msg) {
showMessage(msg); VimInjectorKt.getInjector().getMessages().showMode(msg);
} }
public static void showMessage(@Nls(capitalization = Nls.Capitalization.Sentence) @Nullable String msg) { public static void showMessage(@Nls(capitalization = Nls.Capitalization.Sentence) @Nullable String msg) {
if (ApplicationManager.getApplication().isUnitTestMode()) { VimInjectorKt.getInjector().getMessages().showStatusBarMessage(msg);
getInstance().message = msg;
}
ProjectManager pm = ProjectManager.getInstance();
Project[] projects = pm.getOpenProjects();
for (Project project : projects) {
StatusBar bar = WindowManager.getInstance().getStatusBar(project);
if (bar != null) {
if (msg == null || msg.length() == 0) {
bar.setInfo("");
}
else {
bar.setInfo("VIM - " + msg);
}
}
}
} }
public static @NotNull VimPlugin getInstance() { public static @NotNull VimPlugin getInstance() {
return ServiceManager.getService(VimPlugin.class); return ApplicationManager.getApplication().getService(VimPlugin.class);
} }
/**
* IdeaVim plugin initialization.
* This is an important operation and some commands ordering should be preserved.
* Please make sure that the documentation of this function is in sync with the code
*
* 1) Update state
* This schedules a state update. In most cases it just shows some dialogs to the user. As I know, there are
* no special reasons to keep this command as a first line, so it seems safe to move it.
* 2) Command registration
* This block should be located BEFORE ~/.ideavimrc execution. Without it the commands won't be registered
* and initialized, but ~/.ideavimrc file may refer or execute some commands or functions.
* This block DOES NOT initialize extensions, but only registers the available ones.
* 3) ~/.ideavimrc execution
* 3.1 executes commands from the .ideavimrc file and 3.2 initializes extensions.
* 3.1 MUST BE BEFORE 3.2. This is a flow of vim/IdeaVim initialization, firstly .ideavimrc is executed and then
* the extensions are initialized.
* 4) Components initialization
* This should happen after ideavimrc execution because VimListenerManager accesses `number` option
* to init line numbers and guicaret to initialize carets.
* However, there is a question about listeners attaching. Listeners registration happens after the .ideavimrc
* execution, what theoretically may cause bugs (e.g. VIM-2540)
*/
private void turnOnPlugin() { private void turnOnPlugin() {
// 1) Update state
ApplicationManager.getApplication().invokeLater(this::updateState); ApplicationManager.getApplication().invokeLater(this::updateState);
// Register vim actions in command mode // 2) Command registration
// 2.1) Register vim actions in command mode
RegisterActions.registerActions(); RegisterActions.registerActions();
// Register extensions // 2.2) Register extensions
VimExtensionRegistrar.registerExtensions(); VimExtensionRegistrar.registerExtensions();
// Register functions // 2.3) Register functions
FunctionStorage.INSTANCE.registerHandlers(); FunctionStorage.INSTANCE.registerHandlers();
// Execute ~/.ideavimrc // 3) ~/.ideavimrc execution
// 3.1) Execute ~/.ideavimrc
registerIdeavimrc(); registerIdeavimrc();
// Initialize extensions // 3.2) Initialize extensions. Always after 3.1
VimExtensionRegistrar.enableDelayedExtensions(); VimExtensionRegistrar.enableDelayedExtensions();
// Some options' default values are based on values set in .ideavimrc, e.g. 'shellxquote' on Windows when 'shell'
// is cmd.exe has a different default to when 'shell' contains "sh"
OptionsManager.INSTANCE.completeInitialisation();
// Turing on should be performed after all commands registration // Turing on should be performed after all commands registration
getSearch().turnOn(); getSearch().turnOn();
VimListenerManager.INSTANCE.turnOn(); VimListenerManager.INSTANCE.turnOn();

View File

@ -1,6 +1,6 @@
/* /*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors * Copyright (C) 2003-2022 The IdeaVim authors
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/* /*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors * Copyright (C) 2003-2022 The IdeaVim authors
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -25,8 +25,12 @@ import com.intellij.openapi.editor.actionSystem.TypedActionHandler
import com.intellij.openapi.editor.actionSystem.TypedActionHandlerEx import com.intellij.openapi.editor.actionSystem.TypedActionHandlerEx
import com.intellij.openapi.progress.ProcessCanceledException import com.intellij.openapi.progress.ProcessCanceledException
import com.maddyhome.idea.vim.helper.EditorDataContext import com.maddyhome.idea.vim.helper.EditorDataContext
import com.maddyhome.idea.vim.helper.inInsertMode
import com.maddyhome.idea.vim.helper.isIdeaVimDisabledHere import com.maddyhome.idea.vim.helper.isIdeaVimDisabledHere
import com.maddyhome.idea.vim.vimscript.services.OptionService import com.maddyhome.idea.vim.key.KeyHandlerKeeper
import com.maddyhome.idea.vim.newapi.vim
import com.maddyhome.idea.vim.options.OptionConstants
import com.maddyhome.idea.vim.options.OptionScope
import java.awt.event.KeyAdapter import java.awt.event.KeyAdapter
import java.awt.event.KeyEvent import java.awt.event.KeyEvent
import javax.swing.KeyStroke import javax.swing.KeyStroke
@ -36,33 +40,43 @@ import javax.swing.KeyStroke
* *
* IDE shortcut keys used by Vim commands are handled by [com.maddyhome.idea.vim.action.VimShortcutKeyAction]. * IDE shortcut keys used by Vim commands are handled by [com.maddyhome.idea.vim.action.VimShortcutKeyAction].
*/ */
class VimTypedActionHandler(origHandler: TypedActionHandler?) : TypedActionHandlerEx { class VimTypedActionHandler(origHandler: TypedActionHandler) : TypedActionHandlerEx {
private val handler = KeyHandler.getInstance() private val handler = KeyHandler.getInstance()
private val traceTime = VimPlugin.getOptionService().isSet(OptionService.Scope.GLOBAL, "ideatracetime") private val traceTime = VimPlugin.getOptionService().isSet(OptionScope.GLOBAL, OptionConstants.ideatracetimeName)
init { init {
handler.originalHandler = origHandler KeyHandlerKeeper.getInstance().originalHandler = origHandler
} }
override fun beforeExecute(editor: Editor, charTyped: Char, context: DataContext, plan: ActionPlan) { override fun beforeExecute(editor: Editor, charTyped: Char, context: DataContext, plan: ActionPlan) {
LOG.trace("Before execute for typed action") LOG.trace("Before execute for typed action")
if (editor.isIdeaVimDisabledHere) { if (editor.isIdeaVimDisabledHere) {
LOG.trace("IdeaVim disabled here, finish") LOG.trace("IdeaVim disabled here, finish")
(handler.originalHandler as? TypedActionHandlerEx)?.beforeExecute(editor, charTyped, context, plan) (KeyHandlerKeeper.getInstance().originalHandler as? TypedActionHandlerEx)?.beforeExecute(editor, charTyped, context, plan)
return return
} }
LOG.trace("Executing before execute") LOG.trace("Executing before execute")
val modifiers = if (charTyped == ' ' && VimKeyListener.isSpaceShift) KeyEvent.SHIFT_DOWN_MASK else 0 val modifiers = if (charTyped == ' ' && VimKeyListener.isSpaceShift) KeyEvent.SHIFT_DOWN_MASK else 0
val keyStroke = KeyStroke.getKeyStroke(charTyped, modifiers) val keyStroke = KeyStroke.getKeyStroke(charTyped, modifiers)
handler.beforeHandleKey(editor, keyStroke, context, plan)
/* Invoked before acquiring a write lock and actually handling the keystroke.
*
* Drafts an optional [ActionPlan] that will be used as a base for zero-latency rendering in editor.
*/
if (editor.inInsertMode) {
val originalHandler = KeyHandlerKeeper.getInstance().originalHandler
if (originalHandler is TypedActionHandlerEx) {
originalHandler.beforeExecute(editor, keyStroke.keyChar, context, plan)
}
}
} }
override fun execute(editor: Editor, charTyped: Char, context: DataContext) { override fun execute(editor: Editor, charTyped: Char, context: DataContext) {
LOG.trace("Execute for typed action") LOG.trace("Execute for typed action")
if (editor.isIdeaVimDisabledHere) { if (editor.isIdeaVimDisabledHere) {
LOG.trace("IdeaVim disabled here, finish") LOG.trace("IdeaVim disabled here, finish")
handler.originalHandler.execute(editor, charTyped, context) KeyHandlerKeeper.getInstance().originalHandler.execute(editor, charTyped, context)
return return
} }
@ -71,7 +85,7 @@ class VimTypedActionHandler(origHandler: TypedActionHandler?) : TypedActionHandl
val modifiers = if (charTyped == ' ' && VimKeyListener.isSpaceShift) KeyEvent.SHIFT_DOWN_MASK else 0 val modifiers = if (charTyped == ' ' && VimKeyListener.isSpaceShift) KeyEvent.SHIFT_DOWN_MASK else 0
val keyStroke = KeyStroke.getKeyStroke(charTyped, modifiers) val keyStroke = KeyStroke.getKeyStroke(charTyped, modifiers)
val startTime = if (traceTime) System.currentTimeMillis() else null val startTime = if (traceTime) System.currentTimeMillis() else null
handler.handleKey(editor, keyStroke, EditorDataContext.init(editor, context)) handler.handleKey(editor.vim, keyStroke, EditorDataContext.init(editor, context).vim)
if (startTime != null) { if (startTime != null) {
val duration = System.currentTimeMillis() - startTime val duration = System.currentTimeMillis() - startTime
LOG.info("VimTypedAction '$charTyped': $duration ms") LOG.info("VimTypedAction '$charTyped': $duration ms")

View File

@ -1,6 +1,6 @@
/* /*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors * Copyright (C) 2003-2022 The IdeaVim authors
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -17,9 +17,9 @@
*/ */
package com.maddyhome.idea.vim.action package com.maddyhome.idea.vim.action
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.api.ExecutionContext
import com.maddyhome.idea.vim.api.VimEditor
import com.maddyhome.idea.vim.command.Command import com.maddyhome.idea.vim.command.Command
import com.maddyhome.idea.vim.command.OperatorArguments import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.handler.VimActionHandler import com.maddyhome.idea.vim.handler.VimActionHandler
@ -27,7 +27,7 @@ import com.maddyhome.idea.vim.handler.VimActionHandler
class ExEntryAction : VimActionHandler.SingleExecution() { class ExEntryAction : VimActionHandler.SingleExecution() {
override val type: Command.Type = Command.Type.OTHER_READONLY override val type: Command.Type = Command.Type.OTHER_READONLY
override fun execute(editor: Editor, context: DataContext, cmd: Command, operatorArguments: OperatorArguments): Boolean { override fun execute(editor: VimEditor, context: ExecutionContext, cmd: Command, operatorArguments: OperatorArguments): Boolean {
VimPlugin.getProcess().startExCommand(editor, context, cmd) VimPlugin.getProcess().startExCommand(editor, context, cmd)
return true return true
} }

View File

@ -1,6 +1,6 @@
/* /*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors * Copyright (C) 2003-2022 The IdeaVim authors
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/* /*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors * Copyright (C) 2003-2022 The IdeaVim authors
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -34,10 +34,10 @@ import com.intellij.openapi.util.Key
import com.intellij.ui.KeyStrokeAdapter import com.intellij.ui.KeyStrokeAdapter
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.api.injector
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
import com.maddyhome.idea.vim.helper.HandlerInjector import com.maddyhome.idea.vim.helper.HandlerInjector
import com.maddyhome.idea.vim.helper.StringHelper
import com.maddyhome.idea.vim.helper.inInsertMode import com.maddyhome.idea.vim.helper.inInsertMode
import com.maddyhome.idea.vim.helper.inNormalMode import com.maddyhome.idea.vim.helper.inNormalMode
import com.maddyhome.idea.vim.helper.isIdeaVimDisabledHere import com.maddyhome.idea.vim.helper.isIdeaVimDisabledHere
@ -48,10 +48,14 @@ import com.maddyhome.idea.vim.key.ShortcutOwner
import com.maddyhome.idea.vim.key.ShortcutOwnerInfo import com.maddyhome.idea.vim.key.ShortcutOwnerInfo
import com.maddyhome.idea.vim.listener.AceJumpService import com.maddyhome.idea.vim.listener.AceJumpService
import com.maddyhome.idea.vim.listener.AppCodeTemplates.appCodeTemplateCaptured import com.maddyhome.idea.vim.listener.AppCodeTemplates.appCodeTemplateCaptured
import com.maddyhome.idea.vim.newapi.IjVimEditor
import com.maddyhome.idea.vim.newapi.vim
import com.maddyhome.idea.vim.options.OptionChangeListener
import com.maddyhome.idea.vim.options.OptionConstants
import com.maddyhome.idea.vim.options.OptionScope
import com.maddyhome.idea.vim.vimscript.model.datatypes.VimDataType import com.maddyhome.idea.vim.vimscript.model.datatypes.VimDataType
import com.maddyhome.idea.vim.vimscript.model.datatypes.VimString import com.maddyhome.idea.vim.vimscript.model.datatypes.VimString
import com.maddyhome.idea.vim.vimscript.model.options.OptionChangeListener import com.maddyhome.idea.vim.vimscript.services.IjVimOptionService
import com.maddyhome.idea.vim.vimscript.services.OptionService
import java.awt.event.InputEvent import java.awt.event.InputEvent
import java.awt.event.KeyEvent import java.awt.event.KeyEvent
import javax.swing.KeyStroke import javax.swing.KeyStroke
@ -63,7 +67,7 @@ import javax.swing.KeyStroke
* These keys are not passed to [com.maddyhome.idea.vim.VimTypedActionHandler] and should be handled by actions. * These keys are not passed to [com.maddyhome.idea.vim.VimTypedActionHandler] and should be handled by actions.
*/ */
class VimShortcutKeyAction : AnAction(), DumbAware/*, LightEditCompatible*/ { class VimShortcutKeyAction : AnAction(), DumbAware/*, LightEditCompatible*/ {
private val traceTime = VimPlugin.getOptionService().isSet(OptionService.Scope.GLOBAL, "ideatracetime") private val traceTime = VimPlugin.getOptionService().isSet(OptionScope.GLOBAL, OptionConstants.ideatracetimeName)
override fun actionPerformed(e: AnActionEvent) { override fun actionPerformed(e: AnActionEvent) {
LOG.trace("Executing shortcut key action") LOG.trace("Executing shortcut key action")
@ -77,7 +81,7 @@ class VimShortcutKeyAction : AnAction(), DumbAware/*, LightEditCompatible*/ {
// Should we use HelperKt.getTopLevelEditor(editor) here, as we did in former EditorKeyHandler? // Should we use HelperKt.getTopLevelEditor(editor) here, as we did in former EditorKeyHandler?
try { try {
val start = if (traceTime) System.currentTimeMillis() else null val start = if (traceTime) System.currentTimeMillis() else null
KeyHandler.getInstance().handleKey(editor, keyStroke, EditorDataContext.init(editor, e.dataContext)) KeyHandler.getInstance().handleKey(editor.vim, keyStroke, EditorDataContext.init(editor, e.dataContext).vim)
if (start != null) { if (start != null) {
val duration = System.currentTimeMillis() - start val duration = System.currentTimeMillis() - start
LOG.info("VimShortcut update '$keyStroke': $duration ms") LOG.info("VimShortcut update '$keyStroke': $duration ms")
@ -121,8 +125,8 @@ class VimShortcutKeyAction : AnAction(), DumbAware/*, LightEditCompatible*/ {
val keyCode = keyStroke.keyCode val keyCode = keyStroke.keyCode
if (HandlerInjector.notebookCommandMode()) { if (HandlerInjector.notebookCommandMode(editor)) {
LOG.trace("Python Notebook command mode") LOG.debug("Python Notebook command mode")
if (keyCode == KeyEvent.VK_RIGHT || keyCode == KeyEvent.VK_KP_RIGHT || keyCode == KeyEvent.VK_ENTER) { if (keyCode == KeyEvent.VK_RIGHT || keyCode == KeyEvent.VK_KP_RIGHT || keyCode == KeyEvent.VK_ENTER) {
invokeLater { editor.updateCaretsVisualAttributes() } invokeLater { editor.updateCaretsVisualAttributes() }
} }
@ -170,19 +174,7 @@ class VimShortcutKeyAction : AnAction(), DumbAware/*, LightEditCompatible*/ {
val savedShortcutConflicts = VimPlugin.getKey().savedShortcutConflicts val savedShortcutConflicts = VimPlugin.getKey().savedShortcutConflicts
val info = savedShortcutConflicts[keyStroke] val info = savedShortcutConflicts[keyStroke]
if (info is ShortcutOwner) { return when (info?.forEditor(editor.vim)) {
return when (info) {
ShortcutOwner.VIM -> true
ShortcutOwner.IDE -> !isShortcutConflict(keyStroke)
else -> {
if (isShortcutConflict(keyStroke)) {
savedShortcutConflicts[keyStroke] = ShortcutOwnerInfo.allUndefined
}
true
}
}
}
return when ((info as? ShortcutOwnerInfo)?.forEditor(editor)) {
ShortcutOwner.VIM -> true ShortcutOwner.VIM -> true
ShortcutOwner.IDE -> !isShortcutConflict(keyStroke) ShortcutOwner.IDE -> !isShortcutConflict(keyStroke)
else -> { else -> {
@ -197,10 +189,10 @@ class VimShortcutKeyAction : AnAction(), DumbAware/*, LightEditCompatible*/ {
} }
private fun isEnabledForEscape(editor: Editor): Boolean { private fun isEnabledForEscape(editor: Editor): Boolean {
val ideaVimSupportValue = (VimPlugin.getOptionService().getOptionValue(OptionService.Scope.LOCAL(editor), "ideavimsupport") as VimString).value val ideaVimSupportValue = (VimPlugin.getOptionService().getOptionValue(OptionScope.LOCAL(IjVimEditor(editor)), IjVimOptionService.ideavimsupportName) as VimString).value
return editor.isPrimaryEditor() || return editor.isPrimaryEditor() ||
EditorHelper.isFileEditor(editor) && !editor.inNormalMode || EditorHelper.isFileEditor(editor) && !editor.inNormalMode ||
ideaVimSupportValue.contains("dialog") && !editor.inNormalMode ideaVimSupportValue.contains(IjVimOptionService.ideavimsupport_dialog) && !editor.inNormalMode
} }
private fun isShortcutConflict(keyStroke: KeyStroke): Boolean { private fun isShortcutConflict(keyStroke: KeyStroke): Boolean {
@ -246,7 +238,7 @@ class VimShortcutKeyAction : AnAction(), DumbAware/*, LightEditCompatible*/ {
init { init {
VimPlugin.getOptionService().addListener( VimPlugin.getOptionService().addListener(
"lookupkeys", OptionConstants.lookupkeysName,
object : OptionChangeListener<VimDataType> { object : OptionChangeListener<VimDataType> {
override fun processGlobalValueChange(oldValue: VimDataType?) { override fun processGlobalValueChange(oldValue: VimDataType?) {
parsedLookupKeys = parseLookupKeys() parsedLookupKeys = parseLookupKeys()
@ -257,9 +249,9 @@ class VimShortcutKeyAction : AnAction(), DumbAware/*, LightEditCompatible*/ {
fun isEnabledForLookup(keyStroke: KeyStroke): Boolean = keyStroke !in parsedLookupKeys fun isEnabledForLookup(keyStroke: KeyStroke): Boolean = keyStroke !in parsedLookupKeys
private fun parseLookupKeys() = (VimPlugin.getOptionService().getOptionValue(OptionService.Scope.GLOBAL, "lookupkeys") as VimString).value private fun parseLookupKeys() = (VimPlugin.getOptionService().getOptionValue(OptionScope.GLOBAL, OptionConstants.lookupkeysName) as VimString).value
.split(",") .split(",")
.map { StringHelper.parseKeys(it) } .map { injector.parser.parseKeys(it) }
.filter { it.isNotEmpty() } .filter { it.isNotEmpty() }
.map { it.first() } .map { it.first() }
.toSet() .toSet()

View File

@ -1,6 +1,6 @@
/* /*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors * Copyright (C) 2003-2022 The IdeaVim authors
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -17,57 +17,108 @@
*/ */
package com.maddyhome.idea.vim.action.change package com.maddyhome.idea.vim.action.change
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.KeyHandler import com.maddyhome.idea.vim.KeyHandler
import com.maddyhome.idea.vim.VimPlugin import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.api.ExecutionContext
import com.maddyhome.idea.vim.api.VimCaret
import com.maddyhome.idea.vim.api.VimEditor
import com.maddyhome.idea.vim.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.OperatorArguments import com.maddyhome.idea.vim.command.OperatorArguments
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.argumentCaptured
import com.maddyhome.idea.vim.group.MotionGroup import com.maddyhome.idea.vim.group.MotionGroup
import com.maddyhome.idea.vim.group.visual.VimSelection
import com.maddyhome.idea.vim.handler.VimActionHandler import com.maddyhome.idea.vim.handler.VimActionHandler
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler
import com.maddyhome.idea.vim.helper.MessageHelper import com.maddyhome.idea.vim.helper.MessageHelper
import com.maddyhome.idea.vim.helper.commandState import com.maddyhome.idea.vim.helper.commandState
import com.maddyhome.idea.vim.helper.enumSetOf
import com.maddyhome.idea.vim.newapi.ij
import java.util.*
private fun doOperatorAction(editor: VimEditor, context: ExecutionContext, textRange: TextRange, selectionType: SelectionType): Boolean {
val operatorFunction = VimPlugin.getKey().operatorFunction
if (operatorFunction == null) {
VimPlugin.showMessage(MessageHelper.message("E774"))
return false
}
val saveRepeatHandler = VimRepeater.repeatHandler
VimPlugin.getMark().setChangeMarks(editor, textRange)
KeyHandler.getInstance().reset(editor)
val result = operatorFunction.apply(editor.ij, context.ij, selectionType)
VimRepeater.repeatHandler = saveRepeatHandler
return result
}
/**
* @author vlan
*/
class OperatorAction : VimActionHandler.SingleExecution() { class OperatorAction : VimActionHandler.SingleExecution() {
override val type: Command.Type = Command.Type.OTHER_SELF_SYNCHRONIZED override val type: Command.Type = Command.Type.OTHER_SELF_SYNCHRONIZED
override val argumentType: Argument.Type = Argument.Type.MOTION override val argumentType: Argument.Type = Argument.Type.MOTION
override fun execute(editor: Editor, context: DataContext, cmd: Command, operatorArguments: OperatorArguments): Boolean { override fun execute(editor: VimEditor, context: ExecutionContext, cmd: Command, operatorArguments: OperatorArguments): Boolean {
val operatorFunction = VimPlugin.getKey().operatorFunction val argument = cmd.argument ?: return false
if (operatorFunction != null) { if (!editor.commandState.isDotRepeatInProgress) {
val argument = cmd.argument argumentCaptured = argument
if (argument != null) { }
if (!editor.commandState.isDotRepeatInProgress) { val range = getMotionRange(editor, context, argument, operatorArguments)
VimRepeater.Extension.argumentCaptured = argument
} if (range != null) {
val saveRepeatHandler = VimRepeater.repeatHandler val selectionType = if (argument.motion.isLinewiseMotion()) {
val motion = argument.motion SelectionType.LINE_WISE
val range = MotionGroup } else {
.getMotionRange( SelectionType.CHARACTER_WISE
editor, }
editor.caretModel.primaryCaret, return doOperatorAction(editor, context, range, selectionType)
context,
argument,
operatorArguments
)
if (range != null) {
VimPlugin.getMark().setChangeMarks(editor, range)
val selectionType = if (motion.isLinewiseMotion()) SelectionType.LINE_WISE else SelectionType.CHARACTER_WISE
KeyHandler.getInstance().reset(editor)
val result = operatorFunction.apply(editor, context, selectionType)
VimRepeater.repeatHandler = saveRepeatHandler
return result
}
}
return false
} }
VimPlugin.showMessage(MessageHelper.message("E774"))
return false return false
} }
private fun getMotionRange(
editor: VimEditor,
context: ExecutionContext,
argument: Argument,
operatorArguments: OperatorArguments
): TextRange? {
// Note that we're using getMotionRange2 in order to avoid normalising the linewise range into line start
// offsets that will be used to set the change marks. This affects things like the location of the caret in the
// Commentary extension
val ijEditor = editor.ij
return MotionGroup.getMotionRange2(
ijEditor,
ijEditor.caretModel.primaryCaret,
context.ij,
argument,
operatorArguments
)?.normalize()?.let {
// If we're linewise, make sure the end offset isn't just the EOL char
if (argument.motion.isLinewiseMotion() && it.endOffset < editor.fileSize()) {
TextRange(it.startOffset, it.endOffset + 1)
} else {
it
}
}
}
}
class VisualOperatorAction : VisualOperatorActionHandler.ForEachCaret() {
override val type: Command.Type = Command.Type.OTHER_SELF_SYNCHRONIZED
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_EXIT_VISUAL)
override fun executeAction(
editor: VimEditor,
caret: VimCaret,
context: ExecutionContext,
cmd: Command,
range: VimSelection,
operatorArguments: OperatorArguments,
): Boolean {
return doOperatorAction(editor, context, range.toVimTextRange(), range.type)
}
} }

View File

@ -1,6 +1,6 @@
/* /*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors * Copyright (C) 2003-2022 The IdeaVim authors
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -17,44 +17,49 @@
*/ */
package com.maddyhome.idea.vim.action.change package com.maddyhome.idea.vim.action.change
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.command.CommandProcessor import com.intellij.openapi.command.CommandProcessor
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.KeyHandler
import com.maddyhome.idea.vim.VimPlugin import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument import com.maddyhome.idea.vim.api.ExecutionContext
import com.maddyhome.idea.vim.api.VimEditor
import com.maddyhome.idea.vim.api.injector
import com.maddyhome.idea.vim.command.Command import com.maddyhome.idea.vim.command.Command
import com.maddyhome.idea.vim.command.OperatorArguments import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.extension.VimExtensionHandler
import com.maddyhome.idea.vim.handler.VimActionHandler import com.maddyhome.idea.vim.handler.VimActionHandler
import com.maddyhome.idea.vim.helper.commandState import com.maddyhome.idea.vim.helper.commandState
import javax.swing.KeyStroke import com.maddyhome.idea.vim.newapi.ij
class RepeatChangeAction : VimActionHandler.SingleExecution() { class RepeatChangeAction : VimActionHandler.SingleExecution() {
override val type: Command.Type = Command.Type.OTHER_WRITABLE override val type: Command.Type = Command.Type.OTHER_WRITABLE
override fun execute(editor: Editor, context: DataContext, cmd: Command, operatorArguments: OperatorArguments): Boolean { override fun execute(editor: VimEditor, context: ExecutionContext, cmd: Command, operatorArguments: OperatorArguments): Boolean {
val state = editor.commandState val state = editor.commandState
val lastCommand = VimRepeater.lastChangeCommand val lastCommand = VimRepeater.lastChangeCommand
if (lastCommand == null && VimRepeater.Extension.lastExtensionHandler == null) return false if (lastCommand == null && Extension.lastExtensionHandler == null) return false
// Save state // Save state
val save = state.executingCommand val save = state.executingCommand
val lastFTCmd = VimPlugin.getMotion().lastFTCmd val lastFTCmd = injector.motion.lastFTCmd
val lastFTChar = VimPlugin.getMotion().lastFTChar val lastFTChar = injector.motion.lastFTChar
val reg = VimPlugin.getRegister().currentRegister val reg = injector.registerGroup.currentRegister
val lastHandler = VimRepeater.Extension.lastExtensionHandler val lastHandler = Extension.lastExtensionHandler
val repeatHandler = VimRepeater.repeatHandler val repeatHandler = VimRepeater.repeatHandler
state.isDotRepeatInProgress = true state.isDotRepeatInProgress = true
VimPlugin.getRegister().selectRegister(VimRepeater.lastChangeRegister)
// A fancy 'redo-register' feature
// VIM-2643, :h redo-register
if (VimRepeater.lastChangeRegister in '1'..'8') {
VimRepeater.lastChangeRegister = VimRepeater.lastChangeRegister.inc()
}
injector.registerGroup.selectRegister(VimRepeater.lastChangeRegister)
try { try {
if (repeatHandler && lastHandler != null) { if (repeatHandler && lastHandler != null) {
val processor = CommandProcessor.getInstance() val processor = CommandProcessor.getInstance()
processor.executeCommand( processor.executeCommand(
editor.project, editor.ij.project,
{ lastHandler.execute(editor, context) }, { lastHandler.execute(editor, context) },
"Vim " + lastHandler.javaClass.simpleName, "Vim " + lastHandler.javaClass.simpleName,
null null
@ -71,7 +76,7 @@ class RepeatChangeAction : VimActionHandler.SingleExecution() {
state.setExecutingCommand(lastCommand) state.setExecutingCommand(lastCommand)
val arguments = operatorArguments.copy(count0 = lastCommand.rawCount) val arguments = operatorArguments.copy(count0 = lastCommand.rawCount)
KeyHandler.executeVimAction(editor, lastCommand.action, context, arguments) injector.actionExecutor.executeVimAction(editor, lastCommand.action, context, arguments)
VimRepeater.saveLastChange(lastCommand) VimRepeater.saveLastChange(lastCommand)
} }
@ -83,66 +88,10 @@ class RepeatChangeAction : VimActionHandler.SingleExecution() {
// Restore state // Restore state
if (save != null) state.setExecutingCommand(save) if (save != null) state.setExecutingCommand(save)
VimPlugin.getMotion().setLastFTCmd(lastFTCmd, lastFTChar) VimPlugin.getMotion().setLastFTCmd(lastFTCmd, lastFTChar)
if (lastHandler != null) VimRepeater.Extension.lastExtensionHandler = lastHandler if (lastHandler != null) Extension.lastExtensionHandler = lastHandler
VimRepeater.repeatHandler = repeatHandler VimRepeater.repeatHandler = repeatHandler
VimRepeater.Extension.reset() Extension.reset()
VimPlugin.getRegister().selectRegister(reg) VimPlugin.getRegister().selectRegister(reg)
return true return true
} }
} }
object VimRepeater {
var repeatHandler = false
var lastChangeCommand: Command? = null
private set
var lastChangeRegister = VimPlugin.getRegister().defaultRegister
private set
fun saveLastChange(command: Command) {
lastChangeCommand = command
lastChangeRegister = VimPlugin.getRegister().currentRegister
}
object Extension {
var lastExtensionHandler: VimExtensionHandler? = null
var argumentCaptured: Argument? = null
private val keyStrokes = mutableListOf<KeyStroke>()
private val strings = mutableListOf<String>()
private var keystrokePointer = 0
private var stringPointer = 0
fun addKeystroke(key: KeyStroke) = keyStrokes.add(key)
fun addString(key: String) = strings.add(key)
fun consumeKeystroke(): KeyStroke? {
if (keystrokePointer in keyStrokes.indices) {
keystrokePointer += 1
return keyStrokes[keystrokePointer - 1]
}
return null
}
fun consumeString(): String? {
if (stringPointer in strings.indices) {
stringPointer += 1
return strings[stringPointer - 1]
}
return null
}
fun reset() {
keystrokePointer = 0
stringPointer = 0
}
fun clean() {
keyStrokes.clear()
strings.clear()
keystrokePointer = 0
stringPointer = 0
}
}
}

View File

@ -1,48 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.change
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.Command
import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
import com.maddyhome.idea.vim.helper.enumSetOf
import java.util.*
class ChangeCharacterAction : ChangeEditorActionHandler.ForEachCaret() {
override val type: Command.Type = Command.Type.CHANGE
override val argumentType: Argument.Type = Argument.Type.DIGRAPH
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_ALLOW_DIGRAPH)
override fun execute(
editor: Editor,
caret: Caret,
context: DataContext,
argument: Argument?,
operatorArguments: OperatorArguments,
): Boolean {
return argument != null && VimPlugin.getChange().changeCharacter(editor, caret, operatorArguments.count1, argument.character)
}
}

View File

@ -1,6 +1,6 @@
/* /*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors * Copyright (C) 2003-2022 The IdeaVim authors
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -17,38 +17,38 @@
*/ */
package com.maddyhome.idea.vim.action.change.delete package com.maddyhome.idea.vim.action.change.delete
import com.intellij.openapi.actionSystem.DataContext import com.maddyhome.idea.vim.api.ExecutionContext
import com.intellij.openapi.editor.Caret import com.maddyhome.idea.vim.api.VimCaret
import com.intellij.openapi.editor.Editor import com.maddyhome.idea.vim.api.VimEditor
import com.intellij.openapi.util.Ref import com.maddyhome.idea.vim.api.injector
import com.maddyhome.idea.vim.VimPlugin
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.OperatorArguments import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
import com.maddyhome.idea.vim.vimscript.services.OptionService import com.maddyhome.idea.vim.options.OptionScope
import com.maddyhome.idea.vim.vimscript.services.IjVimOptionService
class DeleteJoinLinesAction : ChangeEditorActionHandler.SingleExecution() { class DeleteJoinLinesAction : ChangeEditorActionHandler.SingleExecution() {
override val type: Command.Type = Command.Type.DELETE override val type: Command.Type = Command.Type.DELETE
override fun execute( override fun execute(
editor: Editor, editor: VimEditor,
context: DataContext, context: ExecutionContext,
argument: Argument?, argument: Argument?,
operatorArguments: OperatorArguments, operatorArguments: OperatorArguments,
): Boolean { ): Boolean {
if (editor.isOneLineMode) return false if (editor.isOneLineMode()) return false
if (VimPlugin.getOptionService().isSet(OptionService.Scope.LOCAL(editor), "ideajoin")) { if (injector.optionService.isSet(OptionScope.LOCAL(editor), IjVimOptionService.ideajoinName)) {
return VimPlugin.getChange().joinViaIdeaByCount(editor, context, operatorArguments.count1) return injector.changeGroup.joinViaIdeaByCount(editor, context, operatorArguments.count1)
} }
VimPlugin.getEditor().notifyIdeaJoin(editor.project) injector.editorGroup.notifyIdeaJoin(editor)
val res = Ref.create(true) val res = arrayOf(true)
editor.caretModel.runForEachCaret( editor.forEachNativeCaret(
{ caret: Caret -> { caret: VimCaret ->
if (!VimPlugin.getChange().deleteJoinLines(editor, caret, operatorArguments.count1, false)) res.set(false) if (!injector.changeGroup.deleteJoinLines(editor, caret, operatorArguments.count1, false)) res[0] = false
}, },
true true
) )
return res.get() return res[0]
} }
} }

View File

@ -1,6 +1,6 @@
/* /*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors * Copyright (C) 2003-2022 The IdeaVim authors
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -17,38 +17,38 @@
*/ */
package com.maddyhome.idea.vim.action.change.delete package com.maddyhome.idea.vim.action.change.delete
import com.intellij.openapi.actionSystem.DataContext import com.maddyhome.idea.vim.api.ExecutionContext
import com.intellij.openapi.editor.Caret import com.maddyhome.idea.vim.api.VimCaret
import com.intellij.openapi.editor.Editor import com.maddyhome.idea.vim.api.VimEditor
import com.intellij.openapi.util.Ref import com.maddyhome.idea.vim.api.injector
import com.maddyhome.idea.vim.VimPlugin
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.OperatorArguments import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
import com.maddyhome.idea.vim.vimscript.services.OptionService import com.maddyhome.idea.vim.options.OptionScope
import com.maddyhome.idea.vim.vimscript.services.IjVimOptionService
class DeleteJoinLinesSpacesAction : ChangeEditorActionHandler.SingleExecution() { class DeleteJoinLinesSpacesAction : ChangeEditorActionHandler.SingleExecution() {
override val type: Command.Type = Command.Type.DELETE override val type: Command.Type = Command.Type.DELETE
override fun execute( override fun execute(
editor: Editor, editor: VimEditor,
context: DataContext, context: ExecutionContext,
argument: Argument?, argument: Argument?,
operatorArguments: OperatorArguments, operatorArguments: OperatorArguments,
): Boolean { ): Boolean {
if (editor.isOneLineMode) return false if (editor.isOneLineMode()) return false
if (VimPlugin.getOptionService().isSet(OptionService.Scope.LOCAL(editor), "ideajoin")) { if (injector.optionService.isSet(OptionScope.LOCAL(editor), IjVimOptionService.ideajoinName)) {
return VimPlugin.getChange().joinViaIdeaByCount(editor, context, operatorArguments.count1) return injector.changeGroup.joinViaIdeaByCount(editor, context, operatorArguments.count1)
} }
VimPlugin.getEditor().notifyIdeaJoin(editor.project) injector.editorGroup.notifyIdeaJoin(editor)
val res = Ref.create(true) val res = arrayOf(true)
editor.caretModel.runForEachCaret( editor.forEachNativeCaret(
{ caret: Caret -> { caret: VimCaret ->
if (!VimPlugin.getChange().deleteJoinLines(editor, caret, operatorArguments.count1, true)) res.set(false) if (!injector.changeGroup.deleteJoinLines(editor, caret, operatorArguments.count1, true)) res[0] = false
}, },
true true
) )
return res.get() return res[0]
} }
} }

View File

@ -1,6 +1,6 @@
/* /*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors * Copyright (C) 2003-2022 The IdeaVim authors
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -17,18 +17,18 @@
*/ */
package com.maddyhome.idea.vim.action.change.delete package com.maddyhome.idea.vim.action.change.delete
import com.intellij.openapi.actionSystem.DataContext import com.maddyhome.idea.vim.api.ExecutionContext
import com.intellij.openapi.editor.Caret import com.maddyhome.idea.vim.api.VimCaret
import com.intellij.openapi.editor.Editor import com.maddyhome.idea.vim.api.VimEditor
import com.intellij.openapi.util.Ref import com.maddyhome.idea.vim.api.injector
import com.maddyhome.idea.vim.VimPlugin
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.OperatorArguments import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.group.visual.VimSelection import com.maddyhome.idea.vim.group.visual.VimSelection
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler
import com.maddyhome.idea.vim.helper.enumSetOf import com.maddyhome.idea.vim.helper.enumSetOf
import com.maddyhome.idea.vim.vimscript.services.OptionService import com.maddyhome.idea.vim.options.OptionScope
import com.maddyhome.idea.vim.vimscript.services.IjVimOptionService
import java.util.* import java.util.*
/** /**
@ -40,28 +40,28 @@ class DeleteJoinVisualLinesAction : VisualOperatorActionHandler.SingleExecution(
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_EXIT_VISUAL) override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_EXIT_VISUAL)
override fun executeForAllCarets( override fun executeForAllCarets(
editor: Editor, editor: VimEditor,
context: DataContext, context: ExecutionContext,
cmd: Command, cmd: Command,
caretsAndSelections: Map<Caret, VimSelection>, caretsAndSelections: Map<VimCaret, VimSelection>,
operatorArguments: OperatorArguments, operatorArguments: OperatorArguments,
): Boolean { ): Boolean {
if (editor.isOneLineMode) return false if (editor.isOneLineMode()) return false
if (VimPlugin.getOptionService().isSet(OptionService.Scope.LOCAL(editor), "ideajoin")) { if (injector.optionService.isSet(OptionScope.LOCAL(editor), IjVimOptionService.ideajoinName)) {
VimPlugin.getChange().joinViaIdeaBySelections(editor, context, caretsAndSelections) injector.changeGroup.joinViaIdeaBySelections(editor, context, caretsAndSelections)
return true return true
} }
val res = Ref.create(true) val res = arrayOf(true)
editor.caretModel.runForEachCaret( editor.forEachNativeCaret(
{ caret: Caret -> {
if (!caret.isValid) return@runForEachCaret caret: VimCaret ->
val range = caretsAndSelections[caret] ?: return@runForEachCaret if (!caret.isValid) return@forEachNativeCaret
if (!VimPlugin.getChange().deleteJoinRange(editor, caret, range.toVimTextRange(true).normalize(), false)) { val range = caretsAndSelections[caret] ?: return@forEachNativeCaret
res.set(false) if (!injector.changeGroup.deleteJoinRange(editor, caret, range.toVimTextRange(true).normalize(), false)) {
res[0] = false
} }
}, }, true
true
) )
return res.get() return res[0]
} }
} }

View File

@ -1,6 +1,6 @@
/* /*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors * Copyright (C) 2003-2022 The IdeaVim authors
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -17,18 +17,18 @@
*/ */
package com.maddyhome.idea.vim.action.change.delete package com.maddyhome.idea.vim.action.change.delete
import com.intellij.openapi.actionSystem.DataContext import com.maddyhome.idea.vim.api.ExecutionContext
import com.intellij.openapi.editor.Caret import com.maddyhome.idea.vim.api.VimCaret
import com.intellij.openapi.editor.Editor import com.maddyhome.idea.vim.api.VimEditor
import com.intellij.openapi.util.Ref import com.maddyhome.idea.vim.api.injector
import com.maddyhome.idea.vim.VimPlugin
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.OperatorArguments import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.group.visual.VimSelection import com.maddyhome.idea.vim.group.visual.VimSelection
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler
import com.maddyhome.idea.vim.helper.enumSetOf import com.maddyhome.idea.vim.helper.enumSetOf
import com.maddyhome.idea.vim.vimscript.services.OptionService import com.maddyhome.idea.vim.options.OptionScope
import com.maddyhome.idea.vim.vimscript.services.IjVimOptionService
import java.util.* import java.util.*
/** /**
@ -40,28 +40,28 @@ class DeleteJoinVisualLinesSpacesAction : VisualOperatorActionHandler.SingleExec
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_EXIT_VISUAL) override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_EXIT_VISUAL)
override fun executeForAllCarets( override fun executeForAllCarets(
editor: Editor, editor: VimEditor,
context: DataContext, context: ExecutionContext,
cmd: Command, cmd: Command,
caretsAndSelections: Map<Caret, VimSelection>, caretsAndSelections: Map<VimCaret, VimSelection>,
operatorArguments: OperatorArguments, operatorArguments: OperatorArguments,
): Boolean { ): Boolean {
if (editor.isOneLineMode) return false if (editor.isOneLineMode()) return false
if (VimPlugin.getOptionService().isSet(OptionService.Scope.LOCAL(editor), "ideajoin")) { if (injector.optionService.isSet(OptionScope.LOCAL(editor), IjVimOptionService.ideajoinName)) {
VimPlugin.getChange().joinViaIdeaBySelections(editor, context, caretsAndSelections) injector.changeGroup.joinViaIdeaBySelections(editor, context, caretsAndSelections)
return true return true
} }
val res = Ref.create(true) val res = arrayOf(true)
editor.caretModel.runForEachCaret( editor.forEachNativeCaret(
{ caret: Caret -> { caret: VimCaret ->
if (!caret.isValid) return@runForEachCaret if (!caret.isValid) return@forEachNativeCaret
val range = caretsAndSelections[caret] ?: return@runForEachCaret val range = caretsAndSelections[caret] ?: return@forEachNativeCaret
if (!VimPlugin.getChange().deleteJoinRange(editor, caret, range.toVimTextRange(true).normalize(), true)) { if (!injector.changeGroup.deleteJoinRange(editor, caret, range.toVimTextRange(true).normalize(), true)) {
res.set(false) res[0] = false
} }
}, },
true true
) )
return res.get() return res[0]
} }
} }

View File

@ -1,43 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.insert
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.Command
import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
class InsertCharacterAboveCursorAction : ChangeEditorActionHandler.ForEachCaret() {
override val type: Command.Type = Command.Type.INSERT
override fun execute(
editor: Editor,
caret: Caret,
context: DataContext,
argument: Argument?,
operatorArguments: OperatorArguments,
): Boolean {
return if (editor.isOneLineMode) {
false
} else VimPlugin.getChange().insertCharacterAroundCursor(editor, caret, -1)
}
}

View File

@ -1,43 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.insert
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.Command
import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
class InsertCharacterBelowCursorAction : ChangeEditorActionHandler.ForEachCaret() {
override val type: Command.Type = Command.Type.INSERT
override fun execute(
editor: Editor,
caret: Caret,
context: DataContext,
argument: Argument?,
operatorArguments: OperatorArguments,
): Boolean {
return if (editor.isOneLineMode) {
false
} else VimPlugin.getChange().insertCharacterAroundCursor(editor, caret, 1)
}
}

View File

@ -1,46 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.insert
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.Command
import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
import com.maddyhome.idea.vim.helper.enumSetOf
import java.util.*
class InsertDeletePreviousWordAction : ChangeEditorActionHandler.ForEachCaret() {
override val type: Command.Type = Command.Type.INSERT
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_CLEAR_STROKES)
override fun execute(
editor: Editor,
caret: Caret,
context: DataContext,
argument: Argument?,
operatorArguments: OperatorArguments,
): Boolean {
return VimPlugin.getChange().insertDeletePreviousWord(editor, caret)
}
}

View File

@ -1,46 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.insert
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.Command
import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
import com.maddyhome.idea.vim.helper.enumSetOf
import java.util.*
class InsertNewLineAboveAction : ChangeEditorActionHandler.SingleExecution() {
override val type: Command.Type = Command.Type.INSERT
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_MULTIKEY_UNDO)
override fun execute(
editor: Editor,
context: DataContext,
argument: Argument?,
operatorArguments: OperatorArguments,
): Boolean {
if (editor.isOneLineMode) return false
VimPlugin.getChange().insertNewLineAbove(editor, context)
return true
}
}

View File

@ -1,46 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.insert
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.Command
import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
import com.maddyhome.idea.vim.helper.enumSetOf
import java.util.*
class InsertNewLineBelowAction : ChangeEditorActionHandler.SingleExecution() {
override val type: Command.Type = Command.Type.INSERT
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_MULTIKEY_UNDO)
override fun execute(
editor: Editor,
context: DataContext,
argument: Argument?,
operatorArguments: OperatorArguments,
): Boolean {
if (editor.isOneLineMode) return false
VimPlugin.getChange().insertNewLineBelow(editor, context)
return true
}
}

View File

@ -1,40 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.insert
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.Command
import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
class InsertPreviousInsertAction : ChangeEditorActionHandler.SingleExecution() {
override val type: Command.Type = Command.Type.INSERT
override fun execute(
editor: Editor,
context: DataContext,
argument: Argument?,
operatorArguments: OperatorArguments,
): Boolean {
VimPlugin.getChange().insertPreviousInsert(editor, context, false, operatorArguments)
return true
}
}

View File

@ -1,70 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.change.insert
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.components.ServiceManager
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.Command
import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.ex.ExException
import com.maddyhome.idea.vim.handler.VimActionHandler
import com.maddyhome.idea.vim.helper.CommandLineHelper
import com.maddyhome.idea.vim.vimscript.model.Script
import com.maddyhome.idea.vim.vimscript.parser.VimscriptParser
class InsertRegisterAction : VimActionHandler.SingleExecution() {
override val type: Command.Type = Command.Type.INSERT
override val argumentType: Argument.Type = Argument.Type.CHARACTER
override fun execute(editor: Editor, context: DataContext, cmd: Command, operatorArguments: OperatorArguments): Boolean {
val argument = cmd.argument
if (argument?.character == '=') {
ApplicationManager.getApplication().invokeLater {
try {
val expression = readExpression(editor)
if (expression != null) {
if (expression.isNotEmpty()) {
val expressionValue = VimscriptParser.parseExpression(expression)?.evaluate(editor, context, Script(listOf()))
?: throw ExException("E15: Invalid expression: $expression")
val textToStore = expressionValue.toInsertableString()
VimPlugin.getRegister().storeTextSpecial('=', textToStore)
}
VimPlugin.getChange().insertRegister(editor, context, argument.character)
}
} catch (e: ExException) {
VimPlugin.indicateError()
VimPlugin.showMessage(e.message)
}
}
return true
} else {
return argument != null && VimPlugin.getChange().insertRegister(editor, context, argument.character)
}
}
@SuppressWarnings("deprecation") // [VERSION UPDATE] 212+ getService
private fun readExpression(editor: Editor): String? {
return ServiceManager.getService(CommandLineHelper::class.java).inputString(editor, "=", null)
}
}

View File

@ -1,6 +1,6 @@
/* /*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors * Copyright (C) 2003-2022 The IdeaVim authors
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -18,11 +18,11 @@
package com.maddyhome.idea.vim.action.editor package com.maddyhome.idea.vim.action.editor
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.actionSystem.IdeActions import com.intellij.openapi.actionSystem.IdeActions
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.KeyHandler
import com.maddyhome.idea.vim.action.ComplicatedKeysAction import com.maddyhome.idea.vim.action.ComplicatedKeysAction
import com.maddyhome.idea.vim.api.ExecutionContext
import com.maddyhome.idea.vim.api.VimEditor
import com.maddyhome.idea.vim.api.injector
import com.maddyhome.idea.vim.command.Command import com.maddyhome.idea.vim.command.Command
import com.maddyhome.idea.vim.command.CommandFlags import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.OperatorArguments import com.maddyhome.idea.vim.command.OperatorArguments
@ -79,8 +79,8 @@ class VimEditorUp : IdeActionHandler(IdeActions.ACTION_EDITOR_MOVE_CARET_UP), Co
class VimQuickJavaDoc : VimActionHandler.SingleExecution() { class VimQuickJavaDoc : VimActionHandler.SingleExecution() {
override val type: Command.Type = Command.Type.OTHER_READONLY override val type: Command.Type = Command.Type.OTHER_READONLY
override fun execute(editor: Editor, context: DataContext, cmd: Command, operatorArguments: OperatorArguments): Boolean { override fun execute(editor: VimEditor, context: ExecutionContext, cmd: Command, operatorArguments: OperatorArguments): Boolean {
KeyHandler.executeAction(IdeActions.ACTION_QUICK_JAVADOC, context) injector.actionExecutor.executeAction(IdeActions.ACTION_QUICK_JAVADOC, context)
return true return true
} }
} }

View File

@ -1,6 +1,6 @@
/* /*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors * Copyright (C) 2003-2022 The IdeaVim authors
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -17,10 +17,10 @@
*/ */
package com.maddyhome.idea.vim.action.ex package com.maddyhome.idea.vim.action.ex
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.action.ComplicatedKeysAction import com.maddyhome.idea.vim.action.ComplicatedKeysAction
import com.maddyhome.idea.vim.api.ExecutionContext
import com.maddyhome.idea.vim.api.VimEditor
import com.maddyhome.idea.vim.command.Command import com.maddyhome.idea.vim.command.Command
import com.maddyhome.idea.vim.command.CommandFlags import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.OperatorArguments import com.maddyhome.idea.vim.command.OperatorArguments
@ -41,7 +41,7 @@ class ProcessExEntryAction : VimActionHandler.SingleExecution(), ComplicatedKeys
override val flags: EnumSet<CommandFlags> = EnumSet.of(CommandFlags.FLAG_COMPLETE_EX) override val flags: EnumSet<CommandFlags> = EnumSet.of(CommandFlags.FLAG_COMPLETE_EX)
override fun execute(editor: Editor, context: DataContext, cmd: Command, operatorArguments: OperatorArguments): Boolean { override fun execute(editor: VimEditor, context: ExecutionContext, cmd: Command, operatorArguments: OperatorArguments): Boolean {
return VimPlugin.getProcess().processExEntry(editor, context) return VimPlugin.getProcess().processExEntry(editor, context)
} }
} }

View File

@ -1,6 +1,6 @@
/* /*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors * Copyright (C) 2003-2022 The IdeaVim authors
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/* /*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors * Copyright (C) 2003-2022 The IdeaVim authors
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -1,46 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.gn
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.MotionType
import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.handler.Motion
import com.maddyhome.idea.vim.handler.MotionActionHandler
import com.maddyhome.idea.vim.handler.toMotionOrError
import com.maddyhome.idea.vim.helper.noneOfEnum
import java.util.*
class VisualSelectNextSearch : MotionActionHandler.SingleExecution() {
override val flags: EnumSet<CommandFlags> = noneOfEnum()
override fun getOffset(
editor: Editor,
context: DataContext,
argument: Argument?,
operatorArguments: OperatorArguments,
): Motion {
return VimPlugin.getMotion().selectNextSearch(editor, operatorArguments.count1, true).toMotionOrError()
}
override val motionType: MotionType = MotionType.EXCLUSIVE
}

View File

@ -1,43 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.leftright
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.MotionType
import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.handler.Motion
import com.maddyhome.idea.vim.handler.MotionActionHandler
class MotionLastMatchCharAction : MotionActionHandler.ForEachCaret() {
override fun getOffset(
editor: Editor,
caret: Caret,
context: DataContext,
argument: Argument?,
operatorArguments: OperatorArguments,
): Motion {
val repeatLastMatchChar = VimPlugin.getMotion().repeatLastMatchChar(editor, caret, operatorArguments.count1)
return if (repeatLastMatchChar < 0) Motion.Error else Motion.AbsoluteOffset(repeatLastMatchChar)
}
override val motionType: MotionType = MotionType.EXCLUSIVE
}

View File

@ -1,43 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.leftright
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.MotionType
import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.handler.Motion
import com.maddyhome.idea.vim.handler.MotionActionHandler
import com.maddyhome.idea.vim.handler.toMotionOrError
class MotionRightWrapAction : MotionActionHandler.ForEachCaret() {
override fun getOffset(
editor: Editor,
caret: Caret,
context: DataContext,
argument: Argument?,
operatorArguments: OperatorArguments,
): Motion {
return VimPlugin.getMotion().moveCaretHorizontalWrap(editor, caret, operatorArguments.count1).toMotionOrError()
}
override val motionType: MotionType = MotionType.EXCLUSIVE
}

View File

@ -1,44 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.`object`
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.TextObjectVisualType
import com.maddyhome.idea.vim.common.TextRange
import com.maddyhome.idea.vim.handler.TextObjectActionHandler
class MotionInnerBigWordAction : TextObjectActionHandler() {
override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE
override fun getRange(
editor: Editor,
caret: Caret,
context: DataContext,
count: Int,
rawCount: Int,
argument: Argument?,
): TextRange {
return VimPlugin.getMotion().getWordRange(editor, caret, count, false, true)
}
}

View File

@ -1,49 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.`object`
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.TextObjectVisualType
import com.maddyhome.idea.vim.common.TextRange
import com.maddyhome.idea.vim.handler.TextObjectActionHandler
import com.maddyhome.idea.vim.helper.enumSetOf
import java.util.*
class MotionInnerBlockAngleAction : TextObjectActionHandler() {
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_TEXT_BLOCK)
override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE
override fun getRange(
editor: Editor,
caret: Caret,
context: DataContext,
count: Int,
rawCount: Int,
argument: Argument?,
): TextRange? {
return VimPlugin.getMotion().getBlockRange(editor, caret, count, false, '<')
}
}

View File

@ -1,49 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.`object`
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.TextObjectVisualType
import com.maddyhome.idea.vim.common.TextRange
import com.maddyhome.idea.vim.handler.TextObjectActionHandler
import com.maddyhome.idea.vim.helper.enumSetOf
import java.util.*
class MotionInnerBlockBackQuoteAction : TextObjectActionHandler() {
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_TEXT_BLOCK)
override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE
override fun getRange(
editor: Editor,
caret: Caret,
context: DataContext,
count: Int,
rawCount: Int,
argument: Argument?,
): TextRange? {
return VimPlugin.getMotion().getBlockQuoteRange(editor, caret, '`', false)
}
}

View File

@ -1,49 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.`object`
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.TextObjectVisualType
import com.maddyhome.idea.vim.common.TextRange
import com.maddyhome.idea.vim.handler.TextObjectActionHandler
import com.maddyhome.idea.vim.helper.enumSetOf
import java.util.*
class MotionInnerBlockBraceAction : TextObjectActionHandler() {
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_TEXT_BLOCK)
override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE
override fun getRange(
editor: Editor,
caret: Caret,
context: DataContext,
count: Int,
rawCount: Int,
argument: Argument?,
): TextRange? {
return VimPlugin.getMotion().getBlockRange(editor, caret, count, false, '{')
}
}

View File

@ -1,49 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.`object`
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.TextObjectVisualType
import com.maddyhome.idea.vim.common.TextRange
import com.maddyhome.idea.vim.handler.TextObjectActionHandler
import com.maddyhome.idea.vim.helper.enumSetOf
import java.util.*
class MotionInnerBlockBracketAction : TextObjectActionHandler() {
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_TEXT_BLOCK)
override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE
override fun getRange(
editor: Editor,
caret: Caret,
context: DataContext,
count: Int,
rawCount: Int,
argument: Argument?,
): TextRange? {
return VimPlugin.getMotion().getBlockRange(editor, caret, count, false, '[')
}
}

View File

@ -1,49 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.`object`
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.TextObjectVisualType
import com.maddyhome.idea.vim.common.TextRange
import com.maddyhome.idea.vim.handler.TextObjectActionHandler
import com.maddyhome.idea.vim.helper.enumSetOf
import java.util.*
class MotionInnerBlockDoubleQuoteAction : TextObjectActionHandler() {
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_TEXT_BLOCK)
override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE
override fun getRange(
editor: Editor,
caret: Caret,
context: DataContext,
count: Int,
rawCount: Int,
argument: Argument?,
): TextRange? {
return VimPlugin.getMotion().getBlockQuoteRange(editor, caret, '"', false)
}
}

View File

@ -1,49 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.`object`
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.TextObjectVisualType
import com.maddyhome.idea.vim.common.TextRange
import com.maddyhome.idea.vim.handler.TextObjectActionHandler
import com.maddyhome.idea.vim.helper.enumSetOf
import java.util.*
class MotionInnerBlockParenAction : TextObjectActionHandler() {
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_TEXT_BLOCK)
override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE
override fun getRange(
editor: Editor,
caret: Caret,
context: DataContext,
count: Int,
rawCount: Int,
argument: Argument?,
): TextRange? {
return VimPlugin.getMotion().getBlockRange(editor, caret, count, false, '(')
}
}

View File

@ -1,49 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.`object`
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.TextObjectVisualType
import com.maddyhome.idea.vim.common.TextRange
import com.maddyhome.idea.vim.handler.TextObjectActionHandler
import com.maddyhome.idea.vim.helper.enumSetOf
import java.util.*
class MotionInnerBlockSingleQuoteAction : TextObjectActionHandler() {
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_TEXT_BLOCK)
override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE
override fun getRange(
editor: Editor,
caret: Caret,
context: DataContext,
count: Int,
rawCount: Int,
argument: Argument?,
): TextRange? {
return VimPlugin.getMotion().getBlockQuoteRange(editor, caret, '\'', false)
}
}

View File

@ -1,44 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.`object`
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.TextObjectVisualType
import com.maddyhome.idea.vim.common.TextRange
import com.maddyhome.idea.vim.handler.TextObjectActionHandler
class MotionInnerWordAction : TextObjectActionHandler() {
override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE
override fun getRange(
editor: Editor,
caret: Caret,
context: DataContext,
count: Int,
rawCount: Int,
argument: Argument?,
): TextRange {
return VimPlugin.getMotion().getWordRange(editor, caret, count, false, false)
}
}

View File

@ -1,44 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.`object`
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.TextObjectVisualType
import com.maddyhome.idea.vim.common.TextRange
import com.maddyhome.idea.vim.handler.TextObjectActionHandler
class MotionOuterBigWordAction : TextObjectActionHandler() {
override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE
override fun getRange(
editor: Editor,
caret: Caret,
context: DataContext,
count: Int,
rawCount: Int,
argument: Argument?,
): TextRange {
return VimPlugin.getMotion().getWordRange(editor, caret, count, true, true)
}
}

View File

@ -1,49 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.`object`
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.TextObjectVisualType
import com.maddyhome.idea.vim.common.TextRange
import com.maddyhome.idea.vim.handler.TextObjectActionHandler
import com.maddyhome.idea.vim.helper.enumSetOf
import java.util.*
class MotionOuterBlockAngleAction : TextObjectActionHandler() {
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_TEXT_BLOCK)
override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE
override fun getRange(
editor: Editor,
caret: Caret,
context: DataContext,
count: Int,
rawCount: Int,
argument: Argument?,
): TextRange? {
return VimPlugin.getMotion().getBlockRange(editor, caret, count, true, '<')
}
}

View File

@ -1,49 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.`object`
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.TextObjectVisualType
import com.maddyhome.idea.vim.common.TextRange
import com.maddyhome.idea.vim.handler.TextObjectActionHandler
import com.maddyhome.idea.vim.helper.enumSetOf
import java.util.*
class MotionOuterBlockBackQuoteAction : TextObjectActionHandler() {
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_TEXT_BLOCK)
override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE
override fun getRange(
editor: Editor,
caret: Caret,
context: DataContext,
count: Int,
rawCount: Int,
argument: Argument?,
): TextRange? {
return VimPlugin.getMotion().getBlockQuoteRange(editor, caret, '`', true)
}
}

View File

@ -1,49 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.`object`
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.TextObjectVisualType
import com.maddyhome.idea.vim.common.TextRange
import com.maddyhome.idea.vim.handler.TextObjectActionHandler
import com.maddyhome.idea.vim.helper.enumSetOf
import java.util.*
class MotionOuterBlockBraceAction : TextObjectActionHandler() {
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_TEXT_BLOCK)
override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE
override fun getRange(
editor: Editor,
caret: Caret,
context: DataContext,
count: Int,
rawCount: Int,
argument: Argument?,
): TextRange? {
return VimPlugin.getMotion().getBlockRange(editor, caret, count, true, '{')
}
}

View File

@ -1,49 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.`object`
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.TextObjectVisualType
import com.maddyhome.idea.vim.common.TextRange
import com.maddyhome.idea.vim.handler.TextObjectActionHandler
import com.maddyhome.idea.vim.helper.enumSetOf
import java.util.*
class MotionOuterBlockBracketAction : TextObjectActionHandler() {
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_TEXT_BLOCK)
override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE
override fun getRange(
editor: Editor,
caret: Caret,
context: DataContext,
count: Int,
rawCount: Int,
argument: Argument?,
): TextRange? {
return VimPlugin.getMotion().getBlockRange(editor, caret, count, true, '[')
}
}

View File

@ -1,49 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.`object`
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.TextObjectVisualType
import com.maddyhome.idea.vim.common.TextRange
import com.maddyhome.idea.vim.handler.TextObjectActionHandler
import com.maddyhome.idea.vim.helper.enumSetOf
import java.util.*
class MotionOuterBlockDoubleQuoteAction : TextObjectActionHandler() {
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_TEXT_BLOCK)
override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE
override fun getRange(
editor: Editor,
caret: Caret,
context: DataContext,
count: Int,
rawCount: Int,
argument: Argument?,
): TextRange? {
return VimPlugin.getMotion().getBlockQuoteRange(editor, caret, '"', true)
}
}

View File

@ -1,49 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.`object`
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.TextObjectVisualType
import com.maddyhome.idea.vim.common.TextRange
import com.maddyhome.idea.vim.handler.TextObjectActionHandler
import com.maddyhome.idea.vim.helper.enumSetOf
import java.util.*
class MotionOuterBlockParenAction : TextObjectActionHandler() {
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_TEXT_BLOCK)
override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE
override fun getRange(
editor: Editor,
caret: Caret,
context: DataContext,
count: Int,
rawCount: Int,
argument: Argument?,
): TextRange? {
return VimPlugin.getMotion().getBlockRange(editor, caret, count, true, '(')
}
}

View File

@ -1,49 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.`object`
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.TextObjectVisualType
import com.maddyhome.idea.vim.common.TextRange
import com.maddyhome.idea.vim.handler.TextObjectActionHandler
import com.maddyhome.idea.vim.helper.enumSetOf
import java.util.*
class MotionOuterBlockSingleQuoteAction : TextObjectActionHandler() {
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_TEXT_BLOCK)
override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE
override fun getRange(
editor: Editor,
caret: Caret,
context: DataContext,
count: Int,
rawCount: Int,
argument: Argument?,
): TextRange? {
return VimPlugin.getMotion().getBlockQuoteRange(editor, caret, '\'', true)
}
}

View File

@ -1,49 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.`object`
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.TextObjectVisualType
import com.maddyhome.idea.vim.common.TextRange
import com.maddyhome.idea.vim.handler.TextObjectActionHandler
import com.maddyhome.idea.vim.helper.enumSetOf
import java.util.*
class MotionOuterBlockTagAction : TextObjectActionHandler() {
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_TEXT_BLOCK)
override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE
override fun getRange(
editor: Editor,
caret: Caret,
context: DataContext,
count: Int,
rawCount: Int,
argument: Argument?,
): TextRange? {
return VimPlugin.getMotion().getBlockTagRange(editor, caret, count, true)
}
}

View File

@ -1,49 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.`object`
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.TextObjectVisualType
import com.maddyhome.idea.vim.common.TextRange
import com.maddyhome.idea.vim.handler.TextObjectActionHandler
import com.maddyhome.idea.vim.helper.enumSetOf
import java.util.*
class MotionOuterParagraphAction : TextObjectActionHandler() {
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_TEXT_BLOCK)
override val visualType: TextObjectVisualType = TextObjectVisualType.LINE_WISE
override fun getRange(
editor: Editor,
caret: Caret,
context: DataContext,
count: Int,
rawCount: Int,
argument: Argument?,
): TextRange? {
return VimPlugin.getMotion().getParagraphRange(editor, caret, count, true)
}
}

View File

@ -1,49 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.`object`
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.TextObjectVisualType
import com.maddyhome.idea.vim.common.TextRange
import com.maddyhome.idea.vim.handler.TextObjectActionHandler
import com.maddyhome.idea.vim.helper.enumSetOf
import java.util.*
class MotionOuterSentenceAction : TextObjectActionHandler() {
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_TEXT_BLOCK)
override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE
override fun getRange(
editor: Editor,
caret: Caret,
context: DataContext,
count: Int,
rawCount: Int,
argument: Argument?,
): TextRange {
return VimPlugin.getMotion().getSentenceRange(editor, caret, count, true)
}
}

View File

@ -1,44 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.`object`
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.TextObjectVisualType
import com.maddyhome.idea.vim.common.TextRange
import com.maddyhome.idea.vim.handler.TextObjectActionHandler
class MotionOuterWordAction : TextObjectActionHandler() {
override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE
override fun getRange(
editor: Editor,
caret: Caret,
context: DataContext,
count: Int,
rawCount: Int,
argument: Argument?,
): TextRange {
return VimPlugin.getMotion().getWordRange(editor, caret, count, true, false)
}
}

View File

@ -1,38 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.scroll
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Command
import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.handler.VimActionHandler
import com.maddyhome.idea.vim.helper.enumSetOf
import java.util.*
class MotionScrollLineUpAction : VimActionHandler.SingleExecution() {
override val type: Command.Type = Command.Type.OTHER_READONLY
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_IGNORE_SCROLL_JUMP)
override fun execute(editor: Editor, context: DataContext, cmd: Command, operatorArguments: OperatorArguments): Boolean {
return VimPlugin.getMotion().scrollLine(editor, -cmd.count)
}
}

View File

@ -1,38 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.scroll
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Command
import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.handler.VimActionHandler
import com.maddyhome.idea.vim.helper.enumSetOf
import java.util.*
class MotionScrollMiddleScreenLineAction : VimActionHandler.SingleExecution() {
override val type: Command.Type = Command.Type.OTHER_READONLY
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_IGNORE_SCROLL_JUMP)
override fun execute(editor: Editor, context: DataContext, cmd: Command, operatorArguments: OperatorArguments): Boolean {
return VimPlugin.getMotion().scrollLineToMiddleScreenLine(editor, cmd.rawCount, false)
}
}

View File

@ -1,42 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.text
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.MotionType
import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.handler.Motion
import com.maddyhome.idea.vim.handler.MotionActionHandler
class MotionBigWordEndLeftAction : MotionActionHandler.ForEachCaret() {
override fun getOffset(
editor: Editor,
caret: Caret,
context: DataContext,
argument: Argument?,
operatorArguments: OperatorArguments,
): Motion {
return VimPlugin.getMotion().moveCaretToNextWordEnd(editor, caret, -operatorArguments.count1, true)
}
override val motionType: MotionType = MotionType.EXCLUSIVE
}

View File

@ -1,42 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.text
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.MotionType
import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.handler.Motion
import com.maddyhome.idea.vim.handler.MotionActionHandler
class MotionBigWordEndRightAction : MotionActionHandler.ForEachCaret() {
override fun getOffset(
editor: Editor,
caret: Caret,
context: DataContext,
argument: Argument?,
operatorArguments: OperatorArguments,
): Motion {
return VimPlugin.getMotion().moveCaretToNextWordEnd(editor, caret, operatorArguments.count1, true)
}
override val motionType: MotionType = MotionType.INCLUSIVE
}

View File

@ -1,43 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.text
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.MotionType
import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.handler.Motion
import com.maddyhome.idea.vim.handler.MotionActionHandler
import com.maddyhome.idea.vim.handler.toMotionOrError
class MotionCamelEndRightAction : MotionActionHandler.ForEachCaret() {
override fun getOffset(
editor: Editor,
caret: Caret,
context: DataContext,
argument: Argument?,
operatorArguments: OperatorArguments,
): Motion {
return VimPlugin.getMotion().moveCaretToNextCamelEnd(editor, caret, operatorArguments.count1).toMotionOrError()
}
override val motionType: MotionType = MotionType.INCLUSIVE
}

View File

@ -1,43 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.text
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.MotionType
import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.handler.Motion
import com.maddyhome.idea.vim.handler.MotionActionHandler
import com.maddyhome.idea.vim.handler.toMotionOrError
class MotionCamelLeftAction : MotionActionHandler.ForEachCaret() {
override fun getOffset(
editor: Editor,
caret: Caret,
context: DataContext,
argument: Argument?,
operatorArguments: OperatorArguments,
): Motion {
return VimPlugin.getMotion().moveCaretToNextCamel(editor, caret, -operatorArguments.count1).toMotionOrError()
}
override val motionType: MotionType = MotionType.EXCLUSIVE
}

View File

@ -1,43 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.text
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.MotionType
import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.handler.Motion
import com.maddyhome.idea.vim.handler.MotionActionHandler
import com.maddyhome.idea.vim.handler.toMotionOrError
class MotionCamelRightAction : MotionActionHandler.ForEachCaret() {
override fun getOffset(
editor: Editor,
caret: Caret,
context: DataContext,
argument: Argument?,
operatorArguments: OperatorArguments,
): Motion {
return VimPlugin.getMotion().moveCaretToNextCamel(editor, caret, operatorArguments.count1).toMotionOrError()
}
override val motionType: MotionType = MotionType.EXCLUSIVE
}

View File

@ -1,48 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.text
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.MotionType
import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.handler.Motion
import com.maddyhome.idea.vim.handler.MotionActionHandler
import com.maddyhome.idea.vim.helper.enumSetOf
import java.util.*
class MotionMethodNextEndAction : MotionActionHandler.ForEachCaret() {
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_SAVE_JUMP)
override fun getOffset(
editor: Editor,
caret: Caret,
context: DataContext,
argument: Argument?,
operatorArguments: OperatorArguments,
): Motion {
val moveCaretToMethodEnd = VimPlugin.getMotion().moveCaretToMethodEnd(editor, caret, operatorArguments.count1)
return if (moveCaretToMethodEnd < 0) Motion.Error else Motion.AbsoluteOffset(moveCaretToMethodEnd)
}
override val motionType: MotionType = MotionType.EXCLUSIVE
}

View File

@ -1,48 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.text
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.MotionType
import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.handler.Motion
import com.maddyhome.idea.vim.handler.MotionActionHandler
import com.maddyhome.idea.vim.helper.enumSetOf
import java.util.*
class MotionMethodNextStartAction : MotionActionHandler.ForEachCaret() {
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_SAVE_JUMP)
override fun getOffset(
editor: Editor,
caret: Caret,
context: DataContext,
argument: Argument?,
operatorArguments: OperatorArguments,
): Motion {
val moveCaretToMethodStart = VimPlugin.getMotion().moveCaretToMethodStart(editor, caret, operatorArguments.count1)
return if (moveCaretToMethodStart < 0) Motion.Error else Motion.AbsoluteOffset(moveCaretToMethodStart)
}
override val motionType: MotionType = MotionType.EXCLUSIVE
}

View File

@ -1,48 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.text
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.MotionType
import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.handler.Motion
import com.maddyhome.idea.vim.handler.MotionActionHandler
import com.maddyhome.idea.vim.handler.toMotionOrError
import com.maddyhome.idea.vim.helper.enumSetOf
import java.util.*
class MotionSectionBackwardEndAction : MotionActionHandler.ForEachCaret() {
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_SAVE_JUMP)
override fun getOffset(
editor: Editor,
caret: Caret,
context: DataContext,
argument: Argument?,
operatorArguments: OperatorArguments,
): Motion {
return VimPlugin.getMotion().moveCaretToSection(editor, caret, '}', -1, operatorArguments.count1).toMotionOrError()
}
override val motionType: MotionType = MotionType.EXCLUSIVE
}

View File

@ -1,48 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.text
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.MotionType
import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.handler.Motion
import com.maddyhome.idea.vim.handler.MotionActionHandler
import com.maddyhome.idea.vim.handler.toMotionOrError
import com.maddyhome.idea.vim.helper.enumSetOf
import java.util.*
class MotionSectionBackwardStartAction : MotionActionHandler.ForEachCaret() {
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_SAVE_JUMP)
override fun getOffset(
editor: Editor,
caret: Caret,
context: DataContext,
argument: Argument?,
operatorArguments: OperatorArguments,
): Motion {
return VimPlugin.getMotion().moveCaretToSection(editor, caret, '{', -1, operatorArguments.count1).toMotionOrError()
}
override val motionType: MotionType = MotionType.EXCLUSIVE
}

View File

@ -1,48 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.text
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.MotionType
import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.handler.Motion
import com.maddyhome.idea.vim.handler.MotionActionHandler
import com.maddyhome.idea.vim.handler.toMotionOrError
import com.maddyhome.idea.vim.helper.enumSetOf
import java.util.*
class MotionSectionForwardEndAction : MotionActionHandler.ForEachCaret() {
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_SAVE_JUMP)
override fun getOffset(
editor: Editor,
caret: Caret,
context: DataContext,
argument: Argument?,
operatorArguments: OperatorArguments,
): Motion {
return VimPlugin.getMotion().moveCaretToSection(editor, caret, '}', 1, operatorArguments.count1).toMotionOrError()
}
override val motionType: MotionType = MotionType.EXCLUSIVE
}

View File

@ -1,48 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.text
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.MotionType
import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.handler.Motion
import com.maddyhome.idea.vim.handler.MotionActionHandler
import com.maddyhome.idea.vim.handler.toMotionOrError
import com.maddyhome.idea.vim.helper.enumSetOf
import java.util.*
class MotionSectionForwardStartAction : MotionActionHandler.ForEachCaret() {
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_SAVE_JUMP)
override fun getOffset(
editor: Editor,
caret: Caret,
context: DataContext,
argument: Argument?,
operatorArguments: OperatorArguments,
): Motion {
return VimPlugin.getMotion().moveCaretToSection(editor, caret, '{', 1, operatorArguments.count1).toMotionOrError()
}
override val motionType: MotionType = MotionType.EXCLUSIVE
}

View File

@ -1,48 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.text
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.MotionType
import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.handler.Motion
import com.maddyhome.idea.vim.handler.MotionActionHandler
import com.maddyhome.idea.vim.handler.toMotionOrError
import com.maddyhome.idea.vim.helper.enumSetOf
import java.util.*
class MotionSentenceNextStartAction : MotionActionHandler.ForEachCaret() {
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_SAVE_JUMP)
override fun getOffset(
editor: Editor,
caret: Caret,
context: DataContext,
argument: Argument?,
operatorArguments: OperatorArguments,
): Motion {
return VimPlugin.getMotion().moveCaretToNextSentenceStart(editor, caret, operatorArguments.count1).toMotionOrError()
}
override val motionType: MotionType = MotionType.EXCLUSIVE
}

View File

@ -1,48 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.text
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.MotionType
import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.handler.Motion
import com.maddyhome.idea.vim.handler.MotionActionHandler
import com.maddyhome.idea.vim.handler.toMotionOrError
import com.maddyhome.idea.vim.helper.enumSetOf
import java.util.*
class MotionSentencePreviousEndAction : MotionActionHandler.ForEachCaret() {
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_SAVE_JUMP)
override fun getOffset(
editor: Editor,
caret: Caret,
context: DataContext,
argument: Argument?,
operatorArguments: OperatorArguments,
): Motion {
return VimPlugin.getMotion().moveCaretToNextSentenceEnd(editor, caret, -operatorArguments.count1).toMotionOrError()
}
override val motionType: MotionType = MotionType.EXCLUSIVE
}

View File

@ -1,48 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.text
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.MotionType
import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.handler.Motion
import com.maddyhome.idea.vim.handler.MotionActionHandler
import com.maddyhome.idea.vim.handler.toMotionOrError
import com.maddyhome.idea.vim.helper.enumSetOf
import java.util.*
class MotionUnmatchedBraceCloseAction : MotionActionHandler.ForEachCaret() {
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_SAVE_JUMP)
override fun getOffset(
editor: Editor,
caret: Caret,
context: DataContext,
argument: Argument?,
operatorArguments: OperatorArguments,
): Motion {
return VimPlugin.getMotion().moveCaretToUnmatchedBlock(editor, caret, operatorArguments.count1, '}').toMotionOrError()
}
override val motionType: MotionType = MotionType.EXCLUSIVE
}

View File

@ -1,48 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.text
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.MotionType
import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.handler.Motion
import com.maddyhome.idea.vim.handler.MotionActionHandler
import com.maddyhome.idea.vim.handler.toMotionOrError
import com.maddyhome.idea.vim.helper.enumSetOf
import java.util.*
class MotionUnmatchedBraceOpenAction : MotionActionHandler.ForEachCaret() {
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_SAVE_JUMP)
override fun getOffset(
editor: Editor,
caret: Caret,
context: DataContext,
argument: Argument?,
operatorArguments: OperatorArguments,
): Motion {
return VimPlugin.getMotion().moveCaretToUnmatchedBlock(editor, caret, operatorArguments.count1, '{').toMotionOrError()
}
override val motionType: MotionType = MotionType.EXCLUSIVE
}

View File

@ -1,48 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.text
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.MotionType
import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.handler.Motion
import com.maddyhome.idea.vim.handler.MotionActionHandler
import com.maddyhome.idea.vim.handler.toMotionOrError
import com.maddyhome.idea.vim.helper.enumSetOf
import java.util.*
class MotionUnmatchedParenCloseAction : MotionActionHandler.ForEachCaret() {
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_SAVE_JUMP)
override fun getOffset(
editor: Editor,
caret: Caret,
context: DataContext,
argument: Argument?,
operatorArguments: OperatorArguments,
): Motion {
return VimPlugin.getMotion().moveCaretToUnmatchedBlock(editor, caret, operatorArguments.count1, ')').toMotionOrError()
}
override val motionType: MotionType = MotionType.EXCLUSIVE
}

View File

@ -1,48 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.text
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.CommandFlags
import com.maddyhome.idea.vim.command.MotionType
import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.handler.Motion
import com.maddyhome.idea.vim.handler.MotionActionHandler
import com.maddyhome.idea.vim.handler.toMotionOrError
import com.maddyhome.idea.vim.helper.enumSetOf
import java.util.*
class MotionUnmatchedParenOpenAction : MotionActionHandler.ForEachCaret() {
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_SAVE_JUMP)
override fun getOffset(
editor: Editor,
caret: Caret,
context: DataContext,
argument: Argument?,
operatorArguments: OperatorArguments,
): Motion {
return VimPlugin.getMotion().moveCaretToUnmatchedBlock(editor, caret, operatorArguments.count1, '(').toMotionOrError()
}
override val motionType: MotionType = MotionType.EXCLUSIVE
}

View File

@ -1,42 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.text
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.MotionType
import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.handler.Motion
import com.maddyhome.idea.vim.handler.MotionActionHandler
class MotionWordEndLeftAction : MotionActionHandler.ForEachCaret() {
override fun getOffset(
editor: Editor,
caret: Caret,
context: DataContext,
argument: Argument?,
operatorArguments: OperatorArguments,
): Motion {
return VimPlugin.getMotion().moveCaretToNextWordEnd(editor, caret, -operatorArguments.count1, false)
}
override val motionType: MotionType = MotionType.INCLUSIVE
}

View File

@ -1,42 +0,0 @@
/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2021 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.maddyhome.idea.vim.action.motion.text
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.command.Argument
import com.maddyhome.idea.vim.command.MotionType
import com.maddyhome.idea.vim.command.OperatorArguments
import com.maddyhome.idea.vim.handler.Motion
import com.maddyhome.idea.vim.handler.MotionActionHandler
class MotionWordEndRightAction : MotionActionHandler.ForEachCaret() {
override fun getOffset(
editor: Editor,
caret: Caret,
context: DataContext,
argument: Argument?,
operatorArguments: OperatorArguments,
): Motion {
return VimPlugin.getMotion().moveCaretToNextWordEnd(editor, caret, operatorArguments.count1, false)
}
override val motionType: MotionType = MotionType.INCLUSIVE
}

Some files were not shown because too many files have changed in this diff Show More