1
0
mirror of https://github.com/gdamore/tcell.git synced 2025-04-24 13:48:51 +08:00

go fmt compliance fixes

This commit is contained in:
Garrett D'Amore 2023-08-14 18:27:44 -07:00
parent b187e6250e
commit 8b8ed1d164
15 changed files with 39 additions and 33 deletions

View File

@ -1,3 +1,4 @@
//go:build ignore
// +build ignore
// Copyright 2019 The TCell Authors

View File

@ -1,3 +1,4 @@
//go:build ignore
// +build ignore
// Copyright 2015 The TCell Authors

View File

@ -1,3 +1,4 @@
//go:build ignore
// +build ignore
// Copyright 2019 The TCell Authors

View File

@ -1,3 +1,4 @@
//go:build ignore
// +build ignore
// Copyright 2020 The TCell Authors

View File

@ -1,3 +1,4 @@
//go:build ignore
// +build ignore
// Copyright 2019 The TCell Authors

View File

@ -1217,8 +1217,7 @@ const (
modeCookedOut uint32 = 0x0001
modeVtOutput = 0x0004
modeNoAutoNL = 0x0008
// ENABLE_LVB_GRID_WORLDWIDE, needed to make underlines actually work.
modeUnderline = 0x0010
modeUnderline = 0x0010 // ENABLE_LVB_GRID_WORLDWIDE, needed for underlines
// modeWrapEOL = 0x0002
)

View File

@ -69,7 +69,6 @@ var encodingFallback EncodingFallback = EncodingFallbackFail
// The East Asian encodings have been seen to add 100-200K per encoding to the
// size of the resulting binary.
//
func RegisterEncoding(charset string, enc encoding.Encoding) {
encodingLk.Lock()
charset = strings.ToLower(charset)

View File

@ -126,5 +126,5 @@ func registerAll() {
}
func init() {
registerAll();
registerAll()
}

View File

@ -20,8 +20,8 @@ import (
)
func ExampleRegisterEncoding() {
RegisterEncoding("GBK", simplifiedchinese.GBK);
enc := GetEncoding("GBK");
RegisterEncoding("GBK", simplifiedchinese.GBK)
enc := GetEncoding("GBK")
glyph, _ := enc.NewDecoder().Bytes([]byte{0x82, 0x74})
fmt.Println(string(glyph))
// Output: 倀

View File

@ -349,8 +349,8 @@ func (t *tScreen) prepareBracketedPaste() {
func (t *tScreen) prepareExtendedOSC() {
// Linux is a special beast - because it has a mouse entry, but does
// not swallow these OSC commands properly.
if (strings.Contains(t.ti.Name, "linux")) {
return;
if strings.Contains(t.ti.Name, "linux") {
return
}
// More stuff for limits in terminfo. This time we are applying
// the most common OSC (operating system commands). Generally

View File

@ -1,3 +1,4 @@
//go:build ignore
// +build ignore
// Copyright 2016 The Tcell Authors

View File

@ -1,3 +1,4 @@
//go:build ignore
// +build ignore
// Copyright 2015 The Tops'l Authors

View File

@ -1,3 +1,4 @@
//go:build ignore
// +build ignore
// Copyright 2015 The Tops'l Authors

View File

@ -134,10 +134,10 @@ var palette = map[Color]int32{
}
func paletteColor(c Color) int32 {
if (c.IsRGB()) {
return int32(c & 0xffffff);
if c.IsRGB() {
return int32(c & 0xffffff)
}
if (c >= ColorBlack && c <= ColorWhite) {
if c >= ColorBlack && c <= ColorWhite {
return palette[c]
}
return c.Hex()
@ -155,11 +155,11 @@ func (t *wScreen) drawCell(x, y int) int {
}
fg, bg := paletteColor(style.fg), paletteColor(style.bg)
if (fg == -1) {
fg = 0xe5e5e5;
if fg == -1 {
fg = 0xe5e5e5
}
if (bg == -1) {
bg = 0x000000;
if bg == -1 {
bg = 0x000000
}
var combcarr []interface{} = make([]interface{}, len(combc))