Commit Graph
37 Commits
Author SHA1 Message Date
1grzyb1 6650aef408 VIM-4370 Undo one IdeaVim command at a time in Rider split mode
Rider has no speculative undo, so the undo stack is on the backend. The
backend applies the frontend's changes as undo-transparent patches,
merges all of them into one undo step, and undoes all transparent steps
on top of the stack at once. So one `u` undid every change IdeaVim made
since the backend's own last command, e.g. both deletions after `x x`.

Before each command that follows a change, the frontend now asks the
backend to end the undo step. If the step has only the frontend's
changes, the backend merges a no-op non-transparent action into it first,
so it's undone on its own.

It relies on how the platform merges undo steps, so it's a workaround
until RIDER-145069 is fixed.
2026-11-09 10:59:04 +01:00
1grzyb1 42bb2392df VIM-4370 Undo an Insert mode change with one u in Rider split mode
Rider and CLion have no speculative undo, so the undo stack is on the
backend and `u` on the frontend ran `$Undo` there. With caret movement
not undo-transparent, the platform spends the first undo of a group only
on restoring the caret when it moved after the change. Leaving Insert
mode moves the caret back by one, so the first `u` did nothing.

Run undo/redo on the backend through ChangeRemoteApi with
`ide.undo.transparent.caret.movement` on, as the monolith does. Frontends
with speculative undo keep using `$Undo`.
2026-11-09 10:59:04 +01:00
1grzyb1 fc7140c247 VIM-2524 Indent the line emptied by cc in Rider
The indent was only worked out where the language has a formatter. Rider has
no formatter for C# on the frontend (formatting lives in the ReSharper
backend), so cc and S left the line with its old indent.

Rider's frontend has a LineIndentProvider that works out the C# indent, but
also a dummy one answering DO_NOT_ADJUST, and CodeStyle.getLineIndent only
asks the first provider of a language. Ask all of them and take the first
indent, and fall back to the formatter only if none of them answers.
2026-11-03 10:04:35 +01:00
1grzyb1 ef4174295f VIM-4365 Move AIR support into an optional ideavim-air module
The AIR prompt was recognised and handled in several places of the core
by AIR's internal key names and action ids. Everything AIR-specific now
lives in the ideavim-air module, which only loads with the AIR plugin and
implements the new ChatInputProvider extension point. The core asks the
provider whether an editor is a chat prompt, whether the chat owns a key,
and which action breaks a line.

The line-break action is now also used by processEnter, so <C-J>, <C-M>
and mappings ending in <CR> break the line in the AIR prompt. Before,
they ran the platform's Enter action, which AIR turns into a no-op there.
2026-11-02 11:29:02 +01:00
1grzyb1 604d4ca6df VIM-4351 Match the files of a chain of changes by path, stop <C-O> reporting an error
A "Show Diff" tab of changes in version control was matched by the names of
its diffs, which only some diffs name after the path of the file. Its
changes know the path, through PresentableChange, which lives in
intellij.platform.vcs.impl. ideavim-vcs depends on it already, so it now
knows such chains too, and the providers come before the match by name,
which stays for chains of other diffs.

<C-O> to another file moves the caret in the other editor and then
returned Motion.Error, which made IdeaVim report an error after a jump that
worked. It returns Motion.NoMotion now. Marks, the tag stack and the change
list do the same when they go to another file, and are left for later.
2026-11-02 10:56:07 +01:00
1grzyb1 39e065bb1f VIM-4351 Bring back the diff editor after Go to Declaration of the IDE
Cmd+B and Ctrl+Click run the IDE's Go to Declaration, which IdeaVim doesn't
see, so only the IDE's navigation history records them, mirrored into the
jump list by 'ideaunifyjumps'. The history knows a diff tab only as a
whole, without a caret, so JumpsListener dropped such places.

For a place in an open diff tab, JumpsListener now asks the tab for its
caret on the side the user works in. Navigating away to another file
leaves that caret where it was, so it is the place the IDE recorded.
JumpInfo carries the diff source over RPC. JumpsListener runs on the
backend, where diff tabs live in split mode too.

A removal is not mirrored for a diff tab: its caret says nothing about the
older place the IDE drops.

The tests wait before navigating like the IDE: for a short while after any
jump, the jump list ignores the IDE's navigation, which would otherwise
mirror IdeaVim's own jumps a second time. That window also drops the IDE's
places mirrored from its history, which is left as it is here. The
split-mode test project gets a module with `src` as a source root, so that
Java resolves the declaration.
2026-11-02 10:56:07 +01:00
1grzyb1 e3c95eb14b Fix(VIM-4351): Bring back the diff editor with <C-O> in split mode
In split mode the diff tab lives on the backend: the frontend only shows
it, with editors that mirror the backend's ones. IdeaVim runs on the
frontend, so it found no diff tab and fell back to the plain file.

- The diff code moved to ideavim-common, so it runs on both sides, and
  uses only the platform: the backend has no IdeaVim injector. The
  frontend looks for a local diff tab first (monolith), and otherwise
  asks the backend through JumpRemoteApi. The mirrored editors share the
  backend editors' EditorId, so the backend finds the real diff editor.
- On the backend, split mode keeps a diff tab in its own file editor
  (DiffRequestDirectTransferEditor), which exposes the diff only as a
  `processor` property. There is no public API for it, so it is read by
  reflection, with the old behaviour as the fallback.
- A write action can't wait for the backend, so a jump recorded during
  one stays a plain file jump, as before.
- The left side of a diff from version control has a document with a
  LightVirtualFile, so it counted as "in the file": such a jump was saved
  across restarts and came back as the plain file at the wrong line.
  Only a file on disk counts now. The tests use such a left side too.

Two jump bugs showed up on the way, not specific to diffs:

- <C-O> could stay where the caret already was, when the IDE had already
  recorded that place as the newest jump (e.g. after clicking another
  file in the Commit tool window). Leaving the newest end of the jump
  list now adds the place of the caret first, which replaces the older
  jump to it, and then goes back, as Vim does.
- In split mode, jumping to a file that wasn't open didn't place the
  caret: selectEditor looked for the frontend editor right after the RPC,
  before the frontend has it, so the file opened wherever it was last
  left. The backend now opens the file at the position, for jumps, marks,
  the tag stack, the change list and quickfix.
2026-11-02 10:56:07 +01:00
1grzyb1 37cac8d930 VIM-2342 Don't open Ggrep matches twice in symlinked repositories
git rev-parse --show-toplevel resolves symlinks, so in /tmp on macOS matches pointed to /private/tmp and opened a second tab for files that were already open
2026-10-26 09:41:18 +01:00
1grzyb1 97ae43ee55 VIM-2342 Add copen command
Shows the quickfix list in a read-only window that follows the current item. Enter on a line jumps to that item in the window copen was run from
2026-10-26 09:41:18 +01:00
1grzyb1 38926e7a3f VIM-2342 Remove unnecessary git version process call 2026-10-26 09:41:18 +01:00
1grzyb1 78b82c395f VIM-2342 Add fugitive extension with grep command 2026-10-26 09:41:18 +01:00
1grzyb1andClaude Opus 5.5 27befce788 Drop dependencies on the removed Rhizome kernel modules
IJPL-257728 removed intellij.platform.kernel, kernel.impl and kernel.backend
from the platform. On builds from master, IdeaVIM.ideavim-backend and both
bookmark backend modules declared a dependency on intellij.platform.kernel.backend,
so the platform skipped them silently. None of the remoteApiProvider extensions
got registered, and Commentary, Format and the other RPC calls failed with
"No remote API found".

IdeaVim doesn't use any class from these modules. The backend-only loading in
split mode is still provided by the dependency on intellij.platform.backend.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 11:11:46 +02:00
1grzyb1 06778f5380 Generate ideavim_extensions.json only in root module 2026-10-13 12:16:43 +02:00
1grzyb1 738b73417f Load intellij.platform.rpc dependency from an optional module
intellij.platform.rpc doesn't exist in 2025.3, is embedded in the core
classloader in 2026.1-2026.2 and is a standalone module since 2026.3.
Declaring it as a dependency of the embedded ideavim-common module disables
the whole plugin on 2025.3 and breaks the 2025.3 build.

Move the dependency to a new optional ideavim-rpc module that provides
VimRemoteApiResolver via the IdeaVIM.remoteApiResolver extension point.
When the module is skipped (2025.3), fall back to calling
RemoteApiProviderService from the core classloader.
2026-10-13 12:16:43 +02:00
1grzyb1 19925409d5 VIM-4340 add standalone rpc module 2026-10-12 10:28:10 +02:00
1grzyb1 1e3c671c0c VIM-2524 calculate indent after cc
set proper indent after performing cc. previously we were just using that was already set not from code style
2026-10-09 09:49:32 +02:00
1grzyb1 6f48fd9903 Complete action command ideavimrc file 2026-10-05 12:04:26 +02:00
Grzybek 5bc0344547 VIM-4333 Fix auto-indent handling in clion (#2090)
use directly formatter for clion to indent lines otherwise it was formatting whole file
2026-09-30 08:38:08 +00:00
1grzyb1 5ee595aac4 VIM-3058 alternate file name register 2026-08-27 09:19:18 +02:00
1grzyb1 b7219ff413 VIM-1266 file name from percent register
Implement % register that returns current file name
2026-08-21 08:49:52 +02:00
1grzyb1 61e98f9381 Fix opening what's new in split mode
In split mode resources are loaded from backend
2026-08-04 10:12:42 +02:00
1grzyb1 5d51c71a68 VIM-989 Implement write command with file argument
Now when argument is passed to `:w {arg}` content will be saved to newly created file
2026-07-16 08:30:23 +02:00
1grzyb1 ef4f29ebc0 Run tests for EAP on java 25 2026-07-09 11:57:53 +02:00
Matt Ellis f9249c4371 Add 'langremap' option, not yet applied
Also supports 'langnoremap' for backwards compatibility with Vim
2026-06-24 08:40:52 +02:00
Matt Ellis 65ebf53d34 Add 'langmap' option, not yet applied 2026-06-24 08:40:52 +02:00
1grzyb1 95128f407b VIM-4235 use native saveFile action in :w
using FilerometeApi didn't trigger reformat on save action in splitmode/rider so I chagned it to native action execution in on save
2026-05-22 08:42:52 +00:00
Matt Ellis d5e917c5c6 Add histdel() history function 2026-05-19 12:51:26 +03:00
Matt Ellis 86aa74550a Add histnr() history function 2026-05-19 12:51:26 +03:00
Matt Ellis 97da421eec Add histget() history function 2026-05-19 12:51:26 +03:00
Matt Ellis 03a44d9855 Add histadd() history function 2026-05-19 12:51:26 +03:00
Matt Ellis 6039227534 Add hasmapto() mapping function 2026-05-15 17:25:58 +03:00
Matt Ellis bce624cb73 Add maplist() mapping function 2026-05-15 17:25:58 +03:00
Matt Ellis c608161b0d Add mapcheck() mapping function 2026-05-15 17:25:58 +03:00
Matt Ellis 00f1021f25 Add maparg() mapping function 2026-05-15 17:25:58 +03:00
1grzyb1 5d6622b77e Use only jbr cache repository 2026-05-13 09:48:47 +00:00
1grzyb1 2b4a4eeff4 Add jbr cache repo per module 2026-05-13 08:45:11 +00:00
1grzyb1 7bf2c9196d Align content module names with plugin.xml so 2026.1 finds them 2026-05-12 08:06:28 +00:00