Commit 2618c7fa authored by Kurt B. Kaiser's avatar Kurt B. Kaiser

1. Mac line endings were incorrect when pasting code from some browsers

   when using X11 and the Fink distribution.  Python Bug 1263656.
2. Eliminate duplicated code in ScriptBinding.run_module_event()
Modified Files:
 	NEWS.txt ScriptBinding.py
parent 88b8582e
...@@ -3,6 +3,9 @@ What's New in IDLE 1.2a0? ...@@ -3,6 +3,9 @@ What's New in IDLE 1.2a0?
*Release date: XX-XXX-2005* *Release date: XX-XXX-2005*
- Mac line endings were incorrect when pasting code from some browsers
when using X11 and the Fink distribution. Python Bug 1263656.
- <Enter> when cursor is on a previous command retrieves that command. Instead - <Enter> when cursor is on a previous command retrieves that command. Instead
of replacing the input line, the previous command is now appended to the of replacing the input line, the previous command is now appended to the
input line. Indentation is preserved, and undo is enabled. input line. Indentation is preserved, and undo is enabled.
......
...@@ -53,7 +53,7 @@ class ScriptBinding: ...@@ -53,7 +53,7 @@ class ScriptBinding:
self.flist = self.editwin.flist self.flist = self.editwin.flist
self.root = self.flist.root self.root = self.flist.root
def check_module_event(self, event): def check_module_event(self, event=None):
filename = self.getfilename() filename = self.getfilename()
if not filename: if not filename:
return return
...@@ -87,6 +87,7 @@ class ScriptBinding: ...@@ -87,6 +87,7 @@ class ScriptBinding:
f.close() f.close()
if '\r' in source: if '\r' in source:
source = re.sub(r"\r\n", "\n", source) source = re.sub(r"\r\n", "\n", source)
source = re.sub(r"\r", "\n", source)
if source and source[-1] != '\n': if source and source[-1] != '\n':
source = source + '\n' source = source + '\n'
text = self.editwin.text text = self.editwin.text
...@@ -132,12 +133,7 @@ class ScriptBinding: ...@@ -132,12 +133,7 @@ class ScriptBinding:
add that directory to its sys.path if not already included. add that directory to its sys.path if not already included.
""" """
filename = self.getfilename() code = self.check_module_event(event)
if not filename:
return
if not self.tabnanny(filename):
return
code = self.checksyntax(filename)
if not code: if not code:
return return
shell = self.shell shell = self.shell
......
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