aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/chat_input/edit_history.vala
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-08-17 21:24:01 +0200
committerfiaxh <git@mx.ax.lt>2017-08-22 16:04:41 +0200
commita8aceb1e395e3d0d5a570f6570a1613e2f990d87 (patch)
treebe4996693059e26500d0c4fd68f0bd71e863f514 /main/src/ui/chat_input/edit_history.vala
parenta24e88f48b9a16239ff91a3ce7b4a70bd2d84fee (diff)
downloaddino-a8aceb1e395e3d0d5a570f6570a1613e2f990d87.tar.gz
dino-a8aceb1e395e3d0d5a570f6570a1613e2f990d87.zip
README: Discussion MUC, change url
Diffstat (limited to 'main/src/ui/chat_input/edit_history.vala')
-rw-r--r--main/src/ui/chat_input/edit_history.vala11
1 files changed, 5 insertions, 6 deletions
diff --git a/main/src/ui/chat_input/edit_history.vala b/main/src/ui/chat_input/edit_history.vala
index 78a0f41e..22032a0b 100644
--- a/main/src/ui/chat_input/edit_history.vala
+++ b/main/src/ui/chat_input/edit_history.vala
@@ -30,12 +30,11 @@ class EditHistory {
}
public bool on_text_input_key_press(EventKey event) {
- if ((event.state & ModifierType.CONTROL_MASK) > 0) {
- if (event.keyval == Key.z) {
- undo();
- } else if (event.keyval == Key.Z) {
- redo();
- }
+ bool ctrl_pressed = (event.state & ModifierType.CONTROL_MASK) > 0;
+ if (ctrl_pressed && event.keyval == Key.z) {
+ undo();
+ } else if (ctrl_pressed && (event.keyval in new uint[]{ Key.Z, Key.y } )) {
+ redo();
} else if (event.keyval in new uint[]{ Key.space, Key.Tab, Key.ISO_Left_Tab }) {
if (indices[conversation] < histories[conversation].size - 1) {
histories[conversation] = histories[conversation].slice(0, indices[conversation] + 1);