m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-17 07:43:39 -05:00

Support hyperlinks (OSC 8) in the main window

Close #2557
This commit is contained in:
Junegunn Choi
2024-08-14 23:04:05 +09:00
parent 581734c369
commit 387c6ef664
5 changed files with 41 additions and 13 deletions

View File

@@ -1030,13 +1030,13 @@ func cleanse(str string) string {
func (w *LightWindow) CPrint(pair ColorPair, text string) {
_, code := w.csiColor(pair.Fg(), pair.Bg(), pair.Attr())
w.stderrInternal(cleanse(text), false, code)
w.csi("m")
w.csi("0m")
}
func (w *LightWindow) cprint2(fg Color, bg Color, attr Attr, text string) {
hasColors, code := w.csiColor(fg, bg, attr)
if hasColors {
defer w.csi("m")
defer w.csi("0m")
}
w.stderrInternal(cleanse(text), false, code)
}
@@ -1141,7 +1141,7 @@ func (w *LightWindow) CFill(fg Color, bg Color, attr Attr, text string) FillRetu
bg = w.bg
}
if hasColors, resetCode := w.csiColor(fg, bg, attr); hasColors {
defer w.csi("m")
defer w.csi("0m")
return w.fill(text, resetCode)
}
return w.fill(text, w.setBg())