Add generic utils constraint function

This commit is contained in:
Marcel Meyer authored and Junegunn Choi committed 2025-12-23 09:14:33 +09:00
1 parent 14b5e1d88c
commit 6eb4b41e34
4 files changed
+5 -52

No files matched your search

+2 -2
View File
@@ -3859,8 +3859,8 @@ func (t *Terminal) printColoredString(window tui.Window, text []rune, offsets []
maxOffset := int32(len(text))
var url *url
for _, offset := range offsets {
b := util.Constrain32(offset.offset[0], index, maxOffset)
e := util.Constrain32(offset.offset[1], index, maxOffset)
b := util.Constrain(offset.offset[0], index, maxOffset)
e := util.Constrain(offset.offset[1], index, maxOffset)
if url != nil && offset.url != url {
url = nil
window.LinkEnd()