Commit Graph
2227 Commits
Author SHA1 Message Date
Alex Plate 852ea2feb0 Fix(VIM-2974): Delete isOctopusEnabled() and octopus-support files
Step 2/N of removing the octopus handler. Removes the flag and three
support files whose entire purpose was supporting the octopus migration.

- VimApplication interface: drop isOctopusEnabled() method.
- IjVimApplication: drop the override.
- VimEnterHandler.enableOctopus: now a const false, decoupled from the
  deleted interface method. Octopus handler classes (still in this file)
  continue to compile but early-return and pass through to nextHandler.
- Delete KeymapChecker.kt: checked that the keymap had Esc bound to
  ACTION_EDITOR_ESCAPE because octopus owned EditorEscape. No longer
  meaningful with VimShortcutKeyAction handling Esc directly.
- Delete CopilotKeymapCorrector.kt (VIM-3206): removed Copilot's Esc
  shortcut because octopus intercepted EditorEscape. Rider / CLion Nova /
  JBClient have run with octopus disabled for 14+ months without needing
  this workaround.
- Delete EditorHandlersChainLogger.kt: debug logger for the
  editorActionHandler chain, useful only during the octopus era.
- NotificationService / VimNotifications: drop notifyKeymapIssues (only
  caller was KeymapChecker).
- VimListenerManager: drop correctorRequester / keyCheckRequests kicks
  from turnOn / turnOff (flows lived inside the deleted files).
- IdeaVIM.ideavim-frontend.xml: remove postStartupActivity entries for
  the three deleted classes and their keymap listener registrations.

Octopus handler classes in VimEnterHandler.kt and their XML registrations
are still present but now fully unreachable at runtime. They are removed
in subsequent steps.
2026-04-24 17:41:47 +03:00
Alex Plate 3dc0ebd2d1 Fix(VIM-2974): Collapse callers of isOctopusEnabled
Step 1/N of removing the octopus handler. With isOctopusEnabled()
hardcoded to false, the octopus branches in callers are unreachable.
This commit removes them, keeping only the non-octopus path.

- VimShortcutKeyAction: remove the early-return that skipped Enter/Esc
  when octopus was active.
- KeyGroup / VimKeyGroupBase: always register Enter/Esc in
  requiredShortcutKeys (the filter existed only to hand them to octopus).
- InsertEnterAction / SelectEnterAction: drop the forEachNativeCaret
  branch that worked around IDEA-300030 inside the octopus chain; the
  non-octopus processEnter(editor, context) call handles all carets.
- VimTestCase: dispatch Enter/Esc like any other key via
  VimShortcutKeyAction.
- InsertEnterActionTest: remove per-repetition extension masking that
  set up different octopus handler variants.

Octopus handler classes and their XML registrations are still present
but now unused; they are removed in subsequent steps.
2026-04-24 17:41:47 +03:00
1grzyb1 02b4b4969a FIX(VIM-4184): clipboad=unnamed paste bugs on wayland
Use in-memory register when PRIMARY is unavailable due to wayland focus loss and bypass the live PRIMARY read during cisual paste to avoid automatic selection tracking overwriiting the yanked text
2026-04-24 16:03:49 +02:00
Alex PlateandClaude Opus 4.7 45ce2143fe Fix(VIM-4115): NPE in CommandKeyConsumer after plugin disable/enable
Plugin deactivate called fullReset() on the ex panel but left editor
mode and KeyHandlerState.commandLineCommandBuilder untouched. Since
KeyHandler is a singleton, the stale CMD_LINE builder survived a
plugin disable/enable cycle and matched LeaveCommandLineAction on the
next Esc, NPEing when the (already-deactivated) panel was unwrapped.

Call close() before fullReset() so mode, the key handler state, and
the panel are cleared together. Also replace the `!!` at the crash
site with a null-safe branch that logs VIM-4115 and clears the stale
builder, so any other producer of the same desync surfaces via a
Diogen report instead of a crash.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 16:07:48 +03:00
1grzyb1 4dec9a95a4 VIM-186 Support nested comments 2026-04-23 13:57:28 +02:00
1grzyb1 cd5c8e9e17 VIM-186 Use vim license for code wrapper 2026-04-23 13:57:28 +02:00
1grzyb1 64e110f27a VIM-186 Add comment-aware code wrapping for gq/gw 2026-04-23 13:57:28 +02:00
1grzyb1 607920d262 VIM-4207 Add support for update command 2026-04-22 09:07:58 +02:00
1grzyb1 0df627ab19 VIM-1693 Normalize BufRead and BufWrite aliases at registration 2026-04-20 13:40:32 +02:00
1grzyb1 4edc23006e VIM-1693 BufWrite events support 2026-04-20 13:40:32 +02:00
1grzyb1 6e21fbd61a VIM-1693 BufNewFile event support 2026-04-20 13:40:32 +02:00
1grzyb1 1be8183399 VIM-1693 BufRead event support 2026-04-20 13:40:32 +02:00
1grzyb1 f7718b6dd8 VIM-1693 FileType event support 2026-04-20 13:40:32 +02:00
1grzyb1 5cfd1d1fe6 VIM-1693 Focus Gained Lost support 2026-04-20 13:40:32 +02:00
1grzyb1 66ed07e6f5 VIM-1693 WinLeave WinEnter support 2026-04-20 13:40:32 +02:00
1grzyb1 720d8fab40 VIM-1693 fix buf enter leave handling 2026-04-20 13:40:32 +02:00
1grzyb1 6c803e3154 VIM-1693 File pattern matching in autocmd 2026-04-20 13:40:32 +02:00
1grzyb1 38c74d6b9d VIM-1693 Add support for multiple autocmd events 2026-04-20 13:40:32 +02:00
1grzyb1 55a451ac2f VIM-1693 Refactor Insert Leave/Enter to work on listeners 2026-04-20 13:40:32 +02:00
1grzyb1andClaude Opus 4.5 bebce05950 VIM-1693 Support augroup
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-20 13:40:32 +02:00
1grzyb1andClaude Opus 4.5 f86ba678e5 VIM-1693 Fix autocmd grammar
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-20 13:40:32 +02:00
1grzyb1andClaude Opus 4.5 64f2d5b628 VIM-1693 Support for Buffer events
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-20 13:40:32 +02:00
1grzyb1andClaude Opus 4.5 1dcb386b92 VIM-1693 Basic autocmd implementation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-20 13:40:32 +02:00
claude[bot]andClaude Sonnet 4.6 270dc391b5 Fix IndexOutOfBoundsException in CmdCommand when no name is provided with -nargs
Accessing alias[0] without an isEmpty() guard crashed with
IndexOutOfBoundsException when the user typed a :command with only
-nargs specified but no command name (e.g. ":command -nargs=0").

After -nargs processing strips the flag, the remaining argument is
empty, so alias becomes "" and alias[0] throws. Adding alias.isEmpty()
guard treats the missing name as an invalid command name (E183).

Adds a regression test to ensure this case no longer crashes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 16:58:35 +03:00
claude[bot]andClaude Sonnet 4.6 7a31c774d0 Fix CommandBuilder.isEmpty, clone, equals, and hashCode ignoring isRegisterPending
The `isRegisterPending` field was not considered in several methods of
`CommandBuilder`, causing subtle bugs:

- `isEmpty` returned `true` while waiting for a register character
  (after typing `"`), which caused `EditorResetConsumer` to treat the
  partially-built command as if no command was in progress. This could
  trigger an incorrect error indicator (beep) when pressing `<Esc>` to
  cancel register selection in Normal mode, instead of silently resetting.

- `clone()` did not copy `isRegisterPending`, meaning a cloned builder
  would lose pending register state. This is a latent bug affecting the
  unused `AsyncKeyProcessBuilder`.

- `equals()` and `hashCode()` did not include `isRegisterPending`, so
  two builders differing only in pending-register state were considered
  equal, which is incorrect.

Add a regression test that verifies `isEmpty` returns `false` while a
register selection is pending, and `true` after cancelling with Escape.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 16:56:50 +03:00
1grzyb1 e7722bef61 VIM-268 scroll through results using arrow keys 2026-04-14 11:33:32 +02:00
1grzyb1 d28889fc7b VIM-268 edit command autocomplete 2026-04-14 11:33:32 +02:00
1grzyb1 3793458d64 VIM-1158 Add gw to reformat code with preserving the cursor position 2026-04-13 10:29:20 +02:00
1grzyb1 c9234b82f5 VIM-4175 Clear output panel before showing error
Split showing error message into two separate methods. Once that appends the error to the current output panel and the second that clears the output panel before showing the error. So when no search results are found we don;t show hit enter message,
2026-04-09 11:45:56 +02:00
1grzyb1 b9bd523648 Fix visual selection commands failing off-EDT due to nested write-in-read action
Commands entered from Visual mode (e.g. :'<,'>sort) fail because Command.execute wraps selection cleanup in runReadAction, but exitVisualMode nests a runWriteAction inside it, which deadlocks off-EDT. Remove the unnecessary runWriteAction from exitVisualMode since removeSelection only requires EDT, not a write lock.
2026-04-08 13:48:33 +02:00
claude[bot] c946ecde86 Fix NPE when using \/, \?, or \& range without previous search pattern
When using \/, \?, or \& in an Ex command range (e.g., :\/ d) without a
previous search or substitute pattern, the code stored null in the
patterns list and then threw NullPointerException via the !! assertion
in calculateLine1.

Instead, throw the appropriate Vim error eagerly when building the
SearchAddress: E35 for \/ and \? (no previous search), E33 for \& (no
previous substitute). The patterns list is now non-nullable, eliminating
the !! assertion.

Add regression tests that would have caught this NPE.
2026-04-07 12:51:40 +02:00
digitalby b22089f50f fix: Fix `` and \'\' jump commands not working after the IJ Meta+B shortcut 2026-04-07 09:47:42 +02:00
claude[bot] fd3222dd76 Replace java.lang.Long.toHexString with Kotlin's Int.toString(16) in VimFileBase 2026-04-07 09:12:01 +02:00
claude[bot] 11ca10d10a Replace java.lang.Integer.min with kotlin.math.min in GoToLineCommand 2026-04-07 09:12:01 +02:00
claude[bot] fa33b264ba Use ExException.code to identify E130 in DelfunctionCommand
Instead of checking e.message.startsWith("E130"), use the dedicated code
field on ExException, which is set by exExceptionMessage() when the exception
is created. This is more robust since it doesn't depend on message formatting.
2026-04-07 09:12:01 +02:00
1grzyb1 02130a87c9 Exit search with proper defocus and handle escape 2026-04-01 11:48:43 +02: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 PlateandClaude Opus 4.6 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 PlateandClaude Opus 4.6 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 PlateandClaude Opus 4.6 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 PlateandClaude Opus 4.6 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 PlateandClaude Opus 4.6 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 PlateandClaude Opus 4.6 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 PlateandClaude Opus 4.6 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 PlateandClaude Opus 4.6 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 PlateandClaude Opus 4.6 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 PlateandClaude Opus 4.6 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 PlateandClaude Opus 4.6 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 PlateandClaude Opus 4.6 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