aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/chat_input/view.vala
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-08-16 22:44:12 +0200
committerfiaxh <git@mx.ax.lt>2017-08-17 01:37:20 +0200
commit500adea6dca162a4d0fe602eefa6b9095862dd13 (patch)
tree162c4db59901d1e9f9815b23a98d3121118b6295 /main/src/ui/chat_input/view.vala
parentbff6885a6bb1a5a73d4c0b55294932231f242760 (diff)
downloaddino-500adea6dca162a4d0fe602eefa6b9095862dd13.tar.gz
dino-500adea6dca162a4d0fe602eefa6b9095862dd13.zip
Undo/redo text in chat input
Diffstat (limited to 'main/src/ui/chat_input/view.vala')
-rw-r--r--main/src/ui/chat_input/view.vala6
1 files changed, 5 insertions, 1 deletions
diff --git a/main/src/ui/chat_input/view.vala b/main/src/ui/chat_input/view.vala
index 0887de25..d8a31a22 100644
--- a/main/src/ui/chat_input/view.vala
+++ b/main/src/ui/chat_input/view.vala
@@ -19,11 +19,13 @@ public class View : Box {
private int vscrollbar_min_height;
private OccupantsTabCompletor occupants_tab_completor;
private SmileyConverter smiley_converter;
+ private EditHistory edit_history;
public View(StreamInteractor stream_interactor) {
this.stream_interactor = stream_interactor;
occupants_tab_completor = new OccupantsTabCompletor(stream_interactor, text_input);
smiley_converter = new SmileyConverter(stream_interactor, text_input);
+ edit_history = new EditHistory(text_input, GLib.Application.get_default());
scrolled.get_vscrollbar().get_preferred_height(out vscrollbar_min_height, null);
scrolled.vadjustment.notify["upper"].connect_after(on_upper_notify);
@@ -33,6 +35,7 @@ public class View : Box {
public void initialize_for_conversation(Conversation conversation) {
occupants_tab_completor.initialize_for_conversation(conversation);
+ edit_history.initialize_for_conversation(conversation);
if (this.conversation != null) entry_cache[this.conversation] = text_input.buffer.text;
this.conversation = conversation;
@@ -81,6 +84,7 @@ public class View : Box {
text_input.buffer.insert_at_cursor("\n", 1);
} else if (text_input.buffer.text != ""){
send_text();
+ edit_history.reset_history();
}
return true;
}
@@ -103,4 +107,4 @@ public class View : Box {
}
}
-} \ No newline at end of file
+}