mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
feat(gui): show commit icons
This commit is contained in:
14
pkg/gui/presentation/icons/git_icons.go
Normal file
14
pkg/gui/presentation/icons/git_icons.go
Normal file
@ -0,0 +1,14 @@
|
||||
package icons
|
||||
|
||||
import "github.com/jesseduffield/lazygit/pkg/commands/models"
|
||||
|
||||
const BRANCH_ICON = "\ufb2b" // שׂ
|
||||
const COMMIT_ICON = "\ufc16" // ﰖ
|
||||
const MERGE_COMMIT_ICON = "\ufb2c" // שּׁ
|
||||
|
||||
func IconForCommit(commit *models.Commit) string {
|
||||
if len(commit.Parents) > 1 {
|
||||
return MERGE_COMMIT_ICON
|
||||
}
|
||||
return COMMIT_ICON
|
||||
}
|
11
pkg/gui/presentation/icons/icons.go
Normal file
11
pkg/gui/presentation/icons/icons.go
Normal file
@ -0,0 +1,11 @@
|
||||
package icons
|
||||
|
||||
var isIconEnabled = false
|
||||
|
||||
func IsIconEnabled() bool {
|
||||
return isIconEnabled
|
||||
}
|
||||
|
||||
func SetIconEnabled(showIcons bool) {
|
||||
isIconEnabled = showIcons
|
||||
}
|
Reference in New Issue
Block a user