1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-08-07 22:02:56 +03:00

Fix warning QF1003: could use tagged switch

This commit is contained in:
Stefan Haller
2025-06-29 10:39:21 +02:00
parent c7d0aaa786
commit 92093ce56a
2 changed files with 6 additions and 4 deletions

View File

@@ -109,10 +109,11 @@ func (self *ListController) handleLineChangeAux(f func(int), change int) error {
// we're not constantly re-rendering the main view. // we're not constantly re-rendering the main view.
cursorMoved := before != after cursorMoved := before != after
if cursorMoved { if cursorMoved {
if change == -1 { switch change {
case -1:
checkScrollUp(self.context.GetViewTrait(), self.c.UserConfig(), checkScrollUp(self.context.GetViewTrait(), self.c.UserConfig(),
self.context.ModelIndexToViewIndex(before), self.context.ModelIndexToViewIndex(after)) self.context.ModelIndexToViewIndex(before), self.context.ModelIndexToViewIndex(after))
} else if change == 1 { case 1:
checkScrollDown(self.context.GetViewTrait(), self.c.UserConfig(), checkScrollDown(self.context.GetViewTrait(), self.c.UserConfig(),
self.context.ModelIndexToViewIndex(before), self.context.ModelIndexToViewIndex(after)) self.context.ModelIndexToViewIndex(before), self.context.ModelIndexToViewIndex(after))
} }

View File

@@ -185,9 +185,10 @@ func getFileLine(
func formatFileStatus(file *models.File, restColor style.TextStyle) string { func formatFileStatus(file *models.File, restColor style.TextStyle) string {
firstChar := file.ShortStatus[0:1] firstChar := file.ShortStatus[0:1]
firstCharCl := style.FgGreen firstCharCl := style.FgGreen
if firstChar == "?" { switch firstChar {
case "?":
firstCharCl = theme.UnstagedChangesColor firstCharCl = theme.UnstagedChangesColor
} else if firstChar == " " { case " ":
firstCharCl = restColor firstCharCl = restColor
} }