aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2013-02-08 22:11:56 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2013-02-08 22:25:51 +0100
commitde3ed8db8b49638bd140830f6894a880fad8ef1b (patch)
treefb88e45d130165dd6ff57fc9757b35148c3a2530 /src
parentf09318bab642ca7230c927b7b4180870ce6ad059 (diff)
downloadsciteco-de3ed8db8b49638bd140830f6894a880fad8ef1b.tar.gz
fixed ring.current/QRegisters::current corruption
occurs when rubbing out a switch from q-reg string or to q-reg string
Diffstat (limited to 'src')
-rw-r--r--src/qregisters.cpp8
-rw-r--r--src/qregisters.h7
-rw-r--r--src/ring.h4
3 files changed, 11 insertions, 8 deletions
diff --git a/src/qregisters.cpp b/src/qregisters.cpp
index b2987b3..6eea64f 100644
--- a/src/qregisters.cpp
+++ b/src/qregisters.cpp
@@ -56,6 +56,14 @@ namespace QRegisters {
QRegisterTable *locals = NULL;
QRegister *current = NULL;
+ void
+ undo_edit(void)
+ {
+ current->dot = interface.ssm(SCI_GETCURRENTPOS);
+ undo.push_var(ring.current);
+ undo.push_var(current)->undo_edit();
+ }
+
static QRegisterStack stack;
}
diff --git a/src/qregisters.h b/src/qregisters.h
index 651be1e..a5b20cb 100644
--- a/src/qregisters.h
+++ b/src/qregisters.h
@@ -357,12 +357,7 @@ namespace QRegisters {
extern QRegisterTable *locals;
extern QRegister *current;
- static inline void
- undo_edit(void)
- {
- current->dot = interface.ssm(SCI_GETCURRENTPOS);
- undo.push_var(current)->undo_edit();
- }
+ void undo_edit(void);
enum Hook {
HOOK_ADD = 1,
diff --git a/src/ring.h b/src/ring.h
index 77843fe..608b752 100644
--- a/src/ring.h
+++ b/src/ring.h
@@ -208,8 +208,8 @@ public:
undo_edit(void)
{
current->dot = interface.ssm(SCI_GETCURRENTPOS);
- undo.push_var(current);
- current->undo_edit();
+ undo.push_var(QRegisters::current);
+ undo.push_var(current)->undo_edit();
}
bool save(const gchar *filename);