mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-10 20:05:50 +02:00
Merge pull request #2269 from jesseduffield/disable-underscores-in-vscode
This commit is contained in:
commit
db592e1dc6
1 changed files with 15 additions and 0 deletions
|
@ -1,6 +1,8 @@
|
||||||
package style
|
package style
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"os"
|
||||||
|
|
||||||
"github.com/gookit/color"
|
"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
|
// a string, we derive it when a new TextStyle is created and store it in the
|
||||||
// `style` field.
|
// `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 {
|
type TextStyle struct {
|
||||||
fg *Color
|
fg *Color
|
||||||
bg *Color
|
bg *Color
|
||||||
|
@ -64,6 +75,10 @@ func (b TextStyle) SetBold() TextStyle {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b TextStyle) SetUnderline() TextStyle {
|
func (b TextStyle) SetUnderline() TextStyle {
|
||||||
|
if HIDE_UNDERSCORES {
|
||||||
|
return b
|
||||||
|
}
|
||||||
|
|
||||||
b.decoration.SetUnderline()
|
b.decoration.SetUnderline()
|
||||||
b.Style = b.deriveStyle()
|
b.Style = b.deriveStyle()
|
||||||
return b
|
return b
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue