mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-03-17 21:18:31 +02:00
disable underscores in vscode while we wait for underscore glitch to be fixed
This commit is contained in:
parent
5eeaebde98
commit
863a65cf94
@ -1,6 +1,8 @@
|
||||
package style
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/gookit/color"
|
||||
)
|
||||
|
||||
@ -25,6 +27,15 @@ import (
|
||||
// a string, we derive it when a new TextStyle is created and store it in the
|
||||
// `style` field.
|
||||
|
||||
var HIDE_UNDERSCORES bool
|
||||
|
||||
// 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
|
||||
func init() {
|
||||
HIDE_UNDERSCORES = os.Getenv("TERM_PROGRAM") == "vscode"
|
||||
}
|
||||
|
||||
type TextStyle struct {
|
||||
fg *Color
|
||||
bg *Color
|
||||
@ -64,6 +75,10 @@ func (b TextStyle) SetBold() TextStyle {
|
||||
}
|
||||
|
||||
func (b TextStyle) SetUnderline() TextStyle {
|
||||
if HIDE_UNDERSCORES {
|
||||
return b
|
||||
}
|
||||
|
||||
b.decoration.SetUnderline()
|
||||
b.Style = b.deriveStyle()
|
||||
return b
|
||||
|
Loading…
x
Reference in New Issue
Block a user