]> git.mdlowis.com Git - projs/tide.git/commitdiff
added functions for log start and stop
authorMichael D. Lowis <mike.lowis@gentex.com>
Tue, 4 Sep 2018 20:20:56 +0000 (16:20 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Tue, 4 Sep 2018 20:20:56 +0000 (16:20 -0400)
inc/edit.h
lib/buf.c

index 02f2a59e8e08e3ef08281d7e984a39d55828e395..153bbdaed230061a0c5c42e69bc01df17f92373e 100644 (file)
@@ -49,6 +49,8 @@ void buf_del(Buf* buf);
 
 void buf_undo(Buf* buf);
 void buf_redo(Buf* buf);
+void buf_logstart(Buf* buf);
+void buf_logstop(Buf* buf);
 void buf_logclear(Buf* buf);
 void buf_lastins(Buf* buf);
 
index b0c634b6c2fb8c2966286a3ee9c06457cb16e24a..169848d1b783db942d0e355140fac6ac85f76d57 100644 (file)
--- a/lib/buf.c
+++ b/lib/buf.c
@@ -231,6 +231,15 @@ static void log_swap(Buf* buf, Log** src, Log** dest) {
     dumplog(buf);
 }
 
+void buf_logstart(Buf* buf) {
+    buf->transid = abs(buf->transid);
+}
+
+void buf_logstop(Buf* buf) {
+    if (buf->transid > 0)
+        buf->transid = -(buf->transid + 1);
+}
+
 void buf_undo(Buf* buf) {
     log_swap(buf, &(buf->undo), &(buf->redo));
 }