дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-09 19:25:54 +02:00
feat(vcs): soft-wrap long lines in the diff viewer (#2286)
The diff viewer never soft-wrapped, so a long changed line ran off the right edge. Diff panes now follow Settings › Editor › General › Soft-wrap files for the file, and the viewer's settings menu has a Use Soft Wraps checkbox that overrides it for all diffs and is remembered with the other viewer options. View › Active Editor › Soft-Wrap (editor.toggleSoftWrap) also toggles it when a diff pane has focus. Toggling reconfigures both panes in place, keeping the selection and the scroll position, including aligned split diffs. Closes #2263 Co-authored-by: atlas-u <[email protected]>
Цей коміт міститься в:
13 files changed
+388
-5
No files matched your search
@@ -6,6 +6,7 @@ import { foldEffect, syntaxTree, toggleFold } from "@codemirror/language";
|
||||
import { acceptCompletion, completionStatus } from "@codemirror/autocomplete";
|
||||
import { executeAction, registerActions, type Action } from "@/platform/actions";
|
||||
import { getContext } from "@/platform/context";
|
||||
import { focusedSoftWrapSurface } from "@/workbench/softWrap";
|
||||
import { resetSurfaceFontZoom, stepFocusedSurfaceFontZoom } from "@/workbench/contributions";
|
||||
import { editorController, useGotoLine, useTabs } from "./controller";
|
||||
import {
|
||||
@@ -738,9 +739,13 @@ export function registerEditorActions(): () => void {
|
||||
category: "View",
|
||||
icon: "soft-wrap",
|
||||
keywords: ["word wrap", "line wrap"],
|
||||
when: "textEditorActive",
|
||||
toggled: () => activeSlot()?.model.softWrapOn() ?? false,
|
||||
run: () => activeSlot()?.model.toggleSoftWrap(),
|
||||
when: "textEditorActive || softWrapSurfaceFocus",
|
||||
toggled: () => focusedSoftWrapSurface()?.enabled() ?? activeSlot()?.model.softWrapOn() ?? false,
|
||||
run: () => {
|
||||
const surface = focusedSoftWrapSurface();
|
||||
if (surface) surface.toggle();
|
||||
else activeSlot()?.model.toggleSoftWrap();
|
||||
},
|
||||
},
|
||||
text("code.foldAll", "Collapse All", (v) => collapseAll(v), { category: "Folding", icon: "collapse-all" }),
|
||||
text("code.unfoldAll", "Expand All", (v) => expandAll(v), { category: "Folding", icon: "expand-all" }),
|
||||
|
||||
Reference in new issue
Заблокувати користувача