Commit f868ae2c authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

In the PR file indent nicely the Text areas

parent 21bb65d3
......@@ -142,6 +142,9 @@ The background pattern was downloaded from www.subtlepatterns.com
Changelog
=========
1.5.24 (01/2017)
- PR file use better indentation for text areas (no line return)
1.5.23 (12/2016)
- In simulation mode, bugfix in the declaration of the startup function
- Code generator prepared for model checking
......
......@@ -291,7 +291,9 @@ def _textsymbol(symbol, **kwargs):
result.append(cif_coord('TEXT', symbol))
if symbol.text.hyperlink:
result.append(hyperlink(symbol))
result.append(unicode(symbol.text))
# Align nicely the text (parser will dedent it)
for line in unicode(symbol.text).split('\n'):
result.append(line)
result.append(u'/* CIF ENDTEXT */')
return result
......
......@@ -32,6 +32,7 @@ import math
import logging
import traceback
import binascii
from textwrap import dedent
from itertools import chain, permutations, combinations
from collections import defaultdict, Counter
import antlr3
......@@ -2614,8 +2615,9 @@ def text_area(root, parent=None, context=None):
warnings.extend(warn)
elif child.type == lexer.ENDTEXT:
userTextStopIndex = child.getTokenStartIndex() - 1
ta.inputString = token_stream(child).toString(
userTextStartIndex, userTextStopIndex).strip()
string = token_stream(child).toString(userTextStartIndex,
userTextStopIndex)
ta.inputString = dedent(string).strip()
elif child.type == lexer.HYPERLINK:
ta.hyperlink = child.getChild(0).toString()[1:-1]
else:
......
......@@ -138,7 +138,7 @@ except ImportError:
__all__ = ['opengeode', 'SDL_Scene', 'SDL_View', 'parse']
__version__ = '1.5.23'
__version__ = '1.5.24'
if hasattr(sys, 'frozen'):
# Detect if we are running on Windows (py2exe-generated)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment