Closed Sologala closed 5 months ago
I know https://github.com/nvimdev/guard.nvim/commit/81a0995f07cc370fbf15d6d03abc4b1f8651d23f is not the latest guard.nvim version, But newest commit has the issus of deleteing some lines; https://github.com/nvimdev/guard.nvim/issues/145#issuecomment-1975368878
There's not much we could do about that unfourtunately :( In fact in the README:
Use GuardFmt to manually call format, when there is a visual selection only the selection is formatted. NOTE: Regional formatting just sends your selection to the formatter, if there's not enough context incoherent formatting might occur (
e.g. indent being erased
)
There's just not enough context in terms what one actually wants when asking for range formatting, in addition to the fact that the surrounding context may not even be formatted by the formatter you are using.
Guard.nvim version 81a0995f07cc370fbf15d6d03abc4b1f8651d23f neovim version : NVIM v0.9.4
Reproduce steps:
v
to get into visual mode, and move cursor to select target lines.<leader>f
to trigger guardfmt The result are recorded as following:The guard config: