From 94087c1bda9dc3f64710174c3e1da264a821d438 Mon Sep 17 00:00:00 2001 From: Thomas Vanbesien Date: Thu, 11 Jun 2026 19:53:59 +0200 Subject: refactor(nvim): rewrite the buffer formatting flow --- after/ftplugin/python.lua | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'after/ftplugin/python.lua') diff --git a/after/ftplugin/python.lua b/after/ftplugin/python.lua index fa39ee8..63045ed 100644 --- a/after/ftplugin/python.lua +++ b/after/ftplugin/python.lua @@ -4,14 +4,4 @@ vim.opt_local.complete = { "o", -- 'omnifunc' } -vim.b.autoformat = true -vim.b.format_func = function() - local ret = vim.system({ "black", "--check", "-" }, { stdin = vim.api.nvim_buf_get_lines(0, 0, -1, false) }):wait() - if ret.code > 1 then - vim.notify("black failed (" .. ret.code .. "):\n" .. ret.stderr, vim.log.levels.WARN) - return - end - local view = vim.fn.winsaveview() - vim.cmd("%!black --quiet -") - vim.fn.winrestview(view) -end +vim.b.format = true -- See plugin/50-format.lua -- cgit v1.3.1