mirror of
https://github.com/kennethreitz-archive/bpython-gist.git
synced 2026-06-05 23:50:18 +00:00
Extra linebreak added to stdout output and C-d behaviour changed.
The extra linebreak was irritating but I didn't notice it on my setup because I already have a linebreak on exit, or something. Also C-d now only exits if there's a blank line, as per the vanilla interpreter.
This commit is contained in:
+6
-3
@@ -578,7 +578,7 @@ class Repl( object ):
|
||||
"""This method returns the 'spoofed' stdout buffer, for writing to a file
|
||||
or sending to a pastebin or whatever."""
|
||||
|
||||
return self.stdout_hist#"\n".join( self.stdout_hist )
|
||||
return self.stdout_hist + '\n'
|
||||
|
||||
def write2file( self ):
|
||||
"""Prompt for a filename and write the current contents of the stdout buffer
|
||||
@@ -1006,8 +1006,11 @@ class Repl( object ):
|
||||
return ''
|
||||
|
||||
elif self.c in ( chr(4), '^D' ): # C-d
|
||||
self.do_exit = True
|
||||
return None
|
||||
if not self.s:
|
||||
self.do_exit = True
|
||||
return None
|
||||
else:
|
||||
return ''
|
||||
|
||||
elif self.c == 'KEY_F(2)':
|
||||
self.write2file()
|
||||
|
||||
Reference in New Issue
Block a user