fix: tui attachment bound (#2361)
parent
8ba8d3c7e3
commit
26f75d4e68
|
|
@ -43,6 +43,9 @@ func (p Prompt) ToMessage(
|
|||
}
|
||||
for _, att := range textAttachments {
|
||||
if source, ok := att.GetTextSource(); ok {
|
||||
if att.StartIndex > att.EndIndex || att.EndIndex > len(text) {
|
||||
continue
|
||||
}
|
||||
text = text[:att.StartIndex] + source.Value + text[att.EndIndex:]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue