1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2026-05-25 22:52:14 +02:00
Commit Graph

1985 Commits

Author SHA1 Message Date
e9f3954f97 Fix Ex commands not working 2026-05-09 12:25:28 +02:00
bdc81daa91 Make g0/g^/g$ work with soft wraps 2026-05-09 12:25:28 +02:00
08184178e5 Make gj/gk jump over soft wraps 2026-05-09 12:25:28 +02:00
b0e5366a7e Make camelCase motions adjust based on direction of visual selection 2026-05-09 12:25:28 +02:00
468e3d8db8 Stop macro execution after a failed search 2026-05-09 12:25:27 +02:00
3eba0556b2 Revert per-caret registers 2026-05-09 12:25:27 +02:00
dbd2b08521 Update search register when using f/t 2026-05-09 12:22:07 +02:00
279b548d3e Add support for count for visual and line motion surround 2026-05-09 12:22:07 +02:00
e569d9b5d4 Fix(VIM-696): Restore visual mode after undo/redo, and disable incompatible actions 2026-05-09 12:22:06 +02:00
412aa70c23 Respect count with <Action> mappings 2026-05-09 12:22:06 +02:00
0a4bd278ec Revert "Fix(VIM-4108): Use default ANTLR output directory for Gradle 9+ compatibility"
This reverts commit a476583ea3.
2026-05-09 12:21:45 +02:00
Alex Plate
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
1grzyb1
bebce05950 VIM-1693 Support augroup
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-20 13:40:32 +02:00
1grzyb1
f86ba678e5 VIM-1693 Fix autocmd grammar
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-20 13:40:32 +02:00
1grzyb1
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
1grzyb1
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]
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]
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 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