mirror of
https://github.com/junegunn/fzf.git
synced 2026-08-02 06:00:32 +08:00
+6
-4
@@ -384,7 +384,7 @@ Use black background
|
|||||||
|
|
||||||
.SS DISPLAY MODE
|
.SS DISPLAY MODE
|
||||||
.TP
|
.TP
|
||||||
.BI "\-\-height=" "[~]HEIGHT[%]"
|
.BI "\-\-height=" "[~][\-]HEIGHT[%]"
|
||||||
Display fzf window below the cursor with the given height instead of using
|
Display fzf window below the cursor with the given height instead of using
|
||||||
the full screen.
|
the full screen.
|
||||||
|
|
||||||
@@ -394,17 +394,19 @@ height minus the given value.
|
|||||||
fzf \-\-height=\-1
|
fzf \-\-height=\-1
|
||||||
|
|
||||||
When prefixed with \fB~\fR, fzf will automatically determine the height in the
|
When prefixed with \fB~\fR, fzf will automatically determine the height in the
|
||||||
range according to the input size.
|
range according to the input size. You can combine \fB~\fR with a negative
|
||||||
|
value.
|
||||||
|
|
||||||
# Will not take up 100% of the screen
|
# Will not take up 100% of the screen
|
||||||
seq 5 | fzf \-\-height=~100%
|
seq 5 | fzf \-\-height=~100%
|
||||||
|
|
||||||
|
# Adapt to input size, up to terminal height minus 1
|
||||||
|
seq 5 | fzf \-\-height=~\-1
|
||||||
|
|
||||||
Adaptive height has the following limitations:
|
Adaptive height has the following limitations:
|
||||||
.br
|
.br
|
||||||
* Cannot be used with top/bottom margin and padding given in percent size
|
* Cannot be used with top/bottom margin and padding given in percent size
|
||||||
.br
|
.br
|
||||||
* Negative value is not allowed
|
|
||||||
.br
|
|
||||||
* It will not find the right size when there are multi-line items
|
* It will not find the right size when there are multi-line items
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
|
|||||||
+2
-5
@@ -66,7 +66,7 @@ Usage: fzf [options]
|
|||||||
--no-bold Do not use bold text
|
--no-bold Do not use bold text
|
||||||
|
|
||||||
DISPLAY MODE
|
DISPLAY MODE
|
||||||
--height=[~]HEIGHT[%] Display fzf window below the cursor with the given
|
--height=[~][-]HEIGHT[%] Display fzf window below the cursor with the given
|
||||||
height instead of using fullscreen.
|
height instead of using fullscreen.
|
||||||
A negative value is calculated as the terminal height
|
A negative value is calculated as the terminal height
|
||||||
minus the given value.
|
minus the given value.
|
||||||
@@ -2222,9 +2222,6 @@ func parseHeight(str string, index int) (heightSpec, error) {
|
|||||||
str = str[1:]
|
str = str[1:]
|
||||||
}
|
}
|
||||||
if strings.HasPrefix(str, "-") {
|
if strings.HasPrefix(str, "-") {
|
||||||
if heightSpec.auto {
|
|
||||||
return heightSpec, errors.New("negative(-) height is not compatible with adaptive(~) height")
|
|
||||||
}
|
|
||||||
heightSpec.inverse = true
|
heightSpec.inverse = true
|
||||||
str = str[1:]
|
str = str[1:]
|
||||||
}
|
}
|
||||||
@@ -3152,7 +3149,7 @@ func parseOptions(index *int, opts *Options, allArgs []string) error {
|
|||||||
}
|
}
|
||||||
opts.PreviewWrapSign = &str
|
opts.PreviewWrapSign = &str
|
||||||
case "--height":
|
case "--height":
|
||||||
str, err := nextString("height required: [~]HEIGHT[%]")
|
str, err := nextString("height required: [~][-]HEIGHT[%]")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user