timbrel / GitSavvy

Full git and GitHub integration with Sublime Text
MIT License
1.9k stars 136 forks source link

For addition only hunks assume the hunk is selected #1862

Closed kaste closed 8 months ago

kaste commented 8 months ago

When the user did not select anything in a diff, we construct a virtual selection by ourself. Typically it looks slightly better if we only select the changed lines, t.i. we do not include the leading and trailing context lines as the history gets too broad quickly.

In case of "addition only hunks" this is counterproductive though as by definition the added lines don't have any history in the repo.

Therefore select the whole hunk with the context lines in that case.