дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-06 18:17:15 +02:00
feat(terminal): drag terminal tabs into editor groups and splits (#5734)
Terminal tabs can be dragged from the Terminal tool window into any editor tab strip position, onto an editor pane or the empty editor area, or onto a pane edge to open a split, keeping the running session (PTY, processes, scrollback, focus). Splitting a terminal editor tab opens a fresh shell in the same working directory instead of showing one session in two panes (editor kinds can declare singleton + splitInput). Co-authored-by: dengliu <[email protected]>
Цей коміт міститься в:
1 джерело
b9a0c66ca6
коміт
707b6fe169
19 files changed
+482
-82
No files matched your search
@@ -19,7 +19,7 @@ export const FILES_DRAG = "application/x-openidea-files";
|
||||
export const REMOTE_FILES_DRAG = "application/x-openidea-remote-files";
|
||||
|
||||
export interface DropTarget {
|
||||
accepts(type: string): boolean;
|
||||
accepts(type: string, data: DragData): boolean;
|
||||
/** The pointer moved over the target. */
|
||||
over(data: DragData, x: number, y: number): void;
|
||||
/** The pointer left the target, or the drag ended elsewhere / was cancelled. */
|
||||
@@ -36,11 +36,11 @@ export function registerDropTarget(el: Element, target: DropTarget): () => void
|
||||
};
|
||||
}
|
||||
|
||||
/** The innermost registered target under (x, y) accepting `type`. */
|
||||
function targetAt(type: string, x: number, y: number): DropTarget | null {
|
||||
/** The innermost registered target under (x, y) accepting `data`. */
|
||||
function targetAt(data: DragData, x: number, y: number): DropTarget | null {
|
||||
for (let el = document.elementFromPoint(x, y); el; el = el.parentElement) {
|
||||
const t = targets.get(el);
|
||||
if (t?.accepts(type)) return t;
|
||||
if (t?.accepts(data.type, data)) return t;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -98,12 +98,12 @@ export function dragSession(data: DragData): DragSession {
|
||||
};
|
||||
return {
|
||||
move(x, y) {
|
||||
enter(targetAt(data.type, x, y));
|
||||
enter(targetAt(data, x, y));
|
||||
current?.over(data, x, y);
|
||||
return !!current;
|
||||
},
|
||||
drop(x, y) {
|
||||
const t = targetAt(data.type, x, y);
|
||||
const t = targetAt(data, x, y);
|
||||
enter(null);
|
||||
t?.drop(data, x, y);
|
||||
return !!t;
|
||||
|
||||
Reference in new issue
Заблокувати користувача