summaryrefslogtreecommitdiffstats
path: root/pkg/gui/editors.go
diff options
context:
space:
mode:
authorArnaud MASSERANN <Arnaud1602@gmail.com>2023-07-23 14:19:59 +0200
committerArnaud MASSERANN <Arnaud1602@gmail.com>2023-07-23 14:33:50 +0200
commit4f807eeb194872b48285c47ca1a58a5ebcc7e375 (patch)
treede360e2497d287b5c41bd774a25040b8770fef7d /pkg/gui/editors.go
parent7c44b76477aa6662c47426105bea6f3da74d406c (diff)
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.
Diffstat (limited to 'pkg/gui/editors.go')
-rw-r--r--pkg/gui/editors.go3
1 files changed, 1 insertions, 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