[pypy-svn] r53466 - pypy/dist/pypy/lib
arigo at codespeak.net
arigo at codespeak.net
Sun Apr 6 17:48:42 CEST 2008
Author: arigo
Date: Sun Apr 6 17:48:42 2008
New Revision: 53466
Modified:
pypy/dist/pypy/lib/readline.py
Log:
Tweaking.
Modified: pypy/dist/pypy/lib/readline.py
==============================================================================
--- pypy/dist/pypy/lib/readline.py (original)
+++ pypy/dist/pypy/lib/readline.py Sun Apr 6 17:48:42 2008
@@ -69,8 +69,12 @@
class maybe_accept(commands.Command):
def do(self):
r = self.reader
+ # if there are already several lines and the cursor
+ # is not on the last one, always insert a new \n.
text = r.get_unicode()
- if r.more_lines is not None and r.more_lines(text):
+ if "\n" in r.buffer[r.pos:]:
+ r.insert("\n")
+ elif r.more_lines is not None and r.more_lines(text):
r.insert("\n")
else:
self.finish = 1
More information about the Pypy-commit
mailing list