From 4f807eeb194872b48285c47ca1a58a5ebcc7e375 Mon Sep 17 00:00:00 2001 From: Arnaud MASSERANN Date: Sun, 23 Jul 2023 14:19:59 +0200 Subject: [PATCH] Could not type special characters on non-english keyboards On german/french/spanish keyboards, typing [ requires modifier keys like AltGr, so the `mod==0` condition is wrong. Fixes #2573 ch != 0 is useless because IsPrint is implemented this way: if uint32(r) <= MaxLatin1 { return properties[uint8(r)]&128 != 0 } with properties[0] set to 1 (so, bit 7 not set) -> 0 is not printable. --- pkg/gui/editors.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/gui/editors.go b/pkg/gui/editors.go index b095630ec..fdbe67a39 100644 --- a/pkg/gui/editors.go +++ b/pkg/gui/editors.go @@ -47,8 +47,7 @@ func (gui *Gui) handleEditorKeypress(textArea *gocui.TextArea, key gocui.Key, ch case key == gocui.KeyCtrlY: textArea.Yank() - // TODO: see if we need all three of these conditions: maybe the final one is sufficient - case ch != 0 && mod == 0 && unicode.IsPrint(ch): + case unicode.IsPrint(ch): textArea.TypeRune(ch) default: return false