<- Back to shtanton's homepage
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharlie Stanton <charlie@shtanton.xyz>2024-04-21 17:52:08 +0100
committerCharlie Stanton <charlie@shtanton.xyz>2024-04-21 17:52:08 +0100
commit126fcb57b29dd0157cf2dd42da24dc0a047ec88c (patch)
treeea90a165bbd1800ea45216b00ffd830c4eb7755e
parentf6e27ecd8881498776428c0ae5b674f65192058e (diff)
downloadstred-go-126fcb57b29dd0157cf2dd42da24dc0a047ec88c.tar
Fix bug where next command doesn't consume the input
-rw-r--r--main/command.go2
-rw-r--r--main/main.go6
2 files changed, 5 insertions, 3 deletions
diff --git a/main/command.go b/main/command.go
index 736dce5..38e1c95 100644
--- a/main/command.go
+++ b/main/command.go
@@ -79,6 +79,7 @@ func (cmd SubstituteNextCommand) exec(state *ProgramState) {
if notOk {
state.pc++
} else {
+ state.Read()
state.prevStart = item.PrevStart
state.start = item.Start
state.end = item.End
@@ -105,6 +106,7 @@ func (cmd SubstituteAppendNextCommand) exec(state *ProgramState) {
if notOk {
state.pc++
} else {
+ state.Read()
state.prevStart = item.PrevStart
state.start = item.Start
state.end = item.End
diff --git a/main/main.go b/main/main.go
index 47bcddb..bfa1afe 100644
--- a/main/main.go
+++ b/main/main.go
@@ -1,11 +1,11 @@
package main
import (
- "io"
- "os"
"bufio"
- "main/walk"
+ "io"
"main/json"
+ "main/walk"
+ "os"
)
type ProgramState struct {