diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2024-06-01 14:13:24 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2024-06-01 14:35:45 +0900 |
| commit | 555b0d235bd29ace645c263ef2fdb744717f8885 (patch) | |
| tree | d93868b5e180a2c96bbdfe22648474e47d9a2465 /src/options.go | |
| parent | 564daf9a7d2f8ad5ed67d7e24191e263ee17633d (diff) | |
| download | fzf-555b0d235bd29ace645c263ef2fdb744717f8885.tar.gz | |
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'
Diffstat (limited to 'src/options.go')
| -rw-r--r-- | src/options.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/options.go b/src/options.go index 18e40409..78b8dd0d 100644 --- a/src/options.go +++ b/src/options.go @@ -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()) } |
