panesync toggle <- panesync commit
This commit is contained in:
@@ -52,7 +52,6 @@ public record AppConfig(
|
||||
"create_worktree",
|
||||
"pane_sync_toggle",
|
||||
"pane_sync_select",
|
||||
"pane_sync_commit",
|
||||
"paste"
|
||||
);
|
||||
|
||||
@@ -121,7 +120,6 @@ public record AppConfig(
|
||||
Map.entry("create_worktree", KeyBinding.parse("ALT+W")),
|
||||
Map.entry("pane_sync_toggle", KeyBinding.parse("ALT+Y")),
|
||||
Map.entry("pane_sync_select", KeyBinding.parse("SPACE")),
|
||||
Map.entry("pane_sync_commit", KeyBinding.parse("ALT+SHIFT+Y")),
|
||||
Map.entry("paste", KeyBinding.parse("CTRL+SHIFT+V"))
|
||||
)
|
||||
);
|
||||
|
||||
@@ -145,9 +145,16 @@ public final class Compositor {
|
||||
}
|
||||
|
||||
public void togglePaneSync() {
|
||||
if (paneSyncSelectMode || !paneSyncPanes.isEmpty()) {
|
||||
if (paneSyncSelectMode) {
|
||||
paneSyncPanes.clear();
|
||||
paneSyncPanes.addAll(paneSyncSelection);
|
||||
paneSyncSelectMode = false;
|
||||
paneSyncSelection.clear();
|
||||
prunePaneSyncState();
|
||||
layoutVersion++;
|
||||
return;
|
||||
}
|
||||
if (!paneSyncPanes.isEmpty()) {
|
||||
paneSyncPanes.clear();
|
||||
layoutVersion++;
|
||||
return;
|
||||
@@ -171,18 +178,6 @@ public final class Compositor {
|
||||
layoutVersion++;
|
||||
}
|
||||
|
||||
public void commitPaneSyncSelection() {
|
||||
if (!paneSyncSelectMode) {
|
||||
return;
|
||||
}
|
||||
paneSyncPanes.clear();
|
||||
paneSyncPanes.addAll(paneSyncSelection);
|
||||
paneSyncSelection.clear();
|
||||
paneSyncSelectMode = false;
|
||||
prunePaneSyncState();
|
||||
layoutVersion++;
|
||||
}
|
||||
|
||||
public List<TerminalPane> paneSyncPeers(TerminalPane source) {
|
||||
prunePaneSyncState();
|
||||
if (source == null || !paneSyncPanes.contains(source)) {
|
||||
|
||||
@@ -74,7 +74,6 @@ final class TerminalWindow {
|
||||
keyActions.put("create_worktree", this::createWorktreeInEditor);
|
||||
keyActions.put("pane_sync_toggle", compositor::togglePaneSync);
|
||||
keyActions.put("pane_sync_select", compositor::togglePaneSyncSelection);
|
||||
keyActions.put("pane_sync_commit", compositor::commitPaneSyncSelection);
|
||||
keyActions.put("paste", this::pasteFromClipboard);
|
||||
|
||||
StackPane root = new StackPane(compositor.canvas(), compositor.imageOverlay());
|
||||
@@ -169,8 +168,7 @@ final class TerminalWindow {
|
||||
"previous_tab",
|
||||
"next_tab",
|
||||
"pane_sync_toggle",
|
||||
"pane_sync_select",
|
||||
"pane_sync_commit" -> true;
|
||||
"pane_sync_select" -> true;
|
||||
default -> false;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user