code styles

pull/3769/head
Junegunn Choi 2 weeks ago
parent 017922a9b8
commit ebe1cad53a
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

@ -10,8 +10,8 @@ import (
"github.com/junegunn/fzf/src/protector"
)
var version string = "0.51"
var revision string = "devel"
var version = "0.51"
var revision = "devel"
//go:embed shell/key-bindings.bash
var bashKeyBindings []byte

@ -152,7 +152,7 @@ var (
// Extra bonus for word boundary after slash, colon, semi-colon, and comma
bonusBoundaryDelimiter int16 = bonusBoundary + 1
initialCharClass charClass = charWhite
initialCharClass = charWhite
// A minor optimization that can give 15%+ performance boost
asciiCharClasses [unicode.MaxASCII + 1]charClass

@ -3,7 +3,7 @@
package algo
var normalized map[rune]rune = map[rune]rune{
var normalized = map[rune]rune{
0x00E1: 'a', // WITH ACUTE, LATIN SMALL LETTER
0x0103: 'a', // WITH BREVE, LATIN SMALL LETTER
0x01CE: 'a', // WITH CARON, LATIN SMALL LETTER

@ -350,7 +350,7 @@ func interpretCode(ansiCode string, prevState *ansiState) ansiState {
state256 := 0
ptr := &state.fg
var delimiter byte = 0
var delimiter byte
count := 0
for len(ansiCode) != 0 {
var num int

@ -110,9 +110,8 @@ func startHttpServer(address listenAddress, actionChannel chan []*action, respon
if err != nil {
if errors.Is(err, net.ErrClosed) {
return
} else {
continue
}
continue
}
conn.Write([]byte(server.handleHttpRequest(conn)))
conn.Close()

@ -2244,9 +2244,8 @@ Loop:
t.pwindow.Move(height-1, maxWidth-1)
t.previewed.filled = true
break Loop
} else {
t.pwindow.MoveAndClear(y+requiredLines, 0)
}
t.pwindow.MoveAndClear(y+requiredLines, 0)
}
}
@ -3173,7 +3172,7 @@ func (t *Terminal) Loop() error {
}
go func() {
var focusedIndex int32 = minItem.Index()
var focusedIndex = minItem.Index()
var version int64 = -1
running := true
code := ExitError
@ -4072,10 +4071,10 @@ func (t *Terminal) Loop() error {
}
if me.Down {
mx_cons := util.Constrain(mx-t.promptLen, 0, len(t.input))
if my == t.promptLine() && mx_cons >= 0 {
mxCons := util.Constrain(mx-t.promptLen, 0, len(t.input))
if my == t.promptLine() && mxCons >= 0 {
// Prompt
t.cx = mx_cons + t.xoffset
t.cx = mxCons + t.xoffset
} else if my >= min {
t.vset(t.offset + my - min)
req(reqList)

@ -8,7 +8,7 @@ func HasFullscreenRenderer() bool {
return false
}
var DefaultBorderShape BorderShape = BorderRounded
var DefaultBorderShape = BorderRounded
func (a Attr) Merge(b Attr) Attr {
return a | b

@ -29,8 +29,8 @@ const (
const consoleDevice string = "/dev/tty"
var offsetRegexp *regexp.Regexp = regexp.MustCompile("(.*)\x1b\\[([0-9]+);([0-9]+)R")
var offsetRegexpBegin *regexp.Regexp = regexp.MustCompile("^\x1b\\[[0-9]+;[0-9]+R")
var offsetRegexp = regexp.MustCompile("(.*)\x1b\\[([0-9]+);([0-9]+)R")
var offsetRegexpBegin = regexp.MustCompile("^\x1b\\[[0-9]+;[0-9]+R")
func (r *LightRenderer) PassThrough(str string) {
r.queued.WriteString("\x1b7" + str + "\x1b8")

Loading…
Cancel
Save