дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-09 11:15:40 +02:00
feat(editor): drag an editor tab out to a standalone window (#470)
Dragging an editor tab past the window edge, or choosing Open in New Window from its menu, now opens the file in its own window and closes the tab here. A text file is saved first and a custom document runs its Save / Do not Save / Cancel guard once; if saving or opening fails, the tab stays. The new window is forced even when the project is already open elsewhere, and a file outside the project opens as LightEdit. Dragging out tool windows is not covered. Refs #454 Co-authored-by: a-rookie-of-C-language <[email protected]>
Цей коміт міститься в:
1 джерело
986b0ade58
коміт
2754cf327f
12 files changed
+345
-12
No files matched your search
@@ -0,0 +1,19 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { isOutsideWindow } from "./pointerDrag";
|
||||
|
||||
const viewport = { left: 0, top: 0, right: 1280, bottom: 800 };
|
||||
|
||||
describe("isOutsideWindow", () => {
|
||||
it("treats the viewport interior as inside (issue #454: drag a tab out)", () => {
|
||||
expect(isOutsideWindow(viewport, 640, 400)).toBe(false);
|
||||
expect(isOutsideWindow(viewport, 0, 0)).toBe(false);
|
||||
expect(isOutsideWindow(viewport, 1279, 799)).toBe(false);
|
||||
});
|
||||
|
||||
it("treats every side of the viewport as outside", () => {
|
||||
expect(isOutsideWindow(viewport, -1, 400)).toBe(true);
|
||||
expect(isOutsideWindow(viewport, 1280, 400)).toBe(true);
|
||||
expect(isOutsideWindow(viewport, 640, -1)).toBe(true);
|
||||
expect(isOutsideWindow(viewport, 640, 800)).toBe(true);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Заблокувати користувача