Ale: Use setbufline() and deletebufline() for :ALEFix where available

Created on 20 Jul 2018  路  4Comments  路  Source: dense-analysis/ale

More recent Vim patches have setbufline() and deletebufline() functions for modifying buffers other than the current one. These functions can be used to fix buffers which are not in view straight away, instead of waiting for the user to switch to them again. These functions do not exist in NeoVim, but it does offer nvim_buf_set_lines in some versions. I am not sure if that function supports deleting lines or not.

enhancement

Most helpful comment

Getting errors on neovim with this....

Error detected while processing function <SNR>171_NeoVimCallback[29]..<lambda>68[1]..<SNR>166_ExitCallback[28]..<SNR>164_HandleExit[41]..<SNR>164_RunFixer[6]..
ale#fix#ApplyFixes[26]..ale#fix#ApplyQueuedFixes:
line   20:
E117: Unknown function: setbufline

All 4 comments

I have implemented this now. I tested out supporting nvim_buf_set_lines for NeoVim, but I decided against that because it causes the cursor to move around, and so it isn't usable.

Getting errors on neovim with this....

Error detected while processing function <SNR>171_NeoVimCallback[29]..<lambda>68[1]..<SNR>166_ExitCallback[28]..<SNR>164_HandleExit[41]..<SNR>164_RunFixer[6]..
ale#fix#ApplyFixes[26]..ale#fix#ApplyQueuedFixes:
line   20:
E117: Unknown function: setbufline

It seems https://github.com/neovim/neovim/pull/10059 introduced deletebufline to neovim head, but did not include setbufline, kind of annoying for this :/

@dsifford Now fixed thanks to @jwkvam.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

trevordmiller picture trevordmiller  路  3Comments

EdmundsEcho picture EdmundsEcho  路  3Comments

ilyakopy picture ilyakopy  路  4Comments

glepnir picture glepnir  路  3Comments

chauncey-garrett picture chauncey-garrett  路  3Comments