Skip to content

Commit

Permalink
chore: lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed Nov 21, 2024
1 parent 128323d commit 1052f9c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
8 changes: 4 additions & 4 deletions ferocious_renderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ func (c *ferociousRenderer) update(msg Msg) {

case enableModeMsg:
switch ansi.DECMode(msg) {
case ansi.AltScreenBufferMode:
case ansi.AltScreenSaveCursorMode:
if c.altScreen {
return
}
Expand All @@ -327,7 +327,7 @@ func (c *ferociousRenderer) update(msg Msg) {
// whenever we enter or leave AltScreen.
c.updateCursorVisibility()

case ansi.CursorEnableMode:
case ansi.TextCursorEnableMode:
if !c.cursorHidden {
return
}
Expand All @@ -337,7 +337,7 @@ func (c *ferociousRenderer) update(msg Msg) {

case disableModeMsg:
switch ansi.DECMode(msg) {
case ansi.AltScreenBufferMode:
case ansi.AltScreenSaveCursorMode:
if !c.altScreen {
return
}
Expand All @@ -350,7 +350,7 @@ func (c *ferociousRenderer) update(msg Msg) {
// whenever we enter or leave AltScreen.
c.updateCursorVisibility()

case ansi.CursorEnableMode:
case ansi.TextCursorEnableMode:
if c.cursorHidden {
return
}
Expand Down
34 changes: 17 additions & 17 deletions tea.go
Original file line number Diff line number Diff line change
Expand Up @@ -739,18 +739,18 @@ func (p *Program) Run() (Model, error) {
}

// Hide the cursor before starting the renderer.
p.modes[ansi.CursorEnableMode] = false
p.modes[ansi.TextCursorEnableMode] = false
p.execute(ansi.HideCursor)
p.renderer.update(disableMode(ansi.CursorEnableMode))
p.renderer.update(disableMode(ansi.TextCursorEnableMode))

// Honor program startup options.
if p.startupTitle != "" {
p.execute(ansi.SetWindowTitle(p.startupTitle))
}
if p.startupOptions&withAltScreen != 0 {
p.execute(ansi.SetAltScreenBufferMode)
p.modes[ansi.AltScreenBufferMode] = true
p.renderer.update(enableMode(ansi.AltScreenBufferMode))
p.execute(ansi.SetAltScreenSaveCursorMode)
p.modes[ansi.AltScreenSaveCursorMode] = true
p.renderer.update(enableMode(ansi.AltScreenSaveCursorMode))
}
if p.startupOptions&withoutBracketedPaste == 0 {
p.execute(ansi.SetBracketedPasteMode)
Expand All @@ -763,15 +763,15 @@ func (p *Program) Run() (Model, error) {
// a response in the eventLoop.
}
if p.startupOptions&withMouseCellMotion != 0 {
p.execute(ansi.EnableMouseCellMotion)
p.execute(ansi.SetButtonEventMouseMode)
p.execute(ansi.SetSgrExtMouseMode)
p.modes[ansi.MouseCellMotionMode] = true
p.modes[ansi.MouseSgrExtMode] = true
p.modes[ansi.ButtonEventMouseMode] = true
p.modes[ansi.SgrExtMouseMode] = true
} else if p.startupOptions&withMouseAllMotion != 0 {
p.execute(ansi.EnableMouseAllMotion)
p.execute(ansi.SetAnyEventMouseMode)
p.execute(ansi.SetSgrExtMouseMode)
p.modes[ansi.MouseAllMotionMode] = true
p.modes[ansi.MouseSgrExtMode] = true
p.modes[ansi.AnyEventMouseMode] = true
p.modes[ansi.SgrExtMouseMode] = true
}

if p.startupOptions&withReportFocus != 0 {
Expand Down Expand Up @@ -949,15 +949,15 @@ func (p *Program) RestoreTerminal() error {
if err := p.initInputReader(); err != nil {
return err
}
if p.modes[ansi.AltScreenBufferMode] {
p.execute(ansi.SetAltScreenBufferMode)
if p.modes[ansi.AltScreenSaveCursorMode] {
p.execute(ansi.SetAltScreenSaveCursorMode)
} else {
// entering alt screen already causes a repaint.
go p.Send(repaintMsg{})
}

p.startRenderer()
if !p.modes[ansi.CursorEnableMode] {
if !p.modes[ansi.TextCursorEnableMode] {
p.execute(ansi.HideCursor)
} else {
p.execute(ansi.ShowCursor)
Expand All @@ -974,12 +974,12 @@ func (p *Program) RestoreTerminal() error {
if p.modes[ansi.FocusEventMode] {
p.execute(ansi.SetFocusEventMode)
}
if p.modes[ansi.MouseCellMotionMode] || p.modes[ansi.MouseAllMotionMode] {
if p.modes[ansi.ButtonEventMouseMode] || p.modes[ansi.AnyEventMouseMode] {
if p.startupOptions&withMouseCellMotion != 0 {
p.execute(ansi.EnableMouseCellMotion)
p.execute(ansi.SetButtonEventMouseMode)
p.execute(ansi.SetSgrExtMouseMode)
} else if p.startupOptions&withMouseAllMotion != 0 {
p.execute(ansi.EnableMouseAllMotion)
p.execute(ansi.SetAnyEventMouseMode)
p.execute(ansi.SetSgrExtMouseMode)
}
}
Expand Down

0 comments on commit 1052f9c

Please sign in to comment.