panesync start + panesync end = panesync toggle
This commit is contained in:
@@ -170,10 +170,9 @@ next_tab = "ALT+SHIFT+L"
|
||||
open_font_selector = "ALT+T"
|
||||
open_scrollback = "ALT+S"
|
||||
create_worktree = "ALT+W"
|
||||
pane_sync_start = "ALT+Y"
|
||||
pane_sync_toggle = "ALT+Y"
|
||||
pane_sync_select = "SPACE"
|
||||
pane_sync_commit = "ALT+SHIFT+Y"
|
||||
pane_sync_end = "ALT+U"
|
||||
paste = "CTRL+SHIFT+V"
|
||||
```
|
||||
|
||||
@@ -192,11 +191,10 @@ paste = "CTRL+SHIFT+V"
|
||||
- `Alt+s`: open the active pane scrollback in `$EDITOR`
|
||||
- `Alt+w`: edit a worktree name, then run `git worktree add <relative_worktree_path>/<name>`
|
||||
from the previously focused pane's working directory
|
||||
- `Alt+y`: enter pane-sync selection mode
|
||||
- `Alt+y`: enter pane-sync selection mode, cancel selection mode, or stop an active pane sync
|
||||
- `Space`: toggle the focused pane in the sync set while pane-sync selection mode is active
|
||||
- `Alt+Shift+y`: commit the current pane-sync selection; input typed or pasted into any synced
|
||||
pane is mirrored to the other synced panes
|
||||
- `Alt+u`: end pane sync
|
||||
- `Ctrl+Shift+v`: paste
|
||||
- Font default: `JetBrainsMono Nerd Font`
|
||||
- Kitty graphics protocol parsing is enabled by default
|
||||
|
||||
@@ -41,8 +41,7 @@ next_tab = "ALT+SHIFT+L"
|
||||
open_font_selector = "ALT+T"
|
||||
open_scrollback = "ALT+S"
|
||||
create_worktree = "ALT+W"
|
||||
pane_sync_start = "ALT+Y"
|
||||
pane_sync_toggle = "ALT+Y"
|
||||
pane_sync_select = "SPACE"
|
||||
pane_sync_commit = "ALT+SHIFT+Y"
|
||||
pane_sync_end = "ALT+U"
|
||||
paste = "CTRL+SHIFT+V"
|
||||
|
||||
@@ -50,10 +50,9 @@ public record AppConfig(
|
||||
"open_font_selector",
|
||||
"open_scrollback",
|
||||
"create_worktree",
|
||||
"pane_sync_start",
|
||||
"pane_sync_toggle",
|
||||
"pane_sync_select",
|
||||
"pane_sync_commit",
|
||||
"pane_sync_end",
|
||||
"paste"
|
||||
);
|
||||
|
||||
@@ -120,10 +119,9 @@ public record AppConfig(
|
||||
Map.entry("open_font_selector", KeyBinding.parse("ALT+T")),
|
||||
Map.entry("open_scrollback", KeyBinding.parse("ALT+S")),
|
||||
Map.entry("create_worktree", KeyBinding.parse("ALT+W")),
|
||||
Map.entry("pane_sync_start", KeyBinding.parse("ALT+Y")),
|
||||
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("pane_sync_end", KeyBinding.parse("ALT+U")),
|
||||
Map.entry("paste", KeyBinding.parse("CTRL+SHIFT+V"))
|
||||
)
|
||||
);
|
||||
|
||||
@@ -144,8 +144,15 @@ public final class Compositor {
|
||||
return paneSyncSelectMode;
|
||||
}
|
||||
|
||||
public void startPaneSyncSelection() {
|
||||
if (activePane() == null || paneSyncSelectMode) {
|
||||
public void togglePaneSync() {
|
||||
if (paneSyncSelectMode || !paneSyncPanes.isEmpty()) {
|
||||
paneSyncSelectMode = false;
|
||||
paneSyncSelection.clear();
|
||||
paneSyncPanes.clear();
|
||||
layoutVersion++;
|
||||
return;
|
||||
}
|
||||
if (activePane() == null) {
|
||||
return;
|
||||
}
|
||||
paneSyncSelectMode = true;
|
||||
@@ -176,16 +183,6 @@ public final class Compositor {
|
||||
layoutVersion++;
|
||||
}
|
||||
|
||||
public void endPaneSync() {
|
||||
if (!paneSyncSelectMode && paneSyncSelection.isEmpty() && paneSyncPanes.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
paneSyncSelectMode = false;
|
||||
paneSyncSelection.clear();
|
||||
paneSyncPanes.clear();
|
||||
layoutVersion++;
|
||||
}
|
||||
|
||||
public List<TerminalPane> paneSyncPeers(TerminalPane source) {
|
||||
prunePaneSyncState();
|
||||
if (source == null || !paneSyncPanes.contains(source)) {
|
||||
|
||||
@@ -72,10 +72,9 @@ final class TerminalWindow {
|
||||
keyActions.put("open_font_selector", this::openFontSelector);
|
||||
keyActions.put("open_scrollback", this::openScrollbackInEditor);
|
||||
keyActions.put("create_worktree", this::createWorktreeInEditor);
|
||||
keyActions.put("pane_sync_start", compositor::startPaneSyncSelection);
|
||||
keyActions.put("pane_sync_toggle", compositor::togglePaneSync);
|
||||
keyActions.put("pane_sync_select", compositor::togglePaneSyncSelection);
|
||||
keyActions.put("pane_sync_commit", compositor::commitPaneSyncSelection);
|
||||
keyActions.put("pane_sync_end", compositor::endPaneSync);
|
||||
keyActions.put("paste", this::pasteFromClipboard);
|
||||
|
||||
StackPane root = new StackPane(compositor.canvas(), compositor.imageOverlay());
|
||||
@@ -169,9 +168,9 @@ final class TerminalWindow {
|
||||
"next_floating",
|
||||
"previous_tab",
|
||||
"next_tab",
|
||||
"pane_sync_toggle",
|
||||
"pane_sync_select",
|
||||
"pane_sync_commit",
|
||||
"pane_sync_end" -> true;
|
||||
"pane_sync_commit" -> true;
|
||||
default -> false;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user