-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Multiple file behavior is surprising and limited (vs fzf) #496
Comments
Issue-Label Bot is automatically applying the label Links: app homepage, dashboard and code for this bot. |
This might be a bit confusing. Actually you can use Tab to select multiple entries and have to press Enter to open them using the quickfix window for the
Good point, this can be improved. |
@davidmathers This has been supported in https://github.com/liuchengxu/vim-clap/tree/support-open-action-for-multiple-selections. Let me know if you have more ideas. |
Perfect. And I do have more ideas :) First is something FZF does that some may disagree with but I think is good: if the current buffer is unused then it ignores the open action for the first file and executes 'edit' instead. That way the unused buffer vanishes, which I think is usually wanted. Second is support for using 'argadd' as an open action. Maybe I am the only person in the world who wants to use the arglist but it requires special handling. Here is an example. It seems to work except for the execute 'edit' line: let lines = s:get_opaque_lines()
" use current buffer if it is unused
if empty(expand('%')) && !&modified
execute 'edit' lines[0]
unlet lines[0]
endif
" If the open action uses the argument list then add the current file to the list
if g:clap.open_action[0:2] ==# 'arg' && argv(argidx()) !=# @%
execute 'argadd'
endif
for line in lines
call g:clap.provider.sink(line)
endfor |
Hmm, I don't quite get the point of your last ideas. You might want to customize the |
To clarify. If I am looking at an empty buffer and select 2 files and press ctrl-v: Using FZF I will be looking at 2 windows. One for each file. The Clap behavior makes perfect sense. But personally I prefer the FZF behavior as a convenience. I will learn about customizing the sink function and see if that solves my arglist problem. Thanks for making Clap! |
* Support open action for multiple selections Close #496 * Update CHANGELOG
Current behavior:
Desired behavior:
Using FZF I can select 2 files and press Ctrl-v to open them in splits. I was expecting the same behavior with Clap and was surprised when that didn't work.
I feel that the "open actions" should be applicable whether a single file is selected or multiple files are selected.
In FZF I have also added Ctrl-a for "argadd" to use the arglist when I want to open several files at once. I am prevented from doing the same with Clap.
The text was updated successfully, but these errors were encountered: