diff options
| author | 2026-04-17 10:53:15 +0100 | |
|---|---|---|
| committer | 2026-04-17 10:53:15 +0100 | |
| commit | 167a01e62298f8f5aaee3e428a06d3338357a614 (patch) | |
| tree | 39cb07562ff12ef5beb1711dc589d1b10fd3f082 | |
| parent | 355573f9f8632779843bf1d59de94c68a0d07b8b (diff) | |
| download | dotfiles-167a01e62298f8f5aaee3e428a06d3338357a614.tar.gz dotfiles-167a01e62298f8f5aaee3e428a06d3338357a614.tar.bz2 dotfiles-167a01e62298f8f5aaee3e428a06d3338357a614.zip | |
chore: delete dead config/utils.lua
format_hunks is defined but never called anywhere.
| -rw-r--r-- | home/.config/nvim/lua/config/utils.lua | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/home/.config/nvim/lua/config/utils.lua b/home/.config/nvim/lua/config/utils.lua deleted file mode 100644 index 300d7a7..0000000 --- a/home/.config/nvim/lua/config/utils.lua +++ /dev/null @@ -1,29 +0,0 @@ -local M = {} -local gitsigns = require("gitsigns") -local conform = require("conform") - -function M.format_hunks(options) - local hunks = gitsigns.get_hunks() - if not hunks or vim.tbl_isempty(hunks) then - return - end - for _, hunk in ipairs(hunks) do - if hunk and hunk.added then - local start = hunk.added.start - local last = start + hunk.added.count - -- nvim_buf_get_lines uses zero-based indexing -> subtract from last - local last_hunk_line = - vim.api.nvim_buf_get_lines(0, last - 2, last - 1, true)[1] - local range = - { start = { start, 0 }, ["end"] = { last - 1, last_hunk_line:len() } } - options = vim.tbl_extend( - "force", - { range = range, lsp_fallback = true, quiet = true }, - options or {} - ) - conform.format(options) - end - end -end - -return M |
