Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RgRaw doesn't work if g:fzf_preview_window is list #18

Open
ipwnponies opened this issue Apr 24, 2021 · 0 comments
Open

RgRaw doesn't work if g:fzf_preview_window is list #18

ipwnponies opened this issue Apr 24, 2021 · 0 comments

Comments

@ipwnponies
Copy link
Contributor

Latest version of fzf-vim has updated g:fzf_preview_window from a string to a list. This was to allow adding bind for toggling preview window.

From doc:

" This is the default option:
" - Preview window on the right with 50% width
" - CTRL-/ will toggle preview window.
" - Note that this array is passed as arguments to fzf#vim#with_preview function.
" - To learn more about preview window options, see --preview-window section of man fzf.
let g:fzf_preview_window = ['right:50%', 'ctrl-/']

It seems like s:preview was copied from fzf-vim and needs to be updated, can be pulled from junegunn/fzf.vim@44057cc#diff-f697bec8f1ba94d14196b753546e9fe6a486a33e10f25afb42765573c991fa0fR42

function! s:preview(bang, ...)
let preview_window = get(g:, 'fzf_preview_window', a:bang && &columns >= 80 || &columns >= 120 ? 'right': '')
if len(preview_window)
return call('fzf#vim#with_preview', add(copy(a:000), preview_window))

But before we do that, we should consider not vendoring this function altogether. The value it added was conditionally setting g:preview_window = 'right' if the screen was wide enough but it no longer that does in upstream (maybe the logic was moved elsewhere?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant