1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2025-10-09 04:26:57 +02:00
Commit Graph

1781 Commits

Author SHA1 Message Date
Matt Ellis
3e18fcd7f1 Rename StartSelectRegisterConsumer 2025-09-05 12:37:45 +03:00
Matt Ellis
c3c581ceb6 Rename CommandConsumer to CommandKeyConsumer 2025-09-05 12:37:45 +03:00
Matt Ellis
abf7dc51bd Add doc comments for all key consumers 2025-09-05 12:37:45 +03:00
Matt Ellis
a0d3fd9eed Rename DeleteCommandConsumer to add Count 2025-09-05 12:37:45 +03:00
Matt Ellis
f53d93016d Make it a little easier to debug key consumers
Adding an `isApplicable` function allows avoiding stepping into irrelevant consumers
2025-09-05 12:37:45 +03:00
dependabot[bot]
739336ca45 Bump org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm
Bumps [org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm](https://github.com/Kotlin/kotlinx.coroutines) from 1.8.1 to 1.10.2.
- [Release notes](https://github.com/Kotlin/kotlinx.coroutines/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md)
- [Commits](https://github.com/Kotlin/kotlinx.coroutines/compare/1.8.1...1.10.2)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm
  dependency-version: 1.10.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-04 09:52:39 +03:00
dependabot[bot]
759df9eb22 Bump org.jetbrains:annotations from 26.0.2 to 26.0.2-1
Bumps [org.jetbrains:annotations](https://github.com/JetBrains/java-annotations) from 26.0.2 to 26.0.2-1.
- [Release notes](https://github.com/JetBrains/java-annotations/releases)
- [Changelog](https://github.com/JetBrains/java-annotations/blob/master/CHANGELOG.md)
- [Commits](https://github.com/JetBrains/java-annotations/compare/26.0.2...26.0.2-1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-04 09:36:07 +03:00
Alex Plate
de809b528b [API] Turn OptionScopeImpl into an object 2025-08-29 18:11:26 +03:00
Alex Plate
c6adc48e81 [API] Make option() function return a value
This allows users to easily retrieve values from option scope:
val x = option { get<Int>("history") }

- Changed option() signature from Unit to generic T return type
- Updated VimApiImpl implementation to return the lambda result
- Added test demonstrating the new return value capability
2025-08-29 18:11:26 +03:00
Alex Plate
907495df4d [API] Refactor OptionScope from abstract class to interface
- Convert OptionScope from abstract class to interface
- Extract inline functions with reified types as extension functions
- Make getOptionValue() and setOption() public interface methods
- Remove internal modifier layer functions
- Update OptionScopeImpl to implement new interface
- Add documentation recommending extension function usage
- Update test imports to use new extension functions
2025-08-29 18:11:25 +03:00
Alex Plate
476389b9c3 Bring back actualText to keep the compatibility with an external plugin 2025-08-29 11:48:26 +03:00
Alex Plate
7e71676656 [API] The write lock should be taken on EDT 2025-08-29 11:45:22 +03:00
Alex Plate
186db70a22 [API] Specify and cleanup the error handling in the option scope
1) ExException is wrapped with the IllegalArgumentException. We cannot use the raw ExException as it's not defined in the API module. So, if any client will have an access only to the API module, they won't be able to handle this kind of the exception.

2) getOption throws IllegalArgumentException if the type classifier is null. I don't know when this might happen, but this looks more like a plugin developer error. Also, this allows to distinguish the wrong option name vs this type of problem

3) In setOption and getOption throw an exception if there is no such option. This clearly explains what is wrong with this call.

Note: there was a question of using exceptions vs some return values, even like `Result`. The decision falls into the using of exceptions as using the wrong arguments in the plugin is a programming error from the user point of view.
This means, if there is a plugin that checks some option that in reality doesn't exist, it's not a fail of the end user and the end user cannot do anything about that.
Also, using the `Result` will force the plugin developer to handle all possible failure branches, what is quite unnecessary when accessing a well-defined option.
2025-08-22 17:52:51 +03:00
Alex Plate
04d9282fb2 Change OutputPanelScopeImpl to be an object 2025-08-22 16:30:51 +03:00
Alex Plate
6f54a30bc3 Fix(VIM-4004): Add support for f13-f24 keys 2025-08-22 16:09:43 +03:00
Matt Ellis
4cc3bd2b9f Use return value of Escape action
If none of the IDE Escape handlers do anything, we get Vim's lovely beep
2025-08-22 15:26:26 +03:00
Matt Ellis
f0a104a131 Reset caret shape on Escape
Provides a way to reset and resync the caret shape by hitting Escape, even if we don't change mode
2025-08-22 15:26:26 +03:00
Matt Ellis
d8a79cb12f Use Vim actions to insert Tab
Previously, we would drop out of VimShortcutKeyAction when hitting Tab in Insert mode. This allowed Emmet to work because ExpandLiveTemplateByTabAction (one of the many actions registered for Tab) would have a chance to handle it.

Now we let Tab actions try to handle the key before Vim does, so we can let Vim handle Tab. In Insert mode, Vim now inserts the tab (or equivalent spaces) by invoking the "EditorTab" action, which is the same as the TabAction handler in the list of actions. Because Vim does this, we can now easily repeat inserting Tab without workarounds, remap `<Tab>` and `<S-Tab>` and Vim will update scroll locations after inserting the text.

Fixes VIM-2331. Fixes JetBrains/ideavim#938. Fixes JetBrains/ideavim#280
2025-08-22 15:26:26 +03:00
Matt Ellis
d850052f20 Fix count accepted as valid in text object
Fixes VIM-3960
2025-08-22 14:17:33 +03:00
Matt Ellis
cb74ff6af2 Fix normalising visual column
Would previously normalise against the entire buffer line length rather than just the current visual line length. For short lines, this would not include inlays, and would therefore position the caret wrong when moving up/down at end of line. For long, wrapped lines, this just plain wouldn't work.

Fixes VIM-3997
2025-08-22 14:15:44 +03:00
Alex Plate
a0a3f3f3b1 Fix an exception during the renaming: there was a read action missing 2025-08-22 11:22:38 +03:00
Alex Plate
aa539e76eb Rename RWLockLabel to VimLockLabel and other annotations
Also, clarify their usage
2025-08-22 11:22:38 +03:00
Alex Plate
ddb4c5ec81 Comment out listeners scope. It does require an accurate and proper review and design 2025-08-08 18:07:59 +03:00
Alex Plate
22e6ba3b3c Refactor DigraphScopeImpl to be an object and simplify digraph method logic 2025-08-08 18:04:09 +03:00
Alex Plate
e2a089fbeb Remove function to clearing all custom digraphs
This function is not provided by vim and by using it from the plugins we may drop the digraphs created by other plugins.
It'd be better to provide a just remove function. However, let's skip it for now. Also, maybe we should use an approach with the owners
2025-08-08 18:00:30 +03:00
Alex Plate
5cfed9929e Refresh documentation for MappingScope 2025-08-08 17:43:00 +03:00
Alex Plate
e85c006321 Remove isRepeatable parameter from key mapping methods
First of all, this is a property of the plugin, not the mapping. Secondly, all plugins should support repeat.
2025-08-08 17:11:10 +03:00
Alex Plate
9c9cd1b2a0 Bring back the function to set the mode, but in experimental status now 2025-08-08 14:28:01 +03:00
Alex Plate
87f5a6fab3 Remove stub classes
This solution was initially questionable. For a long time it produced nothing but more work on implementing the stubs.
2025-08-08 12:44:30 +03:00
Alex Plate
9d92ae9449 Remove the suspend from functions under the read or write actions
The suspending operations must not be performed under the read or write actions as this will lead to performance issues or freezes.

Also, the current implementation of launching coroutine under the write action is simply incorrect. The coroutine will escape the write action into another thread.
2025-08-08 12:44:30 +03:00
Alex Plate
492bd62166 Rename VimScope to VimApi and move it into a different package
`VimApi` would be a better entry point name. Also, the API term is clearer than the scope.
2025-08-08 12:44:30 +03:00
Alex Plate
a0c213b90d Refactor Mode in API to be a simple enum
The current representation of Mode with `returnTo` is quite complicated and we're not even sure it'll remain like that.
At the same time, `mode()` function in Vim has quite a reach specification and there is a small chance it'll be changed. With this approach, we use values from Vim, yet in a form of enum.
2025-08-08 12:44:30 +03:00
Alex Plate
fee75001f6 Do not allow to change the mode from the API
The details why we don't want this for now are logged in the code
2025-08-08 12:44:29 +03:00
Alex Plate
df3fb1a8a3 Convert VimScope into the interface 2025-08-08 12:44:29 +03:00
Alex Plate
057f4eee5d The ReadImpl does not inherit the VimScopeImpl
`ReadImpl` didn't use anything from `VimScopeImpl`. This would make sense if `Read` inherited `VimScope`, but it doesn't.
Also, we'll always be able to bring back the dependency if we figure out it's necessary.
2025-08-08 12:44:29 +03:00
Mia Vucinic
3cb5308193 fix failing tests 2025-08-01 16:16:29 +03:00
Mia Vucinic
807dff45a9 add a new ReplaceWithRegister plugin implementation 2025-08-01 16:16:27 +03:00
Mia Vucinic
a25b88327e implement PlugDisable command 2025-08-01 16:16:27 +03:00
Mia Vucinic
fbb2351ec2 implement PlugEnable command 2025-08-01 16:16:26 +03:00
Mia Vucinic
621969faec implement a new way for registering extensions 2025-08-01 16:16:26 +03:00
Mia Vucinic
26e33c088c implement ksp for extensions processing 2025-08-01 16:16:26 +03:00
Alex Plãte
38fba69c33 Merge pull request #1246 from JetBrains/thin-api-first-draft
API for writing plugins
2025-08-01 15:43:46 +03:00
Mia Vucinic
8ae792e74e add return value to with and withPrimaryCaret 2025-07-29 16:23:12 +02:00
Mia Vucinic
15660a9f3d make functions in output panel scope non suspend 2025-07-29 16:10:15 +02:00
Matt Ellis
7d9fa418ce Support :k{mark} without separating whitespace
Fixes VIM-3915
2025-07-28 12:21:46 +03:00
Matt Ellis
68e9538ac5 Remove unnecessary special case handling of subst
This was added before the grammar made whitespace optional between command and argument
2025-07-28 12:21:46 +03:00
Mia Vucinic
f74552ef19 fix replaceText when editor is empty 2025-07-28 10:07:17 +02:00
Mia Vucinic
a4e9e70df7 add test for inserting empty text and fix coerceIn function 2025-07-28 07:32:29 +02:00
Mia Vucinic
55b44aab53 implement add caret and remove caret functions 2025-07-28 07:32:18 +02:00
Mia Vucinic
c95421518e fix path handling for jump and marks 2025-07-24 17:13:41 +02:00