Closed kwagi closed 4 months ago
Oh i just found it on "do_fmt()" in format.lua
I don't know why but it deletes whole lines out of range.
local nameis1 = "something"
local nameis314 = "aaaa"
local nameis44444 = "bbbbb"
local nameis15151515 = "ccccccc"
When i selected line 2 and 3 for formatting, the result is
local nameis314 = 'aaaa'
local nameis44444 = 'bbbbb'
Line 1 and 4 is gone.
I guess it occurred with external formatter(python-black ,lua-stylua, go-gofumpt, etc..) not a "LSP-built-in".
Huh, that shouldn't happen, I will look into this.
Ah, commit f4438af broke range formatting @glepnir https://github.com/nvimdev/guard.nvim/blob/4ffdefe0f181ea7e449f60fe94ccc967220181c5/lua/guard/format.lua#L51
Ah, commit f4438af broke range formatting @glepnir
@xsh005 Do you know how to fix it ?
@Sologala I think you have to pass in the line range again and update accordingly, you could check the previous commits for reference, shouldn't be too hard of a pr :)
Any feature or api that select lines want to format, and activate with custom keymap.