1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-05 00:59:19 +02:00

remove old integration test recording code

This commit is contained in:
Jesse Duffield
2023-03-24 18:42:11 +11:00
parent 4b67a45a16
commit 8121a0cc74
9 changed files with 16 additions and 253 deletions

View File

@ -5,8 +5,6 @@
package gocui
import (
"time"
"github.com/gdamore/tcell/v2"
"github.com/mattn/go-runewidth"
)
@ -236,14 +234,10 @@ func (wrapper TcellResizeEventWrapper) toTcellEvent() tcell.Event {
return tcell.NewEventResize(wrapper.Width, wrapper.Height)
}
func (g *Gui) timeSinceStart() int64 {
return time.Since(g.StartTime).Nanoseconds() / 1e6
}
// pollEvent get tcell.Event and transform it into gocuiEvent
func (g *Gui) pollEvent() GocuiEvent {
var tev tcell.Event
if g.PlayMode == REPLAYING || g.PlayMode == REPLAYING_NEW {
if g.playRecording {
select {
case ev := <-g.ReplayedEvents.Keys:
tev = (ev).toTcellEvent()
@ -258,21 +252,9 @@ func (g *Gui) pollEvent() GocuiEvent {
case *tcell.EventInterrupt:
return GocuiEvent{Type: eventInterrupt}
case *tcell.EventResize:
if g.PlayMode == RECORDING {
g.Recording.ResizeEvents = append(
g.Recording.ResizeEvents, NewTcellResizeEventWrapper(tev, g.timeSinceStart()),
)
}
w, h := tev.Size()
return GocuiEvent{Type: eventResize, Width: w, Height: h}
case *tcell.EventKey:
if g.PlayMode == RECORDING {
g.Recording.KeyEvents = append(
g.Recording.KeyEvents, NewTcellKeyEventWrapper(tev, g.timeSinceStart()),
)
}
k := tev.Key()
ch := rune(0)
if k == tcell.KeyRune {