feat: mirror pane (p), cursor memory, clean up help dialog
- Add Mirror pane keybinding p (for 'Pane'), SSH restored on s - Add session-scoped cursor memory per directory - Fix cursor memory bug: DisplayName() adds trailing / for directories - Fix remote mirror: use active.Path instead of mount.RemotePath - Remove F-key/Mouse/b/c entries from F1 help dialog - Remove Mirror from ShortHelp footer (F-keys only) - Add missing letter-key bindings to help: p, s, a, n, x
This commit is contained in:
parent
c8d6976030
commit
cd877ab584
5 changed files with 201 additions and 18 deletions
|
|
@ -32,6 +32,10 @@ type BrowserPane struct {
|
|||
|
||||
dirHistory []string
|
||||
dirFuture []string
|
||||
|
||||
// cursorMemory remembers the last selected entry display name per directory
|
||||
// within a session. Keyed by directory path. Restored when re-entering a dir.
|
||||
cursorMemory map[string]string
|
||||
}
|
||||
|
||||
type ArchiveMount struct {
|
||||
|
|
@ -193,6 +197,24 @@ func (p *BrowserPane) EnsureVisible(pageSize int) {
|
|||
}
|
||||
}
|
||||
|
||||
func (p *BrowserPane) SaveCursor(dirPath string, entryName string) {
|
||||
if dirPath == "" || entryName == "" {
|
||||
return
|
||||
}
|
||||
if p.cursorMemory == nil {
|
||||
p.cursorMemory = map[string]string{}
|
||||
}
|
||||
p.cursorMemory[dirPath] = entryName
|
||||
}
|
||||
|
||||
// LoadCursor returns the saved entry name for a directory, or empty string.
|
||||
func (p *BrowserPane) LoadCursor(dirPath string) string {
|
||||
if p.cursorMemory == nil {
|
||||
return ""
|
||||
}
|
||||
return p.cursorMemory[dirPath]
|
||||
}
|
||||
|
||||
func (p *BrowserPane) InArchive() bool {
|
||||
return len(p.Archive) > 0
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue