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:
parent
b187e6250e
commit
8b8ed1d164
@ -1,3 +1,4 @@
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
// Copyright 2019 The TCell Authors
|
||||
|
@ -1,3 +1,4 @@
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
// Copyright 2015 The TCell Authors
|
||||
|
@ -1,3 +1,4 @@
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
// Copyright 2019 The TCell Authors
|
||||
|
@ -1,3 +1,4 @@
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
// Copyright 2020 The TCell Authors
|
||||
|
@ -1,3 +1,4 @@
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
// Copyright 2019 The TCell Authors
|
||||
|
@ -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
|
||||
)
|
||||
|
||||
|
@ -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)
|
||||
|
@ -126,5 +126,5 @@ func registerAll() {
|
||||
}
|
||||
|
||||
func init() {
|
||||
registerAll();
|
||||
registerAll()
|
||||
}
|
||||
|
@ -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: 倀
|
||||
|
@ -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
|
||||
|
@ -1,3 +1,4 @@
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
// Copyright 2016 The Tcell Authors
|
||||
|
@ -1,3 +1,4 @@
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
// Copyright 2015 The Tops'l Authors
|
||||
|
@ -1,3 +1,4 @@
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
// Copyright 2015 The Tops'l Authors
|
||||
|
14
wscreen.go
14
wscreen.go
@ -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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user