mirror of
https://github.com/tiyn/tidy.nvim.git
synced 2025-06-16 12:07:46 +02:00
check if buffer is modifiable
This commit is contained in:
parent
9b5bea8124
commit
1b83aba8f0
@ -66,11 +66,14 @@ function M.setup(opts)
|
||||
|
||||
local cursor_pos = vim.api.nvim_win_get_cursor(0)
|
||||
|
||||
|
||||
if vim.o.ma then
|
||||
-- delete trailing whitespace
|
||||
vim.cmd([[:keepjumps keeppatterns %s/\s\+$//e]])
|
||||
|
||||
-- delete lines @ eof
|
||||
vim.cmd([[:keepjumps keeppatterns silent! 0;/^\%(\n*.\)\@!/,$d_]])
|
||||
end
|
||||
|
||||
reset_cursor_pos(cursor_pos)
|
||||
end,
|
||||
|
Loading…
x
Reference in New Issue
Block a user