Fix clang-format-sublime plugin for Sublime Text 3

Sean Silva silvas at purdue.edu
Fri Nov 8 14:51:46 PST 2013


Thanks. Committed as r194287.

-- Sean Silva


On Fri, Nov 8, 2013 at 5:07 PM, Johan Engelen <jbc.engelen at swissonline.ch>wrote:

>  Thanks for the feedback. I have attached the improved patch.
>
> Thanks,
>   Johan
>
>
>
> On 8-11-2013 22:25, Sean Silva wrote:
>
> Your patch doesn't do what you think. In Python 2, it is still invoking a
> print statement with the expression `(error)` which happens to evaluate to
> just `error`. You need a `from __future__ import print_function`, which
> will make it be a function call in both Python 2 and 3.
>
>  -- Sean Silva
>
>
> On Fri, Nov 8, 2013 at 3:57 PM, Johan Engelen <jbc.engelen at swissonline.ch>wrote:
>
>> Hi all,
>>   Sublime Text 3 uses Python 3.3 for its plugins (instead of 2.6 that
>> Sublime Text 2 uses). The attached patch fixes clang-format-sublime.py to
>> work in Sublime Text 3.
>> I am not a Python expert, but it seems for this plugin, the only relevant
>> change is that "print" became a function, so parens are needed.
>> I tested the change and the patched plugin works in both Sublime Text 2
>> and 3.
>>
>> Thanks for the review, (and commit ;)
>>   Johan
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131108/d31ccee5/attachment.html>


More information about the cfe-commits mailing list