isort: restore cursor position
This commit is contained in:
parent
b5e79e7bf1
commit
acebf1a0ce
1 changed files with 5 additions and 1 deletions
|
@ -1,4 +1,8 @@
|
||||||
vim.api.nvim_create_autocmd( { "BufWritePre" }, {
|
vim.api.nvim_create_autocmd( { "BufWritePre" }, {
|
||||||
pattern = { "*.py", "*.pyi" },
|
pattern = { "*.py", "*.pyi" },
|
||||||
command = [[ :silent! %!/usr/bin/env isort -q - ]],
|
callback = function(ev)
|
||||||
|
local cursor = vim.api.nvim_win_get_cursor(0)
|
||||||
|
vim.api.nvim_command([[ :silent! %!/usr/bin/env isort -q - ]])
|
||||||
|
vim.api.nvim_win_set_cursor(0, cursor)
|
||||||
|
end
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue