aboutsummaryrefslogtreecommitdiff
path: root/vendor/maunium.net/go/tview/application.go
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2018-04-30 10:55:37 +0300
committerTulir Asokan <tulir@maunium.net>2018-04-30 10:55:37 +0300
commite48ff5bea4725d39818f24fa76b5ae74971f23a3 (patch)
tree549b8688ef59f7096a20544cd01ad75ec111c0e4 /vendor/maunium.net/go/tview/application.go
parent576bab9e2e9589942d4cac8742fa1b54e8b237f9 (diff)
Update dependencies
Diffstat (limited to 'vendor/maunium.net/go/tview/application.go')
-rw-r--r--vendor/maunium.net/go/tview/application.go20
1 files changed, 20 insertions, 0 deletions
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