xi-editor / xi-mac

The xi-editor mac frontend.
Apache License 2.0
3.02k stars 147 forks source link

Diff annotations #478

Closed scholtzan closed 4 years ago

scholtzan commented 4 years ago

Summary

This PR adds support for showing the following diff annotations in the gutter:

screenshot

These annotations could be used for various things. At the moment they are required to make use of the git diff plugin I have been working on.

This PR is also related to https://github.com/xi-editor/xi-editor/pull/1236

Review Checklist

jansol commented 4 years ago

Looks good on a cursory glance, but is that Release.xcscheme addition intentional?

scholtzan commented 4 years ago

Thanks for the review! Currently annotations are only shown for files that are part of a git repository. I updated the plugin so that it does not try to remove the branch status item over and over again if it cannot find a branch for the current file.

I'm wondering if it might be useful to extend the status bar functionality in xi-editor and add a get_status_items() function. Right now plugins need to keep track themselves of the status items they add to the status bar.

nangtrongvuon commented 4 years ago

Yeah, that seems like a reasonable thing to add. It should be at most a few hours of work.

scholtzan commented 4 years ago

Thanks! I made the suggested changes.