aboutsummaryrefslogtreecommitdiffhomepage
path: root/qbuffers.cpp
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2012-11-20 23:17:46 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2012-11-20 23:17:46 +0100
commitcfc026aaae9bb0706ffffdcfedbc063a12409542 (patch)
tree86c0138b7a1c84326e435aee76dcdeb56b3cb34f /qbuffers.cpp
parent4c1509ebf6f71c2330e25936d416b4bed44073b1 (diff)
downloadsciteco-cfc026aaae9bb0706ffffdcfedbc063a12409542.tar.gz
support :X command
Diffstat (limited to 'qbuffers.cpp')
-rw-r--r--qbuffers.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/qbuffers.cpp b/qbuffers.cpp
index 42ac436..a3b4651 100644
--- a/qbuffers.cpp
+++ b/qbuffers.cpp
@@ -108,6 +108,21 @@ QRegisterData::undo_set_string(void)
undo_edit();
}
+void
+QRegisterData::append_string(const gchar *str)
+{
+ if (!str)
+ return;
+
+ edit();
+
+ interface.ssm(SCI_BEGINUNDOACTION);
+ interface.ssm(SCI_APPENDTEXT, strlen(str), (sptr_t)str);
+ interface.ssm(SCI_ENDUNDOACTION);
+
+ current_edit();
+}
+
gchar *
QRegisterData::get_string(void)
{
@@ -903,8 +918,13 @@ StateCopyToQReg::got_register(QRegister *reg) throw (Error)
tr.lpstrText = (char *)g_malloc(len + 1);
interface.ssm(SCI_GETTEXTRANGE, 0, (sptr_t)&tr);
- reg->undo_set_string();
- reg->set_string(tr.lpstrText);
+ if (eval_colon()) {
+ reg->undo_append_string();
+ reg->append_string(tr.lpstrText);
+ } else {
+ reg->undo_set_string();
+ reg->set_string(tr.lpstrText);
+ }
g_free(tr.lpstrText);
return &States::start;