'..' parent row in the file list
Synthetic cursor-navigable first row (hidden at /) — Enter/double-click goes to the parent like the toolbar button. Excluded from selection, rename, delete, chmod, and transfers; shown with an up-arrow icon. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -16,12 +16,12 @@ export class FileActionsService {
|
||||
private readonly toast = inject(ToastService);
|
||||
private readonly dialogs = inject(DialogsService);
|
||||
|
||||
/** Selection if non-empty, else the cursor entry. */
|
||||
/** Selection if non-empty, else the cursor entry. Never the ".." parent row. */
|
||||
targets(panel: PanelState): FileEntry[] {
|
||||
const selected = panel.selectedEntries();
|
||||
if (selected.length) return selected;
|
||||
const atCursor = panel.sorted()[panel.cursor()];
|
||||
return atCursor ? [atCursor] : [];
|
||||
return atCursor && atCursor.name !== '..' ? [atCursor] : [];
|
||||
}
|
||||
|
||||
mkdir(panel: PanelState): void {
|
||||
@@ -58,7 +58,7 @@ export class FileActionsService {
|
||||
|
||||
rename(panel: PanelState): void {
|
||||
const entry = panel.sorted()[panel.cursor()];
|
||||
if (!entry) return;
|
||||
if (!entry || entry.name === '..') return;
|
||||
this.dialogs.prompt.set({
|
||||
title: `Rename "${entry.name}"`,
|
||||
initial: entry.name,
|
||||
|
||||
Reference in New Issue
Block a user