mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2026-11-26 15:19:10 +01:00
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.
60 lines
1.5 KiB
Kotlin
60 lines
1.5 KiB
Kotlin
/*
|
|
* Copyright 2003-2026 The IdeaVim authors
|
|
*
|
|
* Use of this source code is governed by an MIT-style
|
|
* license that can be found in the LICENSE.txt file or at
|
|
* https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
// Version control diff previews for jumps, split out into its own content module so the
|
|
// intellij.platform.vcs.impl dependency does not gate the rest of IdeaVim. When the module is
|
|
// missing, jumps recorded in such previews fall back to the plain file.
|
|
|
|
plugins {
|
|
java
|
|
kotlin("jvm")
|
|
id("org.jetbrains.intellij.platform.module")
|
|
}
|
|
|
|
val kotlinVersion: String by project
|
|
val ideaType: String by project
|
|
val ideaVersion: String by project
|
|
val javaVersion: String by project
|
|
|
|
repositories {
|
|
maven { url = uri("https://cache-redirector.jetbrains.com/repo.maven.apache.org/maven2") }
|
|
intellijPlatform {
|
|
defaultRepositories()
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
compileOnly(project(":"))
|
|
compileOnly(project(":ideavim-common"))
|
|
compileOnly("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion")
|
|
|
|
intellijPlatform {
|
|
var useInstaller = "EAP-SNAPSHOT" !in ideaVersion
|
|
if (ideaType == "RD") {
|
|
useInstaller = false
|
|
}
|
|
|
|
create(ideaType, ideaVersion) { this.useInstaller = useInstaller }
|
|
|
|
bundledModule("intellij.platform.vcs.impl")
|
|
bundledModule("intellij.platform.vcs.impl.shared")
|
|
}
|
|
}
|
|
|
|
java {
|
|
toolchain {
|
|
languageVersion.set(JavaLanguageVersion.of(javaVersion))
|
|
}
|
|
}
|
|
|
|
kotlin {
|
|
jvmToolchain {
|
|
languageVersion.set(JavaLanguageVersion.of(javaVersion))
|
|
}
|
|
}
|