mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-03-21 21:47:32 +02:00
Stop hiding underscores for VSCode
VSCode had an issue in their terminal where underscores were printed all over the place. That has now been fixed. See https://github.com/jesseduffield/lazygit/issues/2294 and https://github.com/xtermjs/xterm.js/issues/4238
This commit is contained in:
parent
caab31ff38
commit
b250644ea8
@ -1,8 +1,6 @@
|
|||||||
package style
|
package style
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
|
||||||
|
|
||||||
"github.com/gookit/color"
|
"github.com/gookit/color"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -27,23 +25,6 @@ import (
|
|||||||
// a string, we derive it when a new TextStyle is created and store it in the
|
// a string, we derive it when a new TextStyle is created and store it in the
|
||||||
// `style` field.
|
// `style` field.
|
||||||
|
|
||||||
// See https://github.com/xtermjs/xterm.js/issues/4238
|
|
||||||
// VSCode is soon to fix this in an upcoming update.
|
|
||||||
// Once that's done, we can scrap the HIDE_UNDERSCORES variable
|
|
||||||
var (
|
|
||||||
underscoreEnvChecked bool
|
|
||||||
hideUnderscores bool
|
|
||||||
)
|
|
||||||
|
|
||||||
func hideUnderScores() bool {
|
|
||||||
if !underscoreEnvChecked {
|
|
||||||
hideUnderscores = os.Getenv("TERM_PROGRAM") == "vscode"
|
|
||||||
underscoreEnvChecked = true
|
|
||||||
}
|
|
||||||
|
|
||||||
return hideUnderscores
|
|
||||||
}
|
|
||||||
|
|
||||||
type TextStyle struct {
|
type TextStyle struct {
|
||||||
fg *Color
|
fg *Color
|
||||||
bg *Color
|
bg *Color
|
||||||
@ -83,10 +64,6 @@ func (b TextStyle) SetBold() TextStyle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (b TextStyle) SetUnderline() TextStyle {
|
func (b TextStyle) SetUnderline() TextStyle {
|
||||||
if hideUnderScores() {
|
|
||||||
return b
|
|
||||||
}
|
|
||||||
|
|
||||||
b.decoration.SetUnderline()
|
b.decoration.SetUnderline()
|
||||||
b.Style = b.deriveStyle()
|
b.Style = b.deriveStyle()
|
||||||
return b
|
return b
|
||||||
|
Loading…
x
Reference in New Issue
Block a user