1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2026-03-30 21:52:36 +02:00
Commit Graph

1951 Commits

Author SHA1 Message Date
91546dd0d7 Make g0/g^/g$ work with soft wraps 2026-03-30 07:58:49 +02:00
89e1511860 Make gj/gk jump over soft wraps 2026-03-30 07:58:49 +02:00
507bbff1c3 Make camelCase motions adjust based on direction of visual selection 2026-03-30 07:58:49 +02:00
13246c0a80 Stop macro execution after a failed search 2026-03-29 19:45:22 +02:00
b0ff57a4f5 Revert per-caret registers 2026-03-29 19:45:22 +02:00
b623bf739c Update search register when using f/t 2026-03-29 19:45:21 +02:00
c99d97b3bc Add support for count for visual and line motion surround 2026-03-29 19:45:21 +02:00
25d70ee975 Fix(VIM-696): Restore visual mode after undo/redo, and disable incompatible actions 2026-03-29 19:45:21 +02:00
cbc9637d17 Respect count with <Action> mappings 2026-03-29 19:45:21 +02:00
45f7934d71 Revert "Fix(VIM-4108): Use default ANTLR output directory for Gradle 9+ compatibility"
This reverts commit a476583ea3.
2026-03-27 21:40:07 +01:00
dependabot[bot]
02354fafb0 Bump org.mockito.kotlin:mockito-kotlin from 6.2.3 to 6.3.0
Bumps [org.mockito.kotlin:mockito-kotlin](https://github.com/mockito/mockito-kotlin) from 6.2.3 to 6.3.0.
- [Release notes](https://github.com/mockito/mockito-kotlin/releases)
- [Commits](https://github.com/mockito/mockito-kotlin/compare/v6.2.3...v6.3.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-25 15:40:37 +00:00
1grzyb1
35fe3f9cca VIM-2821 Undo for repeating insertText in split mode
Insert text wasn't being properly grouped into single undo group when performing `.`
Now whole `.` is grouped into single undo entry
2026-03-24 08:56:46 +01:00
Alex Plate
f0c9c6d16b Reorganize VimApi into scopes with dual-access pattern
Move loose functions from VimApi into dedicated scope interfaces
(VariableScope, CommandScope, TabScope, StorageScope, TextScope)
and update existing scopes (mappings, textObjects, outputPanel,
digraph, commandLine) from default-empty-lambda to two-function
pattern: lambda `fun <T> scope(block: X.() -> T): T` plus
direct-object `fun scope(): X`.

VIM-4158

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 18:31:53 +02:00
Alex Plate
b0a45d47c5 Extend command() API to pass ex-command range to handler
The command() handler now receives startLine and endLine (0-based)
from the resolved ex-command range. Previously the range was received
by the internal CommandAliasHandler but discarded before reaching the
plugin lambda.

Also fix using editor.projectId instead of the VimApiImpl's own
projectId, so the handler resolves the correct editor context.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 18:31:52 +02:00
Alex Plate
696a810ab0 K3-8b: Make methods in non-locking scopes suspend
Per VIM-4144 coroutine audit: methods inside non-locking scopes
(OptionScope, DigraphScope, OutputPanelScope) should be suspend
for RemDev future-proofing. Updated interfaces, implementations,
and extension functions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 18:31:52 +02:00
Alex Plate
7b99c43a98 K3-4+7: Make scope openers and flat VimApi methods suspend
Per VIM-4144 coroutine audit:
- Group 4: Scope-opening functions (editor, forEachEditor, commandLine,
  option, outputPanel, digraph, modalInput) become suspend with suspend
  block parameters
- Group 7: Flat VimApi methods (normal, execute, saveFile, closeFile,
  tab ops, data ops, pattern ops, camel ops) become suspend
- Excluded: properties (mode, tabCount, currentTabIndex), getVariable,
  setVariable, exportOperatorFunction per earlier decisions
- Updated VimApiImpl overrides accordingly
- Fixed extension code (argtextobj, miniai, paragraphmotion,
  replacewithregister, textobjindent) to propagate suspend through
  helper functions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 18:31:51 +02:00
Alex Plate
28a405a9ff K3-3g: Make CommandLine input callback suspend
Per VIM-4144 coroutine audit: handler lambdas should be suspend
for RemDev future-proofing. Implementation uses runBlocking bridge.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 18:31:51 +02:00
Alex Plate
7c66224d17 K3-3f: Make modal input handlers suspend
Per VIM-4144 coroutine audit: handler lambdas should be suspend
for RemDev future-proofing. Implementation uses runBlocking bridge.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 18:31:51 +02:00
Alex Plate
eb9d698f2a K3-3d: Make command handler suspend, add command() to VimInitApi
Per VIM-4144 coroutine audit: handler lambdas should be suspend
for RemDev future-proofing. Also exposes command() at init time.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 18:31:51 +02:00
Alex Plate
0f7ea73c73 K3-3b: Make text object range provider suspend
Per VIM-4144 coroutine audit: handler lambdas should be suspend
for RemDev future-proofing. Implementation uses runBlocking bridge.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 18:31:51 +02:00
Alex Plate
efc5f0140f K3-5': Remove suspend from CommandLineTransaction methods (inside lock)
Per VIM-4144 coroutine audit: methods inside locks must be synchronous.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 18:31:50 +02:00
Alex Plate
f7af2631e9 T010-T014: Remove mode-changing methods from VimApi, use normal() instead
Remove enterInsertMode(), enterNormalMode(), enterVisualMode() from VimApi.
Mode changes should use normal() — e.g., normal("<Esc>"), normal("i"),
normal("v") — matching how real Vim plugins handle mode transitions.

Neither Vim nor Neovim has a direct "set mode" API. All mode changes in
real plugins (surround, exchange, commentary, ReplaceWithRegister) use
normal!, feedkeys(), or :stopinsert. The removed methods used incomplete
internal delegation (changeMode Level 2) that skipped proper entry/exit
setup (marks, strokes, dot-repeat, document listeners).

Also removes the now-unused changeMode() function from Modes.kt.

See VIM-4143 for future proper mode-changing API design.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 18:31:50 +02:00
Alex Plate
f80120db5c T005d: Comment out window management APIs pending IJPL-235369
After setAsCurrentWindow(), getSelectedTextEditor() returns stale data
because the platform propagates the change asynchronously via
flatMapLatest + stateIn, and there is no way to observe when
propagation completes.

Comment out window APIs in VimApi, VimApiImpl, CaretRead, CaretReadImpl.
Add limitation comment to VimWindowGroup. Update EditorContextTest to
call injector.window directly. Track re-enablement in VIM-4138.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 18:31:50 +02:00
Alex Plate
6889ba37c5 T006: Add VimInitApi delegation wrapper for init-time type safety
Introduce VimInitApi as a restricted wrapper around VimApi that exposes
only init-safe methods (getVariable, mappings, textObjects,
exportOperatorFunction). During plugin init() there is no editor context,
so editor operations should not be callable. VimInitApi enforces this at
the type level via delegation rather than inheritance.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 18:31:50 +02:00
Alex Plate
22ad32103e T005b: Replace getFocusedEditor() with getSelectedEditor(projectId)
Use FileEditorManager's selected editor (internal model) instead of
focus-based detection. Falls back to injector.fallbackWindow when
projectId is null (init phase, project loading).

- Add getSelectedEditor(projectId) to VimEditorGroup interface
- Implement in EditorGroup.java using FileEditorManager
- Convert all thinapi scope impls from objects to classes accepting projectId
- Fix exportOperatorFunction to use execution-time editor.projectId
  instead of init-time captured null
- Update all thinapi mock tests to mock fallbackWindow and restore
  injector before tearDown
- Update CaretTransactionTest to use real projectId

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 18:31:49 +02:00
Alex Plate
5d985ef862 T005b: Add projectId parameter to VimApiImpl for editor context
Add projectId to VimApiImpl and propagate through scope implementations.
This is a pre-refactoring step before switching from getFocusedEditor()
to getSelectedEditor() API.

- VimApiImpl: Add projectId parameter (nullable), with KDoc explaining
  that it's null during init and falls back to fallback editor
- Scope implementations: Pass projectId through construction chain
- MappingScopeImpl, TextObjectScopeImpl: Get projectId from editor
  at execution time via editor.projectId
- Tests: Pass null for projectId (no editor context in setup)
- Remove VimApi.kt extension function (no longer needed)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-20 18:31:49 +02:00
1grzyb1
681a44da77 Fix IndexOutOfBoundsException in findBlock when caret is at end of file
The caret can legitimately be at position chars.length (end-of-file), which is valid in IntelliJ but not a valid character index. findBlock and getQuoteRangeNoPSI assumed the caret was always on a character, causing a crash when text objects like a) were used at EOF.

Return null early when pos is out of character index range, since there is no block or quote to match at that position.
2026-03-20 09:14:35 +01:00
1grzyb1
f3b67416cd VIM-4134 Format with = action in split mode
Formatting was broken in split mode and also in monolith mode cursor position restoring didn't match vim actual behaviour. refactored it to work in same way as commenting works
2026-03-18 11:35:37 +01:00
1grzyb1
729cf9be0f Revert "Remove maxMapDepthReached mechanism from KeyHandler"
This reverts commit bddedb0080.
2026-03-17 11:48:35 +01:00
1grzyb1
cbc8249a71 adjust visual marks position after deletion 2026-03-17 11:48:35 +01:00
1grzyb1
cbc446aea7 Fix focus in gi ga nerdtree
Add focusNew parameter to splitWindow to allow NERDTree preview
mappings (gs, gi, ga) to keep focus on the tree.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 14:24:30 +01:00
1grzyb1
eb4a261984 VIM-4134 Synchronize idea jump through topic 2026-03-16 14:24:30 +01:00
1grzyb1
bef0b4c32a VIM-4134 move frontend code to main source set
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 14:24:30 +01:00
1grzyb1
b3ad98ca49 VIM-4134 add vim-engine API changes for split architecture
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 14:24:30 +01:00
1grzyb1
56d05115cc Code style: classloader lookup, import ordering, cleanup
- Use this.javaClass.classLoader instead of object {}.javaClass.classLoader
- Alphabetize imports in VimInjector.kt
- Remove outdated TODO in VimMotionGroupBase.kt
- Fix missing trailing newline in VimPsiService.kt

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 14:24:30 +01:00
1grzyb1
bddedb0080 Remove maxMapDepthReached mechanism from KeyHandler
The field was used to break out of the mapping replay loop when max
recursion depth was hit. This is unnecessary since handleKey already
returns early on max depth, stopping further processing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 14:24:30 +01:00
1grzyb1
d44bf3aa02 Update copyright years to 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 14:24:30 +01:00
1grzyb1
f9cbbad13e Break in case of maximum recursion depth 2026-02-26 08:21:34 +01:00
dependabot[bot]
c16903f23d Bump org.jetbrains:annotations from 26.0.2-1 to 26.1.0
Bumps [org.jetbrains:annotations](https://github.com/JetBrains/java-annotations) from 26.0.2-1 to 26.1.0.
- [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-1...26.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-25 15:43:33 +00:00
dependabot[bot]
5475c410c4 Bump org.junit.vintage:junit-vintage-engine from 6.0.1 to 6.0.3
Bumps [org.junit.vintage:junit-vintage-engine](https://github.com/junit-team/junit-framework) from 6.0.1 to 6.0.3.
- [Release notes](https://github.com/junit-team/junit-framework/releases)
- [Commits](https://github.com/junit-team/junit-framework/compare/r6.0.1...r6.0.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-25 15:43:20 +00:00
1grzyb1
c3925abeaf VIM-4134 test to forbid java.io.File usage 2026-02-17 15:01:02 +01:00
1grzyb1
29067706ec VIM-4134 Replace java.io.File with java.nio.file.Path 2026-02-17 15:01:02 +01:00
1grzyb1
d9c745fd8e VIM-4120 handle ':' in output panel 2026-02-11 12:58:59 +01:00
1grzyb1
9f0ae27440 VIM-4120 close output panel on active editor change 2026-02-11 12:58:59 +01:00
1grzyb1
6591be3617 VIM-4120 remove isPanelActive from VimOutputPanel 2026-02-11 12:58:59 +01:00
1grzyb1
410ac0ff39 VIM-4120 close current output panel when executing command 2026-02-11 12:58:59 +01:00
1grzyb1
d382e0bc26 VIM-4120 single addText method 2026-02-11 12:58:59 +01:00
1grzyb1
d318b935fc VIM-4120 single output method with default message type 2026-02-11 12:58:59 +01:00
1grzyb1
622163194d VIM-4120 removed awt color reference in engine 2026-02-11 12:58:59 +01:00
1grzyb1
34f16f4daf VIM-4120 Rename isActive to isVisible to not leak IJ impl details 2026-02-11 12:58:59 +01:00