The boolean value tells the function if the output of the command
contains column numbers, but we can just see the selected lines if they
contain column numbers.
The argument is now removed from the documentation, and will be silently
ignored for backward compatibility.
Close#1480
* [[B]Commits] Support arguments for git-log
Add support for command arguments that are passed to git-log (e.g.
:Commits -S foo -3).
The place of insertion is relevant. Generally the arguments should come
at the end to overwrite existing flags if necessary, but need to come
before the pathspec (i.e. `fzf#shellescape(current)`) in BCommits.
* [[B]Commits] Make sure all positional arguments are optional
Test cases:
" With default options
%call fzf#vim#commits()
" Full screen
%call fzf#vim#commits(1)
" Not full screen
%call fzf#vim#commits(0)
" With extra fzf options
%call fzf#vim#commits({ 'up': '50%', 'options': '--no-color' })
" With extra fzf options (with preview) and in full screen
%call fzf#vim#commits(fzf#vim#with_preview({ 'options': '--no-color', 'placeholder': '' }), 1)
" With extra git log options
%call fzf#vim#commits('-S foo')
" With extra git log options in full screen
%call fzf#vim#commits('-S foo', 1)
" With extra git log options and fzf options
%call fzf#vim#commits('-S foo', { 'options': '--no-color' })
" In full-screen
%call fzf#vim#commits('-S foo', { 'options': '--no-color' }, 1)
" Command form
Commits
Commits!
Commits -S foo
Commits! -S foo
* [Commits] Enable file completion for arguments
This gets handy when BCommits is too narrow (e.g. multiple files or a
folder is specified).
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
+ In `fzf#vim#helptags`, we now also parse out the ex-command in the
perl script so it's available for the preview (this is just an
extra `\t(.*)` appended to the original regex).
+ Add the `--tag` placeholder to `:Helptags` with corresponding
arguments.
In 161da95, [B]Commits were changed to range commands with -range=%, now
Vim jumps to the first line when these two commands are called directly
without specifying range.
This fixes it by saving window view in a temporary variable and
restoring it later. Reference: [1].
[1] https://vi.stackexchange.com/a/6037/33583
Before this patch, a search pattern starting with a dash like
`:Rg -bang` would fail (or exhibit the wrong behaviour) because it would
be treated as a option. However, this case is very common when searching
for ->member in a project in C, C++, PHP, etc.
Co-authored-by: Alexandre Perrin <alex@atipik.ch>
This allows us to use the return value of fzf#wrap function with
fzf#complete.
This commit also removes obsolete g:fzf#vim#default_layout and
fzf#vim#layout.
* Nanoseconds instead of seconds for buffer timestmaps
Fzf :Buffers uses a dictionary where it stores the last time accessed of
the current buffers. This is used to sort the buffers.
The timestamp is retrieved from a call to localtime() which returns the
current second the buffer is accessed. However, fzf functions in such a
way that before it enters the newly selected buffer, it enters the
current buffer. Sometimes this causes the last two buffers to have the
same timestamp. Repeatedly switching between two buffers yields
inconsistent results.
This commit fixes the issue by using seconds and microseconds from the
bash call `date`. The buffers are now guaranteed to be sorted by last
accessed.
* Use reltime() instead of linux date
This solution is better for compatability reasons.
* Remove trailing whitespace