Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e253928
feat: add multi pane view
bajrangCoder Jun 28, 2026
e047090
add ability to drag one tab from one pane to other
bajrangCoder Jun 29, 2026
f35b1c2
add vertical pane support and keybinds and bug fixes
bajrangCoder Jun 29, 2026
97add32
fix resize pane empty space
bajrangCoder Jun 29, 2026
3a54543
fix: issues and bugs
bajrangCoder Jun 29, 2026
701d1e6
fixed pane focus lifecycle
bajrangCoder Jun 29, 2026
c9b22f4
fix
bajrangCoder Jun 29, 2026
e7f4d09
fix debounce timer and load related issue
bajrangCoder Jun 29, 2026
538d968
fix
bajrangCoder Jun 30, 2026
8d9eaeb
fix the drag snap-back
bajrangCoder Jun 30, 2026
6278f4d
fix
bajrangCoder Jun 30, 2026
38e3de7
fix tab cleanup
bajrangCoder Jun 30, 2026
358a436
Merge branch 'main' into feat/multi-pane-view
bajrangCoder Jun 30, 2026
76035a5
added cleanup
bajrangCoder Jun 30, 2026
140a706
fix
bajrangCoder Jun 30, 2026
2c78d6d
fixed bunch of issues introduced accidently
bajrangCoder Jun 30, 2026
32b41d3
remove double doc sync and add Ctrl-touch for multi cursor too
bajrangCoder Jun 30, 2026
7cb916f
correctly drop at carret
bajrangCoder Jul 1, 2026
a55de81
fix and use doc cache instead of direct doc.toString
bajrangCoder Jul 1, 2026
449b701
cleanup
bajrangCoder Jul 1, 2026
5669235
Merge branch 'main' into feat/multi-pane-view
bajrangCoder Jul 1, 2026
9109197
Merge branch 'main' into feat/multi-pane-view
bajrangCoder Jul 1, 2026
35da611
Merge branch 'main' into feat/multi-pane-view
bajrangCoder Jul 1, 2026
1c478aa
fix untiled.txt close the pane and remove ctrl-touch things
bajrangCoder Jul 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions src/cm/commandRegistry.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,56 @@ function registerCoreCommands() {
return true;
},
});
addCommand({
name: "newPane",
description: "Create new editor pane",
readOnly: true,
requiresView: false,
run() {
acode.exec("new-pane");
return true;
},
});
addCommand({
name: "moveTabToNewPane",
description: "Move current tab to new pane",
readOnly: true,
requiresView: false,
run() {
acode.exec("move-tab-to-new-pane");
return true;
},
});
addCommand({
name: "closePane",
description: "Close active editor pane",
readOnly: true,
requiresView: false,
run() {
acode.exec("close-pane");
return true;
},
});
addCommand({
name: "focusNextPane",
description: "Focus next editor pane",
readOnly: true,
requiresView: false,
run() {
acode.exec("focus-next-pane");
return true;
},
});
addCommand({
name: "focusPreviousPane",
description: "Focus previous editor pane",
readOnly: true,
requiresView: false,
run() {
acode.exec("focus-previous-pane");
return true;
},
});
addCommand({
name: "closeAllTabs",
description: "Close all tabs",
Expand Down
18 changes: 18 additions & 0 deletions src/cm/editorUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,24 @@ export interface ScrollPosition {
scrollLeft: number;
}

const docTextCache = new WeakMap<object, string>();

/**
* CodeMirror Text documents are immutable, so the full string can be cached
* per document object and reused across compatibility/plugin reads.
*/
export function getDocText(
doc: { toString(): string } | string | null | undefined,
): string {
if (!doc) return "";
if (typeof doc !== "object" && typeof doc !== "function") return String(doc);
const cached = docTextCache.get(doc);
if (cached !== undefined) return cached;
const text = doc.toString();
docTextCache.set(doc, text);
return text;
}

/**
* Get all folded ranges from CodeMirror editor state
*/
Expand Down
3 changes: 2 additions & 1 deletion src/cm/lsp/references.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
openReferencesTab,
showReferencesPanel,
} from "components/referencesPanel";
import { getDocText } from "cm/editorUtils";
import settings from "lib/settings";

interface Position {
Expand Down Expand Up @@ -61,7 +62,7 @@ async function fetchLineText(uri: string, line: number): Promise<string> {
}
}
if (typeof doc.toString === "function") {
const content = doc.toString();
const content = getDocText(doc as { toString(): string });
const lines = content.split("\n");
if (lines[line] !== undefined) {
return lines[line];
Expand Down
7 changes: 6 additions & 1 deletion src/components/sidebar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,12 @@ function create($container, $toggler) {
root.style.width = `calc(100% - ${width}px)`;
clearTimeout(setWidthTimeout);
setWidthTimeout = setTimeout(() => {
editorManager?.editor?.resize(true);
const editor = editorManager?.editor;
if (typeof editor?.resize === "function") {
editor.resize(true);
} else {
editor?.requestMeasure?.();
}
}, 300);
}

Expand Down
Loading