mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-15 01:34:26 +02:00
chore: remove UNKNOWN_VIEW_ERROR_MSG
This commit is contained in:
@ -1,3 +0,0 @@
|
|||||||
package gui
|
|
||||||
|
|
||||||
const UNKNOWN_VIEW_ERROR_MSG = "unknown view"
|
|
@ -85,7 +85,7 @@ func (gui *Gui) layout(g *gocui.Gui) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_, err := setViewFromDimensions(context.GetViewName(), context.GetWindowName())
|
_, err := setViewFromDimensions(context.GetViewName(), context.GetWindowName())
|
||||||
if err != nil && err.Error() != UNKNOWN_VIEW_ERROR_MSG {
|
if err != nil && !gocui.IsUnknownView(err) {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -98,7 +98,7 @@ func (gui *Gui) layout(g *gocui.Gui) error {
|
|||||||
|
|
||||||
for _, context := range gui.TransientContexts() {
|
for _, context := range gui.TransientContexts() {
|
||||||
view, err := gui.g.View(context.GetViewName())
|
view, err := gui.g.View(context.GetViewName())
|
||||||
if err != nil && err.Error() != UNKNOWN_VIEW_ERROR_MSG {
|
if err != nil && !gocui.IsUnknownView(err) {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
view.Visible = gui.getViewNameForWindow(context.GetWindowName()) == context.GetViewName()
|
view.Visible = gui.getViewNameForWindow(context.GetWindowName()) == context.GetViewName()
|
||||||
|
@ -117,7 +117,7 @@ func (gui *Gui) createAllViews() error {
|
|||||||
var err error
|
var err error
|
||||||
for _, mapping := range gui.orderedViewNameMappings() {
|
for _, mapping := range gui.orderedViewNameMappings() {
|
||||||
*mapping.viewPtr, err = gui.prepareView(mapping.name)
|
*mapping.viewPtr, err = gui.prepareView(mapping.name)
|
||||||
if err != nil && err.Error() != UNKNOWN_VIEW_ERROR_MSG {
|
if err != nil && !gocui.IsUnknownView(err) {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -298,7 +298,7 @@ func (self *app) layout(g *gocui.Gui) error {
|
|||||||
g.FgColor = gocui.ColorGreen
|
g.FgColor = gocui.ColorGreen
|
||||||
listView, err := g.SetView("list", 0, 0, maxX-1, maxY-descriptionViewHeight-keybindingsViewHeight-editorViewHeight-1, 0)
|
listView, err := g.SetView("list", 0, 0, maxX-1, maxY-descriptionViewHeight-keybindingsViewHeight-editorViewHeight-1, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err.Error() != "unknown view" {
|
if !gocui.IsUnknownView(err) {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -317,7 +317,7 @@ func (self *app) layout(g *gocui.Gui) error {
|
|||||||
|
|
||||||
descriptionView, err := g.SetViewBeneath("description", "list", descriptionViewHeight)
|
descriptionView, err := g.SetViewBeneath("description", "list", descriptionViewHeight)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err.Error() != "unknown view" {
|
if !gocui.IsUnknownView(err) {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
descriptionView.Title = "Test description"
|
descriptionView.Title = "Test description"
|
||||||
@ -327,7 +327,7 @@ func (self *app) layout(g *gocui.Gui) error {
|
|||||||
|
|
||||||
keybindingsView, err := g.SetViewBeneath("keybindings", "description", keybindingsViewHeight)
|
keybindingsView, err := g.SetViewBeneath("keybindings", "description", keybindingsViewHeight)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err.Error() != "unknown view" {
|
if !gocui.IsUnknownView(err) {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
keybindingsView.Title = "Keybindings"
|
keybindingsView.Title = "Keybindings"
|
||||||
@ -338,7 +338,7 @@ func (self *app) layout(g *gocui.Gui) error {
|
|||||||
|
|
||||||
editorView, err := g.SetViewBeneath("editor", "keybindings", editorViewHeight)
|
editorView, err := g.SetViewBeneath("editor", "keybindings", editorViewHeight)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err.Error() != "unknown view" {
|
if !gocui.IsUnknownView(err) {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -344,7 +344,7 @@ func (app *App) layout(g *gocui.Gui) error {
|
|||||||
g.FgColor = gocui.ColorGreen
|
g.FgColor = gocui.ColorGreen
|
||||||
listView, err := g.SetView("list", 0, 0, maxX-1, maxY-descriptionViewHeight-keybindingsViewHeight-editorViewHeight-1, 0)
|
listView, err := g.SetView("list", 0, 0, maxX-1, maxY-descriptionViewHeight-keybindingsViewHeight-editorViewHeight-1, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err.Error() != "unknown view" {
|
if !gocui.IsUnknownView(err) {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
listView.Highlight = true
|
listView.Highlight = true
|
||||||
@ -361,7 +361,7 @@ func (app *App) layout(g *gocui.Gui) error {
|
|||||||
|
|
||||||
descriptionView, err := g.SetViewBeneath("description", "list", descriptionViewHeight)
|
descriptionView, err := g.SetViewBeneath("description", "list", descriptionViewHeight)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err.Error() != "unknown view" {
|
if !gocui.IsUnknownView(err) {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
descriptionView.Title = "Test description"
|
descriptionView.Title = "Test description"
|
||||||
@ -371,7 +371,7 @@ func (app *App) layout(g *gocui.Gui) error {
|
|||||||
|
|
||||||
keybindingsView, err := g.SetViewBeneath("keybindings", "description", keybindingsViewHeight)
|
keybindingsView, err := g.SetViewBeneath("keybindings", "description", keybindingsViewHeight)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err.Error() != "unknown view" {
|
if !gocui.IsUnknownView(err) {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
keybindingsView.Title = "Keybindings"
|
keybindingsView.Title = "Keybindings"
|
||||||
@ -382,7 +382,7 @@ func (app *App) layout(g *gocui.Gui) error {
|
|||||||
|
|
||||||
editorView, err := g.SetViewBeneath("editor", "keybindings", editorViewHeight)
|
editorView, err := g.SetViewBeneath("editor", "keybindings", editorViewHeight)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err.Error() != "unknown view" {
|
if !gocui.IsUnknownView(err) {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
editorView.Title = "Enter Name"
|
editorView.Title = "Enter Name"
|
||||||
|
Reference in New Issue
Block a user