X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=internal%2Faction%2Ftermpane.go;h=540b23150f5cb26596d119a2c55a58a6e5bd40f7;hb=4e73d0779ba83eeaa1ca30f5c84a871f3adf28ef;hp=b5a2da527f22ca4c3671312ef337688f10e1043f;hpb=97665573c7f7eaccf76d1150578a0c255fb0f810;p=micro.git diff --git a/internal/action/termpane.go b/internal/action/termpane.go index b5a2da52..540b2315 100644 --- a/internal/action/termpane.go +++ b/internal/action/termpane.go @@ -17,14 +17,16 @@ type TermPane struct { mouseReleased bool id uint64 + tab *Tab } -func NewTermPane(x, y, w, h int, t *shell.Terminal, id uint64) *TermPane { +func NewTermPane(x, y, w, h int, t *shell.Terminal, id uint64, tab *Tab) *TermPane { th := new(TermPane) th.Terminal = t th.id = id th.mouseReleased = true th.Window = display.NewTermWindow(x, y, w, h, t) + th.tab = tab return th } @@ -36,6 +38,14 @@ func (t *TermPane) SetID(i uint64) { t.id = i } +func (t *TermPane) SetTab(tab *Tab) { + t.tab = tab +} + +func (t *TermPane) Tab() *Tab { + return t.tab +} + func (t *TermPane) Close() {} func (t *TermPane) Quit() { @@ -80,8 +90,12 @@ func (t *TermPane) HandleEvent(event tcell.Event) { } else if t.Status != shell.TTDone { t.WriteString(event.EscSeq()) } + } else if _, ok := event.(*tcell.EventPaste); ok { + if t.Status != shell.TTDone { + t.WriteString(event.EscSeq()) + } } else if e, ok := event.(*tcell.EventMouse); e != nil && (!ok || t.State.Mode(terminal.ModeMouseMask)) { - t.WriteString(event.EscSeq()) + // t.WriteString(event.EscSeq()) } else if e != nil { x, y := e.Position() v := t.GetView()