1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

Fix Decolorise to also strip hyperlinks

This is needed so that the information view is correctly aligned when we add
hyperlinks to it.
This commit is contained in:
Stefan Haller
2024-08-16 12:23:57 +02:00
parent fb97c30080
commit b411897a5a
2 changed files with 8 additions and 0 deletions

View File

@ -2,6 +2,8 @@ package utils
import (
"testing"
"github.com/jesseduffield/lazygit/pkg/gui/style"
)
func TestDecolorise(t *testing.T) {
@ -189,6 +191,10 @@ func TestDecolorise(t *testing.T) {
input: "\x1b[38;2;157;205;18mta\x1b[0m",
output: "ta",
},
{
input: "a_" + style.PrintSimpleHyperlink("xyz") + "_b",
output: "a_xyz_b",
},
}
for _, test := range tests {