Archived
Add c to copy the selected path, split key bar into groups
c copies the absolute directory of the selected submodule via OSC 52. Keys are grouped into navigation (footer left), global (footer right) and submodule (detail pane palette, footer if the pane can't show it). Adds a key reference table to the UX guide. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -36,6 +36,17 @@ func (p *Provider) Fetchable(path string) bool {
|
||||
return ok
|
||||
}
|
||||
|
||||
// Dir returns the absolute directory of path ("" is the superproject),
|
||||
// whether or not it is initialized.
|
||||
func (p *Provider) Dir(path string) string {
|
||||
if path == "" {
|
||||
return p.root
|
||||
}
|
||||
p.mu.RLock()
|
||||
defer p.mu.RUnlock()
|
||||
return p.mods[path].dir
|
||||
}
|
||||
|
||||
// repoDir returns the worktree of path if it is initialized.
|
||||
func (p *Provider) repoDir(path string) (string, bool) {
|
||||
if path == "" {
|
||||
|
||||
@@ -26,6 +26,13 @@ type Watcher interface {
|
||||
Watch(ctx context.Context) <-chan Change
|
||||
}
|
||||
|
||||
// Locator is implemented by providers whose submodules live on the local
|
||||
// disk. Dir returns the absolute directory of path ("" is the superproject),
|
||||
// or "" if it is unknown.
|
||||
type Locator interface {
|
||||
Dir(path string) string
|
||||
}
|
||||
|
||||
// Change reports that the git metadata of a repository changed.
|
||||
type Change struct {
|
||||
Path string // "" is the superproject
|
||||
|
||||
Reference in New Issue
Block a user