mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-11-18 03:49:50 -06:00
Add a test showing that wrapping text for a view breaks hyperlinks
WrapViewLinesToWidth counts the escape sequences of OSC 8 hyperlinks, including their URLs, towards the width of a line. It wraps lines with links too early, and it can even split such an escape sequence across two lines. Nothing puts links into wrapped popup text yet, but the update menu will. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
54cc6af1d7
commit
dfa77684ff
1 file changed
+11
@@ -487,3 +487,14 @@ func TestWrapViewLinesToWidth(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestWrapViewLinesToWidthWithHyperlink(t *testing.T) {
|
||||
text := "Hello \x1b]8;;https://example.com\x1b\\big\x1b]8;;\x1b\\ world"
|
||||
wrappedLines, _, _ := WrapViewLinesToWidth(true, false, text, 9, 4)
|
||||
assert.Equal(t,
|
||||
/* EXPECTED:
|
||||
[]string{"Hello \x1b]8;;https://example.com\x1b\\big\x1b]8;;\x1b\\", "world"},
|
||||
ACTUAL: */
|
||||
[]string{"Hello", "\x1b]8;;https:", "//example", ".com\x1b\\big\x1b]8;", ";\x1b\\ world"},
|
||||
wrappedLines)
|
||||
}
|
||||
Reference in new issue
Block a user