]> git.lizzy.rs Git - micro.git/commitdiff
Make curpane only return bufpanes
authorZachary Yedidia <zyedidia@gmail.com>
Sun, 2 Feb 2020 22:12:50 +0000 (17:12 -0500)
committerZachary Yedidia <zyedidia@gmail.com>
Sun, 2 Feb 2020 22:12:50 +0000 (17:12 -0500)
internal/action/tab.go

index 145d831639f0435a38f238cbea0a430b78c032f6..39e7ee8f5a95219d7f9c0dd2df6732ebf1aaed3d 100644 (file)
@@ -284,6 +284,10 @@ func (t *Tab) Resize() {
 }
 
 // CurPane returns the currently active pane
-func (t *Tab) CurPane() Pane {
-       return t.Panes[t.active]
+func (t *Tab) CurPane() *BufPane {
+       p, ok := t.Panes[t.active].(*BufPane)
+       if !ok {
+               return nil
+       }
+       return p
 }