Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Unified Diff: Preserve cursor position and active diff when switching to/from 2-way compare

未关闭
#2,947 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
java
领域
desktop, devtools

调研方向

Trace the switch actions in the unified diff toolbar and the 2-way compare editor, then inspect how each presentation determines its active hunk, cursor position, and scroll location. Done means switching in either direction restores the equivalent active hunk, caret location, and visible context instead of resetting to the first diff.

由索引模型根据 Issue 内容生成。

描述

Problem

The unified diff toolbar provides an action to open the diff in the traditional 2-way compare editor. Conversely, the 2-way compare editor provides an action to switch back to the unified diff presentation. However, switching between the two presentations does not preserve context: the cursor position, scroll position, and the currently active diff hunk are lost, and the view always resets to the first diff.

Expected Behavior

When switching between unified diff and 2-way compare editor (in either direction), the following context should be restored in the target presentation:

  • The active diff hunk — the diff closest to the cursor or the one explicitly navigated to should remain selected/focused.
  • The cursor position — the caret should be placed at the equivalent location in the target editor.
  • The scroll position — the target editor should scroll to bring the active diff into view.

This makes switching between presentations a non-destructive operation and allows users to freely alternate between the two views without losing their place.

主要语言
Java
星标
165
派生
174
平均合并
2 天 20 小时
30 天内合并 PR
39

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

eclipse-platform/eclipse.platform 的其他 Issue

查看 eclipse-platform/eclipse.platform 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。