mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-23 00:39:13 +02:00
centralise code for copying to clipboard
This commit is contained in:
@ -178,3 +178,14 @@ func (gui *Gui) fetch(canPromptForCredentials bool) (err error) {
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
func (gui *Gui) handleCopySelectedSideContextItemToClipboard() error {
|
||||
// important to note that this assumes we've selected an item in a side context
|
||||
item := gui.getSideContextSelectedItem()
|
||||
|
||||
if item == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return gui.OSCommand.CopyToClipboard(item.ID())
|
||||
}
|
||||
|
Reference in New Issue
Block a user