On 2021-06-29 4:18, jason404 wrote:
> Actually, what happens is that it opens an empty file for every actual
> file it opens.
That's to do with your xargs formulation (I've not worked out how), but
could you do the fzf equivalent of:
printf ".bashrc\0.bash_aliases\0.hosts\0" | xargs -0 ne
...which only opens one empty file at the start?
As for that first empty file, ne is seeing that stdin isn't a terminal
and assigning a buffer to it[0], in case you were piping something to
it. You can fix that with "-o":
printf ".bashrc\0.bash_aliases\0.hosts\0" | xargs -o -0 ne
Cheers,
[0]
https://github.com/vigna/ne/blob/87f5272787387fbd06f28a2c83ecf428e3687529/src/ne.c#L360-L371
>
> On Tuesday, 29 June 2021 at 04:12:01 UTC+1 jason404 wrote:
>
>> I have been using fzf as a way to select filenames to pipe to ne
>> using xargs, but I get unexpected results. It doesn't seem to have
>> to do with fzf itself, as it happens with whatever I use to pipe to
>> it.
>>
>> eg.
>>
>> $ printf ".bashrc\n.bash_aliases\n.hosts\n" | xargs -I {} ne -- {}
>>
>> This will open the three files in ne, but it also opens an empty
>> file with no filename. This doesn't happen with vim, so I don't
>> think I am doing anything wrong.
>>
>> Is there anything I can do to stop this from happening? I find fzf
>> is a useful way to select files.
>
> --
> You received this message because you are subscribed to the Google
> Groups "niceeditor" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
niceeditor+...@googlegroups.com.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/niceeditor/b283a550-a18d-43cf-98d9-055f7c5d7c05n%40googlegroups.com
> [1].
>
>
> Links:
> ------
> [1]
>
https://groups.google.com/d/msgid/niceeditor/b283a550-a18d-43cf-98d9-055f7c5d7c05n%40googlegroups.com?utm_medium=email&utm_source=footer