Skip to content

Commit

Permalink
Add removed command that removes the top chunk
Browse files Browse the repository at this point in the history
  • Loading branch information
rexim committed Dec 23, 2023
1 parent f2559f5 commit a881a5b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions markut.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a881a5b

Please sign in to comment.