MCPcopy
hub / github.com/jesseduffield/lazygit / Safe

Function Safe

pkg/utils/utils.go:68–70  ·  view source on GitHub ↗

Safe will close tcell if a panic occurs so that we don't end up in a malformed terminal state

(f func())

Source from the content-addressed store, hash-verified

66// Safe will close tcell if a panic occurs so that we don't end up in a malformed
67// terminal state
68func Safe(f func()) {
69 _ = SafeWithError(func() error { f(); return nil })
70}
71
72func SafeWithError(f func() error) error {
73 panicking := true

Callers 15

determineMainBranchesMethod · 0.92
GetCommitsMethod · 0.92
GetRemotesMethod · 0.92
GetWorktreesMethod · 0.92
PipeCommandsMethod · 0.92
handleTestModeMethod · 0.92
goEveryMethod · 0.92
RefreshMethod · 0.92
startMethod · 0.92
ReadLinesMethod · 0.92

Calls 1

SafeWithErrorFunction · 0.85

Tested by

no test coverage detected