Closed rafamadriz closed 2 weeks ago
EDIT: I just notice that I should've opened this as feature request or something, not a bug (that's just how buffers work) but can't modify it now
Unfortunately this is not possible with the limitations that oil is working with. We have to have a unique ID column present in the buffer. Using extmarks could be an interesting approach, but for now there does not appear to be a way to yank and paste extmarks.
Did you check the docs and existing issues?
Neovim version (nvim -v)
v0.9.5
Operating system/version
Arch linux 6.8.9-arch1-1
Describe the bug
If a column option is set, then renaming files with patterns that are also included is those columns, (e.g whitespace) results in files being corrupted (If rename is saved of course).
I found this while trying to replace all the whitespace in some filenames with
-
, so the files would besome-file
instead ofsome file
What is the severity of this bug?
tolerable (can work around it)
Steps To Reproduce
nvim -u repro.lua .
-
:%s/\s/-/g
and saveError detected while processing BufWriteCmd Autocommands for "oil://*":
Error parsing oil buffers
Expected Behavior
Only the filenames gets affected by the search and replace.
This is obviously a limitation of how buffers works, nothing that can be done about it. Solution is to disable all columns so you are just left with the plain filenames. Another solution I just thought is to give the option to toggle columns on demand, so if you need to do this kind of search replace, you can toggle them in the spot instead of going to your oil config, disabling them, reloading config, and finally going back to where you were.
However I just wanted to ask if adding the columns using the inlay text feature of nvim 0.10 would be something that's possible, inlay text is not editable text, so It wouldn't be affected by this type of edge cases of bulk rename.
Directory structure
No response
Repro
Did you check the bug with a clean config?
nvim -u repro.lua
using the repro.lua file above.