mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-22 18:24:21 +01:00
fix: tui attachment bound (#2361)
This commit is contained in:
@@ -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:]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user