mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 20:36:03 +02:00
notify user upon copying something to clipboard
This commit is contained in:
parent
a3dfcd5a95
commit
3e13936e08
7 changed files with 28 additions and 4 deletions
|
@ -84,7 +84,7 @@ func (m *statusManager) getStatusString() string {
|
||||||
return topStatus.message
|
return topStatus.message
|
||||||
}
|
}
|
||||||
|
|
||||||
func (gui *Gui) raiseToastStatus(message string) {
|
func (gui *Gui) raiseToast(message string) {
|
||||||
gui.statusManager.addToastStatus(message)
|
gui.statusManager.addToastStatus(message)
|
||||||
|
|
||||||
gui.renderAppStatus()
|
gui.renderAppStatus()
|
||||||
|
|
|
@ -107,7 +107,7 @@ func (gui *Gui) handleCopyPullRequestURLPress(g *gocui.Gui, v *gocui.View) error
|
||||||
return gui.surfaceError(err)
|
return gui.surfaceError(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
gui.raiseToastStatus(gui.Tr.PullRequestURLCopiedToClipboard)
|
gui.raiseToast(gui.Tr.PullRequestURLCopiedToClipboard)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -589,5 +589,12 @@ func (gui *Gui) handleCopySelectedCommitMessageToClipboard() error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return gui.surfaceError(err)
|
return gui.surfaceError(err)
|
||||||
}
|
}
|
||||||
return gui.OSCommand.CopyToClipboard(message)
|
|
||||||
|
if err := gui.OSCommand.CopyToClipboard(message); err != nil {
|
||||||
|
return gui.surfaceError(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
gui.raiseToast(gui.Tr.CommitMessageCopiedToClipboard)
|
||||||
|
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package gui
|
package gui
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"math"
|
"math"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
@ -191,5 +192,13 @@ func (gui *Gui) handleCopySelectedSideContextItemToClipboard() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return gui.OSCommand.CopyToClipboard(itemId)
|
if err := gui.OSCommand.CopyToClipboard(itemId); err != nil {
|
||||||
|
return gui.surfaceError(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
truncatedItemId := utils.TruncateWithEllipsis(strings.ReplaceAll(itemId, "\n", " "), 50)
|
||||||
|
|
||||||
|
gui.raiseToast(fmt.Sprintf("'%s' %s", truncatedItemId, gui.Tr.LcCopiedToClipboard))
|
||||||
|
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -382,5 +382,7 @@ func dutchTranslationSet() TranslationSet {
|
||||||
BranchNotFoundTitle: "Branch niet gevonden",
|
BranchNotFoundTitle: "Branch niet gevonden",
|
||||||
BranchNotFoundPrompt: "Branch niet gevonden. Creëer een nieuwe branch genaamd",
|
BranchNotFoundPrompt: "Branch niet gevonden. Creëer een nieuwe branch genaamd",
|
||||||
PullRequestURLCopiedToClipboard: "Pull-aanvraag-URL gekopieerd naar klembord",
|
PullRequestURLCopiedToClipboard: "Pull-aanvraag-URL gekopieerd naar klembord",
|
||||||
|
CommitMessageCopiedToClipboard: "Commit message gekopieerd naar klembord",
|
||||||
|
LcCopiedToClipboard: "gekopieerd naar klembord",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -431,6 +431,8 @@ type TranslationSet struct {
|
||||||
NavigationTitle string
|
NavigationTitle string
|
||||||
PushingTagStatus string
|
PushingTagStatus string
|
||||||
PullRequestURLCopiedToClipboard string
|
PullRequestURLCopiedToClipboard string
|
||||||
|
CommitMessageCopiedToClipboard string
|
||||||
|
LcCopiedToClipboard string
|
||||||
}
|
}
|
||||||
|
|
||||||
const englishReleaseNotes = `## lazygit 0.23.2 Release Notes
|
const englishReleaseNotes = `## lazygit 0.23.2 Release Notes
|
||||||
|
@ -932,5 +934,7 @@ func englishTranslationSet() TranslationSet {
|
||||||
NavigationTitle: "List Panel Navigation",
|
NavigationTitle: "List Panel Navigation",
|
||||||
PushingTagStatus: "pushing tag",
|
PushingTagStatus: "pushing tag",
|
||||||
PullRequestURLCopiedToClipboard: "Pull request URL copied to clipboard",
|
PullRequestURLCopiedToClipboard: "Pull request URL copied to clipboard",
|
||||||
|
CommitMessageCopiedToClipboard: "Commit message copied to clipboard",
|
||||||
|
LcCopiedToClipboard: "copied to clipboard",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -252,5 +252,7 @@ func polishTranslationSet() TranslationSet {
|
||||||
BranchNotFoundTitle: "Branch not found",
|
BranchNotFoundTitle: "Branch not found",
|
||||||
BranchNotFoundPrompt: "Branch not found. Create a new branch named",
|
BranchNotFoundPrompt: "Branch not found. Create a new branch named",
|
||||||
PullRequestURLCopiedToClipboard: "URL żądania ściągnięcia skopiowany do schowka",
|
PullRequestURLCopiedToClipboard: "URL żądania ściągnięcia skopiowany do schowka",
|
||||||
|
CommitMessageCopiedToClipboard: "Commit message skopiowany do schowka",
|
||||||
|
LcCopiedToClipboard: "skopiowany do schowka",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue