mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-18 19:15:09 +00:00
Revert 1ab4289
: Preview window of size 0 is allowed
This commit is contained in:
parent
9dc4b40d7a
commit
43798fc2e8
@ -995,7 +995,7 @@ func parsePreviewWindow(opts *previewOpts, input string) {
|
||||
opts.wrap = false
|
||||
|
||||
tokens := strings.Split(input, ":")
|
||||
sizeRegex := regexp.MustCompile("^[1-9][0-9]*%?$")
|
||||
sizeRegex := regexp.MustCompile("^[0-9]+%?$")
|
||||
offsetRegex := regexp.MustCompile("^\\+([0-9]+|{-?[0-9]+})(-[0-9]+|-/[1-9][0-9]*)?$")
|
||||
for _, token := range tokens {
|
||||
switch token {
|
||||
|
@ -1697,10 +1697,11 @@ func (t *Terminal) Loop() {
|
||||
// We don't display preview window if no match
|
||||
if items[0] != nil {
|
||||
command := t.replacePlaceholder(commandTemplate, false, string(t.Input()), items)
|
||||
height := t.pwindow.Height()
|
||||
offset := t.evaluateScrollOffset(items, height)
|
||||
offset := 0
|
||||
cmd := util.ExecCommand(command, true)
|
||||
if t.pwindow != nil {
|
||||
height := t.pwindow.Height()
|
||||
offset = t.evaluateScrollOffset(items, height)
|
||||
env := os.Environ()
|
||||
lines := fmt.Sprintf("LINES=%d", height)
|
||||
columns := fmt.Sprintf("COLUMNS=%d", t.pwindow.Width())
|
||||
|
Loading…
Reference in New Issue
Block a user