From 845c80721f8f0445b0abe39ee381a6feecf158a2 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Sat, 18 Jul 2020 19:41:13 +1000 Subject: Decouple escaping from quitting When a user is not entering text into a prompt, the 'q' key should immediately quit the application. On the other hand, the 'esc' key should cancel/close/go-back to the previous context. If we're at the surface level (nothing to cancel/close) and the user hits the escape key, the default behaviour is to close the app, however we now have a `quitOnTopLevelReturn` config key to override this. I actually think from the beginning we should have made this config option default to false rather than true which is the default this PR gives it, but I don't want to anger too many people familiar with the existing behaviour. --- pkg/gui/view_helpers.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pkg/gui/view_helpers.go') diff --git a/pkg/gui/view_helpers.go b/pkg/gui/view_helpers.go index 429ab46b5..032d05002 100644 --- a/pkg/gui/view_helpers.go +++ b/pkg/gui/view_helpers.go @@ -513,7 +513,8 @@ func (gui *Gui) renderGlobalOptions() error { return gui.renderOptionsMap(map[string]string{ fmt.Sprintf("%s/%s", gui.getKeyDisplay("universal.scrollUpMain"), gui.getKeyDisplay("universal.scrollDownMain")): gui.Tr.SLocalize("scroll"), fmt.Sprintf("%s %s %s %s", gui.getKeyDisplay("universal.prevBlock"), gui.getKeyDisplay("universal.nextBlock"), gui.getKeyDisplay("universal.prevItem"), gui.getKeyDisplay("universal.nextItem")): gui.Tr.SLocalize("navigate"), - fmt.Sprintf("%s/%s", gui.getKeyDisplay("universal.return"), gui.getKeyDisplay("universal.quit")): gui.Tr.SLocalize("close"), + gui.getKeyDisplay("universal.return"): gui.Tr.SLocalize("cancel"), + gui.getKeyDisplay("universal.quit"): gui.Tr.SLocalize("quit"), gui.getKeyDisplay("universal.optionMenu"): gui.Tr.SLocalize("menu"), "1-5": gui.Tr.SLocalize("jump"), }) -- cgit v1.2.3