Skip to content

Commit

Permalink
fix: cannot compile
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinZonda committed May 4, 2023
1 parent 30486a0 commit d9c8bc3
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions prompt/string.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ import (
"strings"
)

func (f *PromptC) Combine() *PromptC {
// Copy returns a copy of the promptc file
// this is not Clone, Copy will still contains
// the same reference to the variable
func (f *PromptC) Copy() *PromptC {
nf := PromptC{
FileInfo: f.FileInfo,
SharedInfo: f.SharedInfo,
}

vars := make(map[string]string)
for k, v := range f.VarConstraint {

vars[k] = variable.ToPromptcValue(v)
}
nf.Vars = vars
Expand All @@ -26,7 +28,7 @@ func (f *PromptC) Combine() *PromptC {
}

func (f *PromptC) OldStyle() string {
nf := f.Combine()
nf := f.Copy()
nf.parsePrompt()
sb := strings.Builder{}
if f.Conf != nil {
Expand Down Expand Up @@ -69,7 +71,7 @@ func (f *PromptC) OldStyle() string {
}

func (f *PromptC) Formatted() string {
nf := f.Combine()
nf := f.Copy()
return utils.HjsonNoBrace(nf)

}
Expand Down

0 comments on commit d9c8bc3

Please sign in to comment.