diff --git a/internal/cmd/generator/vm.go.tmpl b/internal/cmd/generator/vm.go.tmpl index 2091ba1..8bb1681 100644 --- a/internal/cmd/generator/vm.go.tmpl +++ b/internal/cmd/generator/vm.go.tmpl @@ -484,7 +484,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b oldOffset := ptrOffset ptrOffset += code.Jmp.CurLen * uintptrSize oldBaseIndent := ctx.BaseIndent - ctx.BaseIndent += code.Indent - 1 + ctx.BaseIndent += code.Indent newLen := offsetNum + code.Jmp.CurLen + code.Jmp.NextLen if curlen < newLen { diff --git a/internal/encoder/vm/vm.go b/internal/encoder/vm/vm.go index 2091ba1..8bb1681 100644 --- a/internal/encoder/vm/vm.go +++ b/internal/encoder/vm/vm.go @@ -484,7 +484,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b oldOffset := ptrOffset ptrOffset += code.Jmp.CurLen * uintptrSize oldBaseIndent := ctx.BaseIndent - ctx.BaseIndent += code.Indent - 1 + ctx.BaseIndent += code.Indent newLen := offsetNum + code.Jmp.CurLen + code.Jmp.NextLen if curlen < newLen { diff --git a/internal/encoder/vm_color/vm.go b/internal/encoder/vm_color/vm.go index 0ac3179..8d7df85 100644 --- a/internal/encoder/vm_color/vm.go +++ b/internal/encoder/vm_color/vm.go @@ -484,7 +484,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b oldOffset := ptrOffset ptrOffset += code.Jmp.CurLen * uintptrSize oldBaseIndent := ctx.BaseIndent - ctx.BaseIndent += code.Indent - 1 + ctx.BaseIndent += code.Indent newLen := offsetNum + code.Jmp.CurLen + code.Jmp.NextLen if curlen < newLen { diff --git a/internal/encoder/vm_color_indent/vm.go b/internal/encoder/vm_color_indent/vm.go index cd619ca..834aadf 100644 --- a/internal/encoder/vm_color_indent/vm.go +++ b/internal/encoder/vm_color_indent/vm.go @@ -484,7 +484,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b oldOffset := ptrOffset ptrOffset += code.Jmp.CurLen * uintptrSize oldBaseIndent := ctx.BaseIndent - ctx.BaseIndent += code.Indent - 1 + ctx.BaseIndent += code.Indent newLen := offsetNum + code.Jmp.CurLen + code.Jmp.NextLen if curlen < newLen { diff --git a/internal/encoder/vm_indent/vm.go b/internal/encoder/vm_indent/vm.go index a4eb235..f9d7569 100644 --- a/internal/encoder/vm_indent/vm.go +++ b/internal/encoder/vm_indent/vm.go @@ -484,7 +484,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b oldOffset := ptrOffset ptrOffset += code.Jmp.CurLen * uintptrSize oldBaseIndent := ctx.BaseIndent - ctx.BaseIndent += code.Indent - 1 + ctx.BaseIndent += code.Indent newLen := offsetNum + code.Jmp.CurLen + code.Jmp.NextLen if curlen < newLen {