1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2024-11-24 05:42:45 +01:00
Commit Graph

1240 Commits

Author SHA1 Message Date
filipp
7c623ae4b5 Move case change methods to engine 2024-07-26 17:30:08 +03:00
filipp
f2ef92cdef Remove unused method 2024-07-26 17:30:08 +03:00
Matt Ellis
13426915f4 Remove special case handling for macro recording 2024-07-23 23:08:24 +03:00
Matt Ellis
844bc01537 Make functions protected 2024-07-23 23:08:24 +03:00
Matt Ellis
3d2d32b022 Move special case code to actions 2024-07-23 23:08:24 +03:00
Matt Ellis
a8677d3dd7 Refactor expected argument type
We no longer need to track a previous fallback argument type, since we don't support nested commands inside a command builder. We can just return the current argument type, or its fallback
2024-07-23 23:08:24 +03:00
Matt Ellis
7217fdf734 Remove unused special case check
This was to handle nested commands, e.g. inserting a digraph inside a search `d/foo<C-K>OK<CR>`. The command line now has its own command builder, so this check is no longer needed
2024-07-23 23:08:24 +03:00
Matt Ellis
0c867b3869 Make some CommandBuilder properties immutable 2024-07-23 23:08:24 +03:00
Matt Ellis
b3bcab4336 Refactor DigraphResult to sealed classes 2024-07-23 23:08:24 +03:00
Matt Ellis
fe1b48a9b3 Refactor digraph prompt handling 2024-07-23 23:08:24 +03:00
Matt Ellis
b5a0862520 The last command part is the current one 2024-07-23 23:08:24 +03:00
Matt Ellis
babc1f54e5 Return the last valid register if it exists
The last command part is not guaranteed to be a "select register" part. The user might have selected a register then typed an operator, and we might be waiting for a motion.
2024-07-23 23:08:24 +03:00
Matt Ellis
32b910a65b Remove unused functions and properties 2024-07-23 23:08:24 +03:00
Alex Plate
4a85058ba2
Start using kotlin 2.0
Originally this is needed to update the dependency on AceJump, which uses the kotlin 2.0 compiler, and its classes are not compatible with the old compiler
2024-07-19 17:13:59 +03:00
Filipp Vakhitov
5588c27037 Attempt to fix VIM-3540
I'm not sure what causes the issue, but everything was working when we were updating visual attributes per each caret and... let update them per each caret
2024-07-17 14:45:50 +03:00
Filipp Vakhitov
d46102ccaf Remove deprecated method from vim-engine 2024-07-17 13:30:54 +03:00
Filipp Vakhitov
bf6517e58f Add comment 2024-07-17 13:30:54 +03:00
Filipp Vakhitov
aec2f4c435 Remove isCancel argument
It was not used anywhere
2024-07-17 13:30:54 +03:00
Filipp Vakhitov
8f905758d5 Remove typing in ModalInput
Typing is more suitable for command lines than a modal input, and most likely it should be used instead
It is still possible to support typing by properly implementing the handleKey method
2024-07-17 13:30:54 +03:00
Filipp Vakhitov
80cc236f48 Remove modal input on click 2024-07-17 13:30:54 +03:00
Filipp Vakhitov
e432a02a45 Remove confirmChoice method
It used secondary loop
2024-07-17 13:30:54 +03:00
Filipp Vakhitov
d7894fa7f4 ProcessSubstituteCommand refactoring part 9
Finally, moved confirmation dialog to modal input
2024-07-17 13:30:54 +03:00
Filipp Vakhitov
853d7032f0 ProcessSubstituteCommand refactoring part 8 2024-07-17 13:30:54 +03:00
Filipp Vakhitov
5f9f57e1c0 ProcessSubstituteCommand refactoring part 7 2024-07-17 13:30:54 +03:00
Filipp Vakhitov
f4381c8216 ProcessSubstituteCommand refactoring part 6 2024-07-17 13:30:54 +03:00
Filipp Vakhitov
20eee7cae7 ProcessSubstituteCommand refactoring part 5 2024-07-17 13:30:54 +03:00
Filipp Vakhitov
33392c2148 ProcessSubstituteCommand refactoring part 4 2024-07-17 13:30:54 +03:00
Filipp Vakhitov
bb67564fbe ProcessSubstituteCommand refactoring part 3 2024-07-17 13:30:54 +03:00
Filipp Vakhitov
61ccbcd788 ProcessSubstituteCommand refactoring part 2
We do not need the `doAll` condition (because the next code block with `doAll` adjusts line and column for the next match to be correct),
And the line2 can't be >= editor.lineCount()
2024-07-17 13:30:54 +03:00
Filipp Vakhitov
1dbaa3be6d ProcessSubstituteCommand refactoring part 1 2024-07-17 13:30:54 +03:00
Filipp Vakhitov
872bc22830 Remove shouldRecord from KeyConsumer
shouldRecord value was only updated in ModeInputConsumer when the key was not handled. But when the key is not handled, it is not passed to finishedCommandPreparation and the shouldRecord value is not used
2024-07-17 13:30:54 +03:00
Filipp Vakhitov
ce23ed814c Move command line key handling logic to KeyConsumer 2024-07-17 13:30:54 +03:00
Filipp Vakhitov
82cd534756 Remove startExEntry method
We may create a command line via the VimCommandLineService and forget (or do not know) about calling startExEntry necessary. So we move its logic inside the creation of the command line
2024-07-17 13:30:54 +03:00
Filipp Vakhitov
673809d6b9 Move lastCommand to CmdFilterCommand 2024-07-17 13:30:54 +03:00
Filipp Vakhitov
cdbaf73b1e Remove unused fields from VimProcessGroup 2024-07-17 13:30:54 +03:00
Filipp Vakhitov
7f911b7e72 Fix VisualAreaMatcher
It looks for the last selection info in all conditions, not the ones that were specified
2024-07-17 13:30:54 +03:00
Filipp Vakhitov
75935ce4d1 Add readInputAndProcess to replace inputString and save us from using secondary loop 2024-07-17 13:30:54 +03:00
Filipp Vakhitov
f0b203409e Replace cancelExEntry with close method in VimCommandLine 2024-07-17 13:30:54 +03:00
Filipp Vakhitov
b3b369eb59 Remove unnecessary write action
`insertRegister` is self synchronized
2024-07-17 13:30:54 +03:00
Filipp Vakhitov
96072982cf Replace deprecated inputString() with ModalInput 2024-07-17 13:30:54 +03:00
Filipp Vakhitov
149edefad5 Delegate handling closing keystrokes to implementations
Sometimes it may mean aborting interception (CTRL-C), sometimes finishing it (CR)
2024-07-17 13:30:54 +03:00
Filipp Vakhitov
52d3840c83 Rename argument 2024-07-17 13:30:54 +03:00
Filipp Vakhitov
793677d4fd Add typeText() method to VimModalInput 2024-07-17 13:30:54 +03:00
Filipp Vakhitov
68dcab6262 Introduce ModalInput to get rid of Swing's secondary loop 2024-07-17 13:30:54 +03:00
Filipp Vakhitov
f38fd3512c Fix passing key to editor when the output panel is scrolled to its end 2024-07-17 13:30:54 +03:00
Filipp Vakhitov
e515278ba3 Add label field to VimOutputPanel 2024-07-17 13:30:54 +03:00
Filipp Vakhitov
9cc69e41ee Add KeyHandling logic to VimOutputPanel 2024-07-17 13:30:54 +03:00
Filipp Vakhitov
2109ff235c Fix tests 2024-07-16 20:32:11 +03:00
Filipp Vakhitov
8369391902 Fix(VIM-3530): "Yank inner block"/"Change inner block" uses wrong block 2024-07-16 18:47:58 +03:00
Alex Plate
3465e11c3a
Initialize the injector in multiple entry points of IntelliJ
Initially, injector was initialized in VimPlugin, assuming that almost every interaction with the plugin goes through it. However, with the plugin evolution, this class starts to be less used.
As IJ doesn't have any single entry point for the plugins, we initialize it in multiple places.
However, the architecture where the plugin might be not initizlied is considered as a bad acrhitecture and should be reviewed.

Related ticket: VIM-3369
2024-07-12 15:09:18 +03:00
dependabot[bot]
ca3e56d0d6 Bump org.mockito.kotlin:mockito-kotlin from 5.3.1 to 5.4.0
Bumps [org.mockito.kotlin:mockito-kotlin](https://github.com/mockito/mockito-kotlin) from 5.3.1 to 5.4.0.
- [Release notes](https://github.com/mockito/mockito-kotlin/releases)
- [Commits](https://github.com/mockito/mockito-kotlin/compare/5.3.1...5.4.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-10 18:21:34 +03:00
filipp
ea98e50f65 Sometimes safety is a bad thing 2024-07-08 13:09:08 +03:00
filipp
168174e383 Add missing resetOpPending to KeyHandler.reset 2024-07-08 13:09:08 +03:00
filipp
53cd4e1b88 Remove KeyHandlerStateResetter
It's an oneliner that we can live without
2024-07-08 13:09:08 +03:00
filipp
27e3561bb8 Safer VimListenersNotifier 2024-07-08 13:09:08 +03:00
filipp
9bb9cb13e3 Fix possible bug in the ExOutputModel.show() method and add documentation 2024-07-08 13:09:08 +03:00
filipp
16455f7241 Remove the update() method from VimOutputPanel 2024-07-08 13:09:08 +03:00
filipp
82225aa519 Use new interface instead of the old one 2024-07-08 13:09:08 +03:00
Filipp Vakhitov
5f2baefc6c Introduce new interface for VimOutputPanel to support the output panel in Fleet
Why is the old interface bad?
- it is not obvious. You cannot create a new panel or check if it is already created. Only "getOrCreate" it
- output panel is bound to editor while in Vim it is global
- we have the `isActive` field and the `clear()` method at the same time, because interface implies that you store the same instance of the panel and reactivate it for each output and I don't like it. We also can forget to call `clear()` after reusing panel
- we cannot "build" output before showing to make the panel more efficient. With multiple carets we can only cal `output(oldText + newText)` for each caret, and it is bad. (imagine we have global command with a lot of matches and for each time we will need to call the `output(oldText + newText)`)
- the `output()` method shows panel, activates it and updates it
- there are more things that I do not like, but the points above should be already enough
2024-07-08 13:09:08 +03:00
Filipp Vakhitov
cedcf39723 Fix(VIM-3461): Focus regression 2024-07-08 13:09:08 +03:00
Filipp Vakhitov
4925d9aada Remove ideaglobalmode option
Mode is global now
2024-07-08 13:09:08 +03:00
Filipp Vakhitov
f3e6df32d0 Fix(VIM-3462): IdeaVim not responsive occasionally
This bug was caused by two reasons:
1. KeyHandler state is not longer per-editor and we can't reset it on editor creation
2. We do not need to do such things on editor creation. What actually matters is focusing the editor
2024-07-08 13:09:08 +03:00
Filipp Vakhitov
5aaa8752af Move to new API from deprecated one 2024-07-08 13:09:08 +03:00
Filipp Vakhitov
a1d214316c Make VimStateMachine global
It is global in Vim
2024-07-08 13:09:08 +03:00
filipp
8a1e3eb066 Move toggleInsertOverwrite() to VimEditor
If we execute it from VimStateMachine directly, then mode change listeners are not notified
2024-07-08 13:09:08 +03:00
Filipp Vakhitov
07b1db4b28 Fix(VIM-3518): line numbers in :g/ not displayed 2024-07-04 01:50:33 +06:00
Filipp Vakhitov
dc775a0f22 Move number option to vim-engine 2024-07-04 00:11:36 +06:00
Filipp Vakhitov
10228f953e Fix(VIM-3517): Add support for global find & replace Vim-ism — :g/pattern/s//replacement/g 2024-07-03 22:34:42 +06:00
Matt Ellis
b2a4e59571 Update gradle plugin to beta 8
Fixes an issue with resetting the sandbox after killing the IDE instead of quitting gracefully
2024-07-03 19:39:55 +03:00
Alex Plate
f4eef04750
Do not bundle kotlin-stdlib and kotlin-reflection to the plugin distribution
IJ has it's own kotlin libs, as well as fleet. So, let's use kotlin reflection library only to compile the project without bundling these jars into the resulting plugin
2024-07-03 19:32:10 +03:00
dependabot[bot]
e62c86b99f Bump org.junit.jupiter:junit-jupiter-api from 5.10.2 to 5.10.3
Bumps [org.junit.jupiter:junit-jupiter-api](https://github.com/junit-team/junit5) from 5.10.2 to 5.10.3.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.10.2...r5.10.3)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter-api
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-03 19:13:37 +03:00
dependabot[bot]
82bd792da5 Bump org.junit.jupiter:junit-jupiter-engine from 5.10.2 to 5.10.3
Bumps [org.junit.jupiter:junit-jupiter-engine](https://github.com/junit-team/junit5) from 5.10.2 to 5.10.3.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.10.2...r5.10.3)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter-engine
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-03 18:56:45 +03:00
Alex Plate
647510de5d
Optimize imports for the project 2024-06-28 17:30:17 +03:00
Alex Plate
9538714af1
Remove explicit API mode to enhance coding efficiency and maintain Kotlin's conciseness
Explicit API mode has been removed due to several reasons impacting developer productivity and the natural coding style in Kotlin.

Firstly, the mode was found to be more irritating than beneficial, as it forced unnecessary verbosity without enhancing thoughtfulness in coding. It often prompted automatic 'public' insertion reactions to red-highlighted code, which did not genuinely encourage more deliberate coding decisions.

Secondly, our aim is to form a robust API primarily through interfaces, which inherently define public scope and duty, rendering explicit API mode somewhat redundant.

Lastly, the additional verbosity caused by explicit API mode expanded code lines affecting code readability.

The compatibility with the existing plugins is verified via the compatibility checker, so no JetBrains plugins will be affected
2024-06-28 17:11:16 +03:00
filipp
8de2b8976b Avoid using deprecated RegExp in VimRegexService 2024-06-28 16:58:13 +03:00
filipp
a6aa26b5d9 Remove deprecated methods 2024-06-28 16:58:13 +03:00
filipp
2505651c68 Deprecate methods in VimStateMachine that duplicate KeyHandler functionality 2024-06-28 16:58:13 +03:00
filipp
e67c7b23ff Remove deprecated code from VimStateMachine 2024-06-28 16:58:13 +03:00
filipp
453cca3b0c Remove resetState() from editor
It mostly resets KeyHandler, so it's more a KeyHandler responsibility. It also utilises deprecated API.
2024-06-28 16:58:13 +03:00
filipp
ae8b9b4773 Mark isOperatorPending as deprecated
It calls the same method in KeyHandler. We do not need it in VimStateMachine
2024-06-28 16:58:12 +03:00
Matt Ellis
e748b7b265 Fix soft wrap inconsistency in run console
IntelliJ has multiple soft wrap options. One for main editors, another for consoles and a third for previews. This can lead to inconsistencies if initialising a console based on a main editor when both have default values, versus the same scenario when the main editor has an explicit value. Furthermore, the run console's soft-wraps toggle button uses the global value, so can get out of sync if the local value is initialised to an explicit value. This change will only copy the soft wrap value over during initialisation for similar editors (main editor, preview, diff) and not for different editors (console).

Fixes VIM-3450
2024-06-28 16:50:25 +03:00
Matt Ellis
8073d7ecd0 Fix copying 'fileencoding' during window opening
The option should be "local-noglobal", and reset to default. Copying the value could cause the file to be converted immediately, possibly with a warning dialog

Fixes VIM-3467
2024-06-28 16:50:25 +03:00
Matt Ellis
f1b94d7026 Fix regression ignoring case in global command
Regression in new regex engine
2024-06-28 16:50:25 +03:00
Matt Ellis
b0e6b72281 Fix regression missing newlines in :print output 2024-06-28 16:50:25 +03:00
Alex Plate
736cb219ca
Remove the use of RegExp from ExEntryPanel 2024-06-28 16:47:32 +03:00
filipp
7e56331e47 Fix failing test 2024-06-28 15:47:19 +03:00
filipp
4255ef68a3 Post review improvements
Add explanatory comment
2024-06-28 13:55:06 +03:00
Filipp Vakhitov
3313464214 Fix(VIM-3501): Global commands applied to the following lines if matches > 1 2024-06-28 13:55:06 +03:00
Filipp Vakhitov
683ba32a15 Fix test compilation 2024-06-28 13:55:06 +03:00
Filipp Vakhitov
90a60155e5 Move VimscriptParser to vim-engine 2024-06-28 13:55:06 +03:00
Filipp Vakhitov
b25d06ed9e Move Vimscript visitors to vim-engine 2024-06-28 13:55:06 +03:00
Filipp Vakhitov
706ae3dd91 Move GlobalCommand to vim-engine 2024-06-28 13:55:06 +03:00
Filipp Vakhitov
9b15ed8181 Add VimRangeMarker 2024-06-28 13:55:06 +03:00
Filipp Vakhitov
f355bef36b Remove deprecated SearchGroup.java 2024-06-28 13:55:06 +03:00
Filipp Vakhitov
4391e69c48 Move DocumentSearchListener to IjVimSearchGroup 2024-06-28 13:55:06 +03:00
Filipp Vakhitov
0710d80391 Remove SearchGroup from GlobalCommand 2024-06-28 13:55:06 +03:00
filipp
cf41a3a76c Fix(VIM-3507): Mapping exits early on double backslash 2024-06-28 13:46:06 +03:00
Filipp Vakhitov
1b0886041b Fix(VIM-3506): in command mode no longer change cursor to " 2024-06-27 15:46:22 +05:00
filipp
948520f90a Fix(VIM-3485): Stay in the same split when using (Back) or (Forward) 2024-06-21 17:44:44 +03:00
Alex Pláte
28aa156cb7
Merge branch 'master' into feature/gradle-intellij-plugin-v2 2024-06-21 16:30:25 +03:00