m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-13 13:53:47 -05:00

Add --info=right

Related: #3322
This commit is contained in:
Junegunn Choi
2023-06-11 00:04:24 +09:00
parent e627ca6bd7
commit d0b7780239
4 changed files with 59 additions and 7 deletions

View File

@@ -72,7 +72,8 @@ const usage = `usage: fzf [options]
(default: 0 or center)
--margin=MARGIN Screen margin (TRBL | TB,RL | T,RL,B | T,R,B,L)
--padding=PADDING Padding inside border (TRBL | TB,RL | T,RL,B | T,R,B,L)
--info=STYLE Finder info style [default|hidden|inline[:SEPARATOR]|inline-right]
--info=STYLE Finder info style
[default|right|hidden|inline[:SEPARATOR]|inline-right]
--separator=STR String to form horizontal separator on info line
--no-separator Hide info line separator
--scrollbar[=C1[C2]] Scrollbar character(s) (each for main and preview window)
@@ -194,11 +195,16 @@ type infoStyle int
const (
infoDefault infoStyle = iota
infoRight
infoInline
infoInlineRight
infoHidden
)
func (s infoStyle) noExtraLine() bool {
return s == infoInline || s == infoInlineRight || s == infoHidden
}
type labelOpts struct {
label string
column int
@@ -1377,6 +1383,8 @@ func parseInfoStyle(str string) (infoStyle, string) {
switch str {
case "default":
return infoDefault, ""
case "right":
return infoRight, ""
case "inline":
return infoInline, defaultInfoSep
case "inline-right":
@@ -1388,7 +1396,7 @@ func parseInfoStyle(str string) (infoStyle, string) {
if strings.HasPrefix(str, prefix) {
return infoInline, strings.ReplaceAll(str[len(prefix):], "\n", " ")
}
errorExit("invalid info style (expected: default|hidden|inline[:SEPARATOR]|inline-right)")
errorExit("invalid info style (expected: default|right|hidden|inline[:SEPARATOR]|inline-right)")
}
return infoDefault, ""
}