From 35e75ba83e88fc5d61e8350030e747dfcfe4804d Mon Sep 17 00:00:00 2001 From: raziman Date: Tue, 16 Feb 2021 13:38:36 +0800 Subject: [PATCH] disable global keybindings when repl is running --- start.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/start.go b/start.go index ad0982c..bf359a1 100644 --- a/start.go +++ b/start.go @@ -106,7 +106,6 @@ color_popup = "#0A0F14" // vim: syntax=go ` - cfg := expandTilde(config) _, err := os.Stat(cfg) @@ -219,6 +218,10 @@ func start(application *tview.Application, args Args) { // global keybindings are handled here application.SetInputCapture(func(e *tcell.EventKey) *tcell.EventKey { + if gomu.pages.HasPage("repl-input-popup") { + return e + } + popupName, _ := gomu.pages.GetFrontPage() // disables keybindings when writing in input fields @@ -237,7 +240,7 @@ func start(application *tview.Application, args Args) { kb := string(e.Rune()) if gomu.anko.KeybindExists("Global", kb) { - + err := gomu.anko.ExecKeybind("Global", kb) if err != nil { errorPopup(err)