Skip to content

Commit

Permalink
Merge pull request #58 from jesseduffield/allow-changing-mouse-enabli…
Browse files Browse the repository at this point in the history
…ng-while-running
  • Loading branch information
stefanhaller authored Aug 18, 2024
2 parents ea75eca + a91c44b commit 49cc572
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions gui.go
Original file line number Diff line number Diff line change
Expand Up @@ -751,13 +751,20 @@ func (g *Gui) MainLoop() error {
}
}()

if g.Mouse {
Screen.EnableMouse()
}

Screen.EnableFocus()

previousEnableMouse := false
for {
if g.Mouse != previousEnableMouse {
if g.Mouse {
Screen.EnableMouse()
} else {
Screen.DisableMouse()
}

previousEnableMouse = g.Mouse
}

err := g.processEvent()
if err != nil {
return err
Expand Down Expand Up @@ -1084,7 +1091,7 @@ func (g *Gui) drawTitle(v *View, fgColor, bgColor Attribute) error {
if i >= currentTabStart && i <= currentTabEnd {
currentFgColor = v.SelFgColor
if v != g.currentView {
currentFgColor -= AttrBold
currentFgColor &= ^AttrBold
}
}
if err := g.SetRune(x, v.y0, ch, currentFgColor, currentBgColor); err != nil {
Expand Down

0 comments on commit 49cc572

Please sign in to comment.