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

Ignore --height option if it's not supported on the platform

This is to make shell integration work out of the box on Git bash.

  eval "$(fzf --bash)"
  vim <CTRL-T>
    # would print '--height option is currently not supported on this platform'
This commit is contained in:
Junegunn Choi
2024-06-01 14:13:24 +09:00
parent 564daf9a7d
commit 555b0d235b
2 changed files with 6 additions and 6 deletions

View File

@@ -2685,10 +2685,6 @@ func validateOptions(opts *Options) error {
}
}
if !tui.IsLightRendererSupported() && opts.Height.size > 0 {
return errors.New("--height option is currently not supported on this platform")
}
if opts.Scrollbar != nil {
runes := []rune(*opts.Scrollbar)
if len(runes) > 2 {
@@ -2841,6 +2837,11 @@ func postProcessOptions(opts *Options) error {
theme.Spinner = boldify(theme.Spinner)
}
// If --height option is not supported on the platform, just ignore it
if !tui.IsLightRendererSupported() && opts.Height.size > 0 {
opts.Height = heightSpec{}
}
if err := opts.initProfiling(); err != nil {
return errors.New("failed to start pprof profiles: " + err.Error())
}