aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ring.h
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2014-11-08 03:23:47 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2014-11-09 20:32:24 +0100
commita475ea8eacfcce8a3f0112f121400e37fffc0934 (patch)
tree063bff5a8dcc48deadf28cbb939b1e204cb70ecd /src/ring.h
parent1c3b2a9cf7bc298941f1165885fb1a3c76105878 (diff)
downloadsciteco-a475ea8eacfcce8a3f0112f121400e37fffc0934.tar.gz
current_doc_must_undo(): check for undo-necessity when operating on the current document
if the current document is a local q-register from a macro call, we must not generate undo tokens, since the local documents are discarded on macro termination.
Diffstat (limited to 'src/ring.h')
-rw-r--r--src/ring.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ring.h b/src/ring.h
index db64882..be2689e 100644
--- a/src/ring.h
+++ b/src/ring.h
@@ -247,4 +247,11 @@ current_doc_update(void)
QRegisters::current->update_string();
}
+static inline bool
+current_doc_must_undo(void)
+{
+ return ring.current ||
+ QRegisters::current->must_undo;
+}
+
#endif