Commit 4e6b3c55 authored by Just van Rossum's avatar Just van Rossum

Fix for [ 782686 ]: new files used \r as the default line separator

instead of os.linesep.
parent c0b2b727
......@@ -57,21 +57,18 @@ class Editor(W.Window):
f.close()
self._creator, filetype = MacOS.GetCreatorAndType(path)
self.addrecentfile(path)
if '\n' in text:
if string.find(text, '\r\n') >= 0:
self._eoln = '\r\n'
else:
self._eoln = '\n'
text = string.replace(text, self._eoln, '\r')
else:
self._eoln = '\r'
else:
raise IOError, "file '%s' does not exist" % path
self.path = path
if '\n' in text:
if string.find(text, '\r\n') >= 0:
self._eoln = '\r\n'
else:
self._eoln = '\n'
text = string.replace(text, self._eoln, '\r')
change = 0
else:
change = 0
self._eoln = '\r'
self.settings = {}
if self.path:
self.readwindowsettings()
......@@ -93,8 +90,6 @@ class Editor(W.Window):
W.Window.__init__(self, bounds, self.title, minsize = (330, 120), tabbable = 0)
self.setupwidgets(text)
if change > 0:
self.editgroup.editor.textchanged()
if self.settings.has_key("selection"):
selstart, selend = self.settings["selection"]
......
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