This commit is contained in:
Query&mut NinjaStyle, &Ryder 2025-05-05 18:54:50 +00:00 committed by GitHub
commit d9dbdd48a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2,6 +2,7 @@ package presentation
import ( import (
"fmt" "fmt"
"regexp"
"strings" "strings"
"time" "time"
@ -15,7 +16,6 @@ import (
"github.com/jesseduffield/lazygit/pkg/gui/style" "github.com/jesseduffield/lazygit/pkg/gui/style"
"github.com/jesseduffield/lazygit/pkg/theme" "github.com/jesseduffield/lazygit/pkg/theme"
"github.com/jesseduffield/lazygit/pkg/utils" "github.com/jesseduffield/lazygit/pkg/utils"
"github.com/kyokomi/emoji/v2"
"github.com/samber/lo" "github.com/samber/lo"
"github.com/sasha-s/go-deadlock" "github.com/sasha-s/go-deadlock"
"github.com/stefanhaller/git-todo-parser/todo" "github.com/stefanhaller/git-todo-parser/todo"
@ -37,6 +37,12 @@ type bisectBounds struct {
oldIndex int oldIndex int
} }
func stripEmojis(text string) string {
// This regex matches most common emoji patterns
re := regexp.MustCompile(`[\x{1F600}-\x{1F64F}]|[\x{1F300}-\x{1F5FF}]|[\x{1F680}-\x{1F6FF}]|[\x{2600}-\x{26FF}]|[\x{2700}-\x{27BF}]`)
return re.ReplaceAllString(text, "")
}
func GetCommitListDisplayStrings( func GetCommitListDisplayStrings(
common *common.Common, common *common.Common,
commits []*models.Commit, commits []*models.Commit,
@ -358,6 +364,7 @@ func displayCommit(
bisectStatus BisectStatus, bisectStatus BisectStatus,
bisectInfo *git_commands.BisectInfo, bisectInfo *git_commands.BisectInfo,
) []string { ) []string {
_ = parseEmoji
bisectString := getBisectStatusText(bisectStatus, bisectInfo) bisectString := getBisectStatusText(bisectStatus, bisectInfo)
hashString := "" hashString := ""
@ -414,9 +421,8 @@ func displayCommit(
if commit.Action == todo.UpdateRef { if commit.Action == todo.UpdateRef {
name = strings.TrimPrefix(name, "refs/heads/") name = strings.TrimPrefix(name, "refs/heads/")
} }
if parseEmoji {
name = emoji.Sprint(name) name = stripEmojis(name) // Strip emojis
}
mark := "" mark := ""
if commit.Status == models.StatusConflicted { if commit.Status == models.StatusConflicted {