Skip to content

Commit 739b52c

Browse files
picobytepicobyte
picobyte
authored and
picobyte
committed
fix for windows
Signed-off-by: picobyte <[email protected]>
1 parent 5e3b600 commit 739b52c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

game/edit_button.rpy

+4-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ init -1500 python in _editor:
1919
from pygments import highlight
2020
from renpy_lexer import RenPyLexer
2121
from renpyformatter import RenPyFormatter
22-
from pygments.styles import get_style_by_name
2322

2423
class History(object):
2524
def __init__(self): self.reset()
@@ -116,7 +115,9 @@ init -1500 python in _editor:
116115
renpy.parser.parse_errors = []
117116
renpy.parser.parse(self.fname, document)
118117
escaped = re.sub(r'(?<!\{)(\{(\{\{)*)(?!\{)', r'{\1', re.sub(r'(?<!\[)(\[(\[\[)*)(?!\[)', r'[\1', document))
119-
self.colored_buffer = highlight(escaped, self.lexer, self.formater).split(os.linesep)
118+
119+
# NOTE: must split on newline here, not os.linesep, or it won't work in windows
120+
self.colored_buffer = highlight(escaped, self.lexer, self.formater).split('\n')
120121
self._last_parsed_changes = self.history.at
121122

122123
class TextView(object):
@@ -167,7 +168,7 @@ init -1500 python in _editor:
167168
self.rewrap()
168169
if self.show_errors is not None:
169170
err = renpy.parser.parse_errors
170-
self.show_errors = "\n{color=#f00}{size=-10}" + os.linesep.join(err) +"{/size}{/color}" if err else ""
171+
self.show_errors = os.linesep+"{color=#f00}{size=-10}" + os.linesep.join(err) +"{/size}{/color}" if err else ""
171172

172173
def UP(self, sub=1):
173174
sub = min(self.console.cy + self.lnr, sub)

0 commit comments

Comments
 (0)