1
0
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:
Jesse Duffield
2020-08-22 12:07:03 +10:00
parent 442f6cd854
commit 438abd6003
5 changed files with 36 additions and 20 deletions

View File

@ -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())
}