Index: ppapi/generators/idl_c_proto.py |
diff --git a/ppapi/generators/idl_c_proto.py b/ppapi/generators/idl_c_proto.py |
index 2989a09afd449d61ba81780f1a3a1984720b30ce..0e0797ac42ce047e4b3050142f11bdd3203f6e84 100755 |
--- a/ppapi/generators/idl_c_proto.py |
+++ b/ppapi/generators/idl_c_proto.py |
@@ -606,8 +606,14 @@ class CGen(object): |
for line in data.split('\n'): |
# Add indentation |
line = tab + line |
- if len(line) <= 80: |
+ space_break = line.rfind(' ', 0, 80) |
+ if len(line) <= 80 or 'http' in line: |
+ # Ignore normal line and URLs permitted by the style guide. |
lines.append(line.rstrip()) |
+ elif not '(' in line and space_break >= 0: |
+ # Break long typedefs on nearest space. |
+ lines.append(line[0:space_break]) |
+ lines.append(' ' + line[space_break + 1:]) |
else: |
left = line.rfind('(') + 1 |
args = line[left:].split(',') |