From e48ff5bea4725d39818f24fa76b5ae74971f23a3 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Mon, 30 Apr 2018 10:55:37 +0300 Subject: Update dependencies --- vendor/maunium.net/go/tview/application.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'vendor/maunium.net/go/tview/application.go') diff --git a/vendor/maunium.net/go/tview/application.go b/vendor/maunium.net/go/tview/application.go index f3d6328..387c4c4 100644 --- a/vendor/maunium.net/go/tview/application.go +++ b/vendor/maunium.net/go/tview/application.go @@ -38,6 +38,8 @@ type Application struct { // be forwarded). mouseCapture func(event *tcell.EventMouse) *tcell.EventMouse + pasteCapture func(event *tcell.EventPaste) *tcell.EventPaste + // An optional callback function which is invoked just before the root // primitive is drawn. beforeDraw func(screen tcell.Screen) bool @@ -190,6 +192,24 @@ func (a *Application) Run() error { //a.Draw() } } + case *tcell.EventPaste: + a.RLock() + p := a.focus + a.RUnlock() + + if a.pasteCapture != nil { + event = a.pasteCapture(event) + if event == nil { + break + } + } + + if p != nil { + if handler := p.PasteHandler(); handler != nil { + handler(event) + a.Draw() + } + } case *tcell.EventResize: a.Lock() screen := a.screen -- cgit v1.2.3