travisjeffery/ClangFormat-Xcode — pull request #30 by awishnick (2014-05-12 15:15:44+00:00)
Title: Improvements to "Format Selected Text"

I've made some changes to the behavior to make the plugin behave more like the vim and Visual Studio plugins:

- Formatting single lines of code now works better. Before, only the selected text would be sent to clang-format, meaning that context such as indentation level would be ignored. I often found that I'd format text and it'd be un-indented. ClangFormat supports formatting just a range of lines, which is what happens now.
- Format selected text works when no text is selected, as in the vim and VS plugins. It'll format the line that the cursor's on. This is really useful for formatting as you type.
- There's an option (defaulted to off, for the current behavior) to use the version of ClangFormat that's in the path, rather than the binary bundled with the plugin. This makes it possible to easily upgrade ClangFormat without having to upgrade the plugin.

Let me know if there's anything I can do to get this in a state that's easier for you to merge. Thanks!