diff options
author | P <a@b.com> | 2024-04-21 13:11:00 +0200 |
---|---|---|
committer | P <a@b.com> | 2024-04-21 13:23:51 +0200 |
commit | a6b8d76a7c654da49d0a1998d9a507ea3ed7200b (patch) | |
tree | 0f4afe4c9b59963af8fac51c991be6741320c4a9 | |
parent | 0fa16611ab9d41ec7984bd5f3ee777f15b711a4e (diff) |
Fixes pimutils/khal#1274
Meta+enter will also trigger an event validation
-rw-r--r-- | khal/ui/editor.py | 3 | ||||
-rw-r--r-- | khal/ui/widgets.py | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/khal/ui/editor.py b/khal/ui/editor.py index 82a9220e..50195be2 100644 --- a/khal/ui/editor.py +++ b/khal/ui/editor.py @@ -610,10 +610,11 @@ class EventEditor(urwid.WidgetWrap): return None else: self._abort_confirmed = False + return_value = super().keypress(size, key) if key in self.pane._conf['keybindings']['save']: self.save(None) return None - return super().keypress(size, key) + return return_value WEEKDAYS = ['MO', 'TU', 'WE', 'TH', 'FR', 'SA', 'SU'] # TODO use locale and respect weekdaystart diff --git a/khal/ui/widgets.py b/khal/ui/widgets.py index d2f6e8cc..7f6ca6e4 100644 --- a/khal/ui/widgets.py +++ b/khal/ui/widgets.py @@ -138,7 +138,8 @@ class DateTimeWidget(ExtendedEdit): return None if ( - key in ['up', 'down', 'tab', 'shift tab', 'page up', 'page down'] or + key in ['up', 'down', 'tab', 'shift tab', + 'page up', 'page down', 'meta enter'] or (key in ['right'] and self.edit_pos >= len(self.edit_text)) or (key in ['left'] and self.edit_pos == 0)): # when leaving the current Widget we check if currently @@ -436,7 +437,8 @@ class ValidatedEdit(urwid.WidgetWrap): def keypress(self, size, key): if ( - key in ['up', 'down', 'tab', 'shift tab', 'page up', 'page down'] or + key in ['up', 'down', 'tab', 'shift tab', + 'page up', 'page down', 'meta enter'] or (key in ['right'] and self.edit_pos >= len(self.edit_text)) or (key in ['left'] and self.edit_pos == 0)): if not self._validate(): |