-
-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keep extmarks as much as possible when reset hunk #637
Comments
function _G.resetBuffer(bufnr)
bufnr = bufnr or vim.api.nvim_get_current_buf()
local gs = require('gitsigns')
local hunks = gs.get_hunks(bufnr)
for i = #hunks, 1, -1 do
local hunk = hunks[i]
local added = hunk.added
gs.reset_hunk({added.start, added.start + math.max(0, added.count - 1)})
end
end This script works for me, feel free to close the issue if you want. |
Sorry, I really don't understand the feature you are asking for. Can you explain? I don't understand what |
|
Is your feature request related to a problem? Please describe.
reset_hunk
with range (maybe total buffer content) andreset_buffer
will replace range lines with lines in hunks.Describe the solution you'd like
Find all hunks and set lines one by one in the range. Maybe can set a limited value if the hunks are Intensive in the range.
Additional context
TBH, semantic tokens of coc.nvim and nvim-ufo use a lot of extmarks, that's the reason I want to replace
Gread
in fugitive withreset_buffer
in gitsigns.The text was updated successfully, but these errors were encountered: