fileline.nvim icon indicating copy to clipboard operation
fileline.nvim copied to clipboard

Handling multiple files on the command line.

Open dsully opened this issue 2 years ago • 3 comments
trafficstars

I'm looking to use fileline.nvim instead of my own version (https://github.com/dsully/nvim/blob/main/lua/config/autocommands.lua#L69) that was originally inspired by vim-fetch, but is somewhat fragile.

However, fileline.nvim doesn't support loading multiple files properly via the command line, eg:

nvim /path/to/file-a:10 file-b:41:5

I started looking into this again due to the new "ignore swap file" feature in nightly, which doesn't work with my implementation.

Thanks

dsully avatar Oct 26 '23 13:10 dsully

Ping. (II saw you update a bunch of hover.nvim issues & PRs recently. Could use some ❤️ over here. :)

dsully avatar Jan 24 '24 15:01 dsully

Will accept a PR.

lewis6991 avatar Jan 24 '24 15:01 lewis6991

I'm not sure the best/correct way to do this actually.. for example, if I run:

nvim lua/plugins/init.lua:5 filetype.lua:10

Then the following happens - output of :buffers:

CleanShot 2024-01-24 at 07 27 39@2x

And my bufferline.nvim is not ordered correctly (which is a side effect of the 2nd+ file not being loaded correctly:

CleanShot 2024-01-24 at 07 26 40@2x

Which I believe is the BufNewFile not being loaded for the Nth file. If I change the callback to emit a notification:

callback = function(event)
    vim.notify("Loading: " .. event.file)
    require("fileline").gotoline()
end

Only the first file is emitted. If I change to the next buffer, bufferline.nvim switches the "tabs" and a new notification event is emitted for the 2nd file.

dsully avatar Jan 24 '24 15:01 dsully