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

137 Commits

Author SHA1 Message Date
dependabot[bot]
f834ef2ef3 Bump org.junit:junit-bom from 5.13.4 to 6.0.0
Bumps [org.junit:junit-bom](https://github.com/junit-team/junit-framework) from 5.13.4 to 6.0.0.
- [Release notes](https://github.com/junit-team/junit-framework/releases)
- [Commits](https://github.com/junit-team/junit-framework/compare/r5.13.4...r6.0.0)

---
updated-dependencies:
- dependency-name: org.junit:junit-bom
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-01 15:17:29 +00:00
Alex Plate
f5c1b11e4f [API] Rename Read to EditorAccessor 2025-09-05 16:51:06 +03:00
Matt Ellis
c5f6b2e336 Add insert big word at cursor command line action
Relates to VIM-2511
2025-09-05 12:37:45 +03:00
dependabot[bot]
faf7a44f7d Bump org.junit:junit-bom from 5.10.0 to 5.13.4
Bumps [org.junit:junit-bom](https://github.com/junit-team/junit-framework) from 5.10.0 to 5.13.4.
- [Release notes](https://github.com/junit-team/junit-framework/releases)
- [Commits](https://github.com/junit-team/junit-framework/compare/r5.10.0...r5.13.4)

---
updated-dependencies:
- dependency-name: org.junit:junit-bom
  dependency-version: 5.13.4
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-04 09:52:47 +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
0b919b18b7 [API] Fix handling of empty strings in list option functions
The append, prepend, and remove functions now correctly handle empty
option values. When an option is empty (""), we use an empty list
instead of splitting the empty string which would result in [""].

This fixes test failures in OptionScopeTest for operations on empty options.
2025-08-29 19:00:37 +03:00
Alex Plate
9499716b18 [API] Simplify list option handling in OptionScope 2025-08-29 18:11:27 +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
955ccc8151 [API] Make getOptionValue return type non-nullable
The implementation always returns a value or throws an exception,
so the return type should be non-nullable to reflect this behavior.
Updated extension functions to remove unnecessary null checks.
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
2b276d316f [API] Add append(), prepend(), and remove() extension functions for list options
- append(): adds values to end of comma-separated list (like Vim's +=)
- prepend(): adds values to beginning of list (like Vim's ^=)
- remove(): removes values from list (like Vim's -=)
- All functions prevent duplicate values from being added
- Comprehensive test coverage for all scenarios
2025-08-29 18:11:25 +03:00
Alex Plate
4f1982d6bd [API] Add toggle() function to OptionScope for boolean options
Adds a simple toggle() function that flips boolean option values.
Works with both full option names and abbreviations.

Example usage:
  toggle("ignorecase")  // true → false, false → true
  toggle("ic")          // works with abbreviations
2025-08-29 18:11:25 +03:00
Alex Plate
a235648672 [API] Add split() extension function to OptionScope for comma-separated values
Adds a concise String.split() extension function within OptionScope that splits
comma-separated option values into lists. This simplifies working with list-type
options like 'virtualedit', 'whichwrap', etc.

Example usage:
  val values = get<String>("virtualedit")?.split() ?: emptyList()
  // "block,all" → ["block", "all"]
2025-08-29 18:11:25 +03:00
Alex Plate
6a149a8ba4 [API] Add an experimental status on the API 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
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
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
1db8d01961 Add detailed documentation for label usage in key mapping methods
Documented the role of `label` in providing intermediate mappings, allowing users to override default plugin mappings with custom configurations.
2025-08-08 16:23:37 +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
fb6a97f586 Remove redundant return statement in CommandLineScope 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
e2b20bb04d Reformat API module 2025-08-08 12:44:29 +03:00
Alex Plate
add8023155 Rename @VimPluginDsl to @VimApiDsl
The API is a more correct term, despite the fact that the API will be mostly used from the plugins.
2025-08-08 12:44:29 +03:00
Mia Vucinic
26e33c088c implement ksp for extensions processing 2025-08-01 16:16:26 +03:00
Mia Vucinic
06e34d6005 add a default value for isBigWord in getNextWordStartOffset and getNextWordEndOffset 2025-07-29 16:27:03 +02: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
Mia Vucinic
4282a58719 fix doc comments for count parameter 2025-07-28 10:21:40 +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
Mia Vucinic
5f4cd75898 remove unnecessary getNextWordStartOffset function from VimScope 2025-07-24 08:15:09 +02:00
Mia Vucinic
6abee14079 have CaretTransaction extend Read 2025-07-24 07:56:23 +02:00
Mia Vucinic
d5e64a8f28 split read into Read and ReadScope
- We want to be able to execute functions defined on read scope under write lock as well, which means we want to have transaction extend read. However, due to conflicting names for caret scope builders (forEachCaret, withPrimaryCaret etc.) it was necessary to split it into two scopes:
1) Read - contains only functions available under read lock
2) ReadScope - contains both caret scope builders and functions defined on Read
2025-07-23 12:01:28 +02:00
Mia Vucinic
e7ec16e8f1 remove variable locking 2025-07-22 13:46:04 +02:00
Mia Vucinic
74e213af1d remove methods from caret transaction 2025-07-22 13:42:13 +02:00
Mia Vucinic
2aa5230aa7 fix docs 2025-07-22 13:29:41 +02:00
Mia Vucinic
ceaa74854f add docs 2025-07-22 13:17:04 +02:00
Mia Vucinic
fd5e84eddc add docs 2025-07-22 12:39:10 +02:00
Mia Vucinic
f5cf751a0a move files to appropriate packages 2025-07-22 12:31:53 +02:00
Mia Vucinic
6f4bd936f9 update docs 2025-07-22 12:12:39 +02:00
Mia Vucinic
34af17d18e rename caretAfterInsertedText to caret at end 2025-07-21 21:06:39 +02:00
Mia Vucinic
67fa38d999 add caret transaction test 2025-07-21 21:06:39 +02:00
Mia Vucinic
891b6316eb add a replace text blockwise function 2025-07-21 21:06:39 +02:00