Skip to content
Myr

Respect 'regular' attribute in 'bw' base theme

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Don't make the text bold if an element is explicitly specified as 'regular'. Fix #3222

authored by Junegunn Choi · committed by Junegunn Choi · parent d7daf5f · Browse files · 3 files+20 added−28 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+20 added−28 removed

  • other:+20 added−28 removed

3 files+20 added−28 removed

modified:src/tui/tui.go+19 added-19 removed
523 unmodified lines
524525func NoColorTheme() *ColorTheme {526 return &ColorTheme{527 Colored: false,528 Input: ColorAttr{colDefault, AttrRegular},529 Fg: ColorAttr{colDefault, AttrRegular},530 Bg: ColorAttr{colDefault, AttrRegular},531 DarkBg: ColorAttr{colDefault, AttrRegular},532 Prompt: ColorAttr{colDefault, AttrRegular},528 Input: ColorAttr{colDefault, AttrUndefined},529 Fg: ColorAttr{colDefault, AttrUndefined},530 Bg: ColorAttr{colDefault, AttrUndefined},531 DarkBg: ColorAttr{colDefault, AttrUndefined},532 Prompt: ColorAttr{colDefault, AttrUndefined},533 Match: ColorAttr{colDefault, Underline},534 Current: ColorAttr{colDefault, Reverse},535 CurrentMatch: ColorAttr{colDefault, Reverse | Underline},536 Spinner: ColorAttr{colDefault, AttrRegular},537 Info: ColorAttr{colDefault, AttrRegular},538 Cursor: ColorAttr{colDefault, AttrRegular},539 Selected: ColorAttr{colDefault, AttrRegular},540 Header: ColorAttr{colDefault, AttrRegular},541 Border: ColorAttr{colDefault, AttrRegular},542 BorderLabel: ColorAttr{colDefault, AttrRegular},543 Disabled: ColorAttr{colDefault, AttrRegular},544 PreviewFg: ColorAttr{colDefault, AttrRegular},545 PreviewBg: ColorAttr{colDefault, AttrRegular},546 Gutter: ColorAttr{colDefault, AttrRegular},547 PreviewLabel: ColorAttr{colDefault, AttrRegular},548 Separator: ColorAttr{colDefault, AttrRegular},549 Scrollbar: ColorAttr{colDefault, AttrRegular},536 Spinner: ColorAttr{colDefault, AttrUndefined},537 Info: ColorAttr{colDefault, AttrUndefined},538 Cursor: ColorAttr{colDefault, AttrUndefined},539 Selected: ColorAttr{colDefault, AttrUndefined},540 Header: ColorAttr{colDefault, AttrUndefined},541 Border: ColorAttr{colDefault, AttrUndefined},542 BorderLabel: ColorAttr{colDefault, AttrUndefined},543 Disabled: ColorAttr{colDefault, AttrUndefined},544 PreviewFg: ColorAttr{colDefault, AttrUndefined},545 PreviewBg: ColorAttr{colDefault, AttrUndefined},546 Gutter: ColorAttr{colDefault, AttrUndefined},547 PreviewLabel: ColorAttr{colDefault, AttrUndefined},548 Separator: ColorAttr{colDefault, AttrUndefined},549 Scrollbar: ColorAttr{colDefault, AttrUndefined},550 }551}552553func errorExit(message string) {
160 unmodified lines
modified:src/options.go+1 added-3 removed
2001 unmodified lines
2002 if opts.Bold {2003 theme := opts.Theme2004 boldify := func(c tui.ColorAttr) tui.ColorAttr {2005 dup := c2006 if !theme.Colored {2006 if (c.Attr & tui.AttrRegular) == 0 {2007 dup.Attr |= tui.Bold2008 } else if (c.Attr & tui.AttrRegular) == 0 {2009 dup.Attr |= tui.Bold2008 }2009 return dup2010 }2011 theme.Current = boldify(theme.Current)
43 unmodified lines
modified:src/terminal.go-6 removed
199 unmodified lines
200 ansi bool201 tabstop int202 margin [4]sizeSpec203 padding [4]sizeSpec204 strong tui.Attr204 unicode bool205 listenPort *int206 borderShape tui.BorderShape207 cleanExit bool
331 unmodified lines
539 // We need to start previewer if HTTP server is enabled even when --preview option is not specified540 if len(opts.Preview.command) > 0 || hasPreviewAction(opts) || opts.ListenPort != nil {541 previewBox = util.NewEventBox()542 }544 strongAttr := tui.Bold545 if !opts.Bold {546 strongAttr = tui.AttrRegular547 }543 var renderer tui.Renderer544 fullscreen := !opts.Height.auto && (opts.Height.size == 0 || opts.Height.percent && opts.Height.size == 100)545 if fullscreen {546 if tui.HasFullscreenRenderer() {
70 unmodified lines
617 previewLabel: nil,618 previewLabelOpts: opts.PreviewLabel,619 cleanExit: opts.ClearOnExit,620 paused: opts.Phony,626 strong: strongAttr,621 cycle: opts.Cycle,622 headerFirst: opts.HeaderFirst,623 headerLines: opts.HeaderLines,624 header: header,
2976 unmodified lines