From a881a5b8735d02c50c322ef5327ec0c28ea48dfd Mon Sep 17 00:00:00 2001 From: rexim Date: Sun, 24 Dec 2023 05:48:04 +0700 Subject: [PATCH] Add `removed` command that removes the top chunk --- markut.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/markut.go b/markut.go index cd31f5a..0b97ba0 100644 --- a/markut.go +++ b/markut.go @@ -366,6 +366,13 @@ func evalMarkutFile(path string) (context EvalContext, ok bool) { return } context.chunks[len(context.chunks)-1].Blur = true + case "removed": + if len(context.chunks) == 0 { + fmt.Printf("%s: ERROR: no chunks defined for removal\n", token.Loc) + ok = false + return + } + context.chunks = context.chunks[:len(context.chunks)-1] case "unfinished": if len(context.chunks) == 0 { fmt.Printf("%s: ERROR: no chunks defined for marking as unfinished\n", token.Loc)