Commit Graph
3 Commits
Author SHA1 Message Date
1grzyb1 fffcb64bd7 VIM-4351 Stop calling iterateAllChanges, which is protected in 2026.3
2026.3 made iterateAllChanges() of ChangeViewDiffRequestProcessor protected
(IJPL-248190). IdeaVim is compiled against 2026.1, where it is public, so the
build passes, but on 2026.3 the call fails with IllegalAccessError and the
Plugin Verifier reports it.

TreeHandlerDiffRequestProcessor, the processor of the diff preview of the
Commit tool window, keeps iterateAllChanges() public on every version, so the
diff tab files take that class instead of the base one. The modal commit
dialog has its own processor and is left out; jumps recorded in it fall back
to the plain file.
2026-11-06 09:59:01 +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 a8eb19380a Fix(VIM-4351): Bring back the diff editor with <C-O>
A jump only stored the file and line, so a jump recorded in a diff tab
came back as the plain file. Jumps now record where they were made
(JumpSource): a plain editor, or a side of a diff tab.

- The position is kept per side of the diff, not per view. The user can
  switch a tab between side-by-side and unified at any time, so each view
  translates the side's line to its own editor.
- A side that shows the file itself can come back in any other diff of
  the file, or as the plain file once no diff shows it: the file looks
  the same everywhere. A side showing anything else (e.g. the old
  revision) only exists in its own tab, so once that tab is closed its
  jump is dropped from the list and <C-O> goes on to the next one. Such
  jumps are not saved across restarts.
- A tab can show many files one at a time. Which files and how to switch
  depends on the tab, so it is behind DiffTabFiles: "Show Diff" chains
  in the core, and previews that follow a tree of changes (Commit, VCS
  Log, Shelf, staging) in the new optional ideavim-vcs module, because
  ChangeViewDiffRequestProcessor lives in intellij.platform.vcs.impl.
- Selecting the file in the tree is protected before 2026.3, so older
  IDEs only switch the preview and it follows the tree again on the next
  refresh. 2026.3 adds showChange(FilePath), called by reflection until
  it is the minimum version.
- One rule decides which jumps are the same place (Jump.isSamePlaceAs):
  file, line and source. The same line in a diff and in a plain editor
  are two jumps. The ' mark records its jump with the editor's source,
  otherwise it duplicated the diff jump as a plain file one.
- The API keeps seeing only files: jumps added through it are plain file
  jumps.
2026-11-02 10:56:07 +01:00