pull/3769/head
Junegunn Choi 1 month ago
parent 6be4d8c75e
commit 67acc6b5b0
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

@ -53,7 +53,6 @@ var offsetTrimCharsRegex *regexp.Regexp
var activeTempFiles []string var activeTempFiles []string
var activeTempFilesMutex sync.Mutex var activeTempFilesMutex sync.Mutex
var passThroughRegex *regexp.Regexp var passThroughRegex *regexp.Regexp
var actionTypeRegex *regexp.Regexp
const clearCode string = "\x1b[2J" const clearCode string = "\x1b[2J"
@ -2117,12 +2116,11 @@ func (t *Terminal) renderPreviewArea(unchanged bool) {
} }
height := t.pwindow.Height() height := t.pwindow.Height()
header := []string{}
body := t.previewer.lines body := t.previewer.lines
headerLines := t.previewOpts.headerLines headerLines := t.previewOpts.headerLines
// Do not enable preview header lines if it's value is too large // Do not enable preview header lines if it's value is too large
if headerLines > 0 && headerLines < util.Min(len(body), height) { if headerLines > 0 && headerLines < util.Min(len(body), height) {
header = t.previewer.lines[0:headerLines] header := t.previewer.lines[0:headerLines]
body = t.previewer.lines[headerLines:] body = t.previewer.lines[headerLines:]
// Always redraw header // Always redraw header
t.renderPreviewText(height, header, 0, false) t.renderPreviewText(height, header, 0, false)
@ -2499,8 +2497,6 @@ func parsePlaceholder(match string) (bool, string, placeholderFlags) {
case 'q': case 'q':
flags.forceUpdate = true flags.forceUpdate = true
// query flag is not skipped // query flag is not skipped
default:
break
} }
} }
@ -3430,8 +3426,7 @@ func (t *Terminal) Loop() error {
} }
var doAction func(*action) bool var doAction func(*action) bool
var doActions func(actions []*action) bool doActions := func(actions []*action) bool {
doActions = func(actions []*action) bool {
for iter := 0; iter <= maxFocusEvents; iter++ { for iter := 0; iter <= maxFocusEvents; iter++ {
currentIndex := t.currentIndex() currentIndex := t.currentIndex()
for _, action := range actions { for _, action := range actions {

@ -251,7 +251,7 @@ func (r *LightRenderer) getBytesInternal(buffer []byte, nonblock bool) ([]byte,
c, ok := r.getch(nonblock) c, ok := r.getch(nonblock)
if !nonblock && !ok { if !nonblock && !ok {
r.Close() r.Close()
return nil, errors.New("Failed to read " + consoleDevice) return nil, errors.New("failed to read " + consoleDevice)
} }
retries := 0 retries := 0
@ -282,7 +282,7 @@ func (r *LightRenderer) getBytesInternal(buffer []byte, nonblock bool) ([]byte,
// so terminate fzf immediately. // so terminate fzf immediately.
if len(buffer) > maxInputBuffer { if len(buffer) > maxInputBuffer {
r.Close() r.Close()
return nil, fmt.Errorf("Input buffer overflow (%d): %v", len(buffer), buffer) return nil, fmt.Errorf("input buffer overflow (%d): %v", len(buffer), buffer)
} }
} }

@ -57,7 +57,7 @@ func openTtyIn() (*os.File, error) {
return in, nil return in, nil
} }
} }
return nil, errors.New("Failed to open " + consoleDevice) return nil, errors.New("failed to open " + consoleDevice)
} }
return in, nil return in, nil
} }

Loading…
Cancel
Save