1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-05-15 22:26:40 +02:00
lazygit/pkg/gui/context/main_context.go
Stefan Haller 1a93b2324b Allow focussing the main view
In this commit this is only possible by pressing '0' in a side panel; we'll add
mouse clicking later in the branch.

Also, you can't really do anything in the focused view except press escape to
leave it again. We'll add some more functionality in a following commit.
2025-04-21 18:03:19 +02:00

31 lines
567 B
Go

package context
import (
"github.com/jesseduffield/gocui"
"github.com/jesseduffield/lazygit/pkg/gui/types"
)
type MainContext struct {
*SimpleContext
}
func NewMainContext(
view *gocui.View,
windowName string,
key types.ContextKey,
) *MainContext {
ctx := &MainContext{
SimpleContext: NewSimpleContext(
NewBaseContext(NewBaseContextOpts{
Kind: types.MAIN_CONTEXT,
View: view,
WindowName: windowName,
Key: key,
Focusable: true,
HighlightOnFocus: false,
})),
}
return ctx
}