-
-
Notifications
You must be signed in to change notification settings - Fork 199
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
fix: changedelete symbol with linematch enabled #954
Conversation
lua/gitsigns/manager.lua
Outdated
-- To stop the sign column width changing too much, if there are signs to be | ||
-- added but none of them are visible in the window, then make sure to add at | ||
-- least one sign. Only do this on the first call after an update when we all | ||
-- the signs have been cleared. | ||
if clear and i == 1 then | ||
signs:add(bufnr, gs_hunks.calc_signs(hunk, hunk.added.start, hunk.added.start, untracked)) | ||
signs:add(bufnr, gs_hunks.calc_signs(hunk, hunk.added.start, hunk.added.start, untracked, changedelete)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be better to pass in next
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It felt consistent this way because untracked is also passed in. On the other hand it would put the actual sign calculation in calc_signs. Give me a moment, I'll change it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
93394bb
to
c8c854b
Compare
Since linematch will report a changed line following deleted lines as multiple hunks on a single line, it will only show the `changed` sign and will drop the `deleted` sign. To fix this check for overlapping hunks and mark the change hunk as changedelete.
BTW I think the default sign for 'changedelete' is a bit unfortunate. For me using a blend of change and delete is more intuitive. Are you open to change the default icons? I would recommend
This puts delete and topdelete on the second char of the sign, and changedelete is just a combination of both. |
Ideally, every hunk should get it's own sign. For changedelete, I think it would be better to use |
Since linematch will report a changed line following deleted lines as multiple hunks on a single line, it will only show the
changed
sign and will drop thedeleted
sign. To fix this check for overlapping hunks and mark the change hunk as changedelete.Fixes #701 in part