Imrpove console evaluation somewhat. Fix restart bug not resetting connection in the console view

This commit is contained in:
Ben Jackson 2018-12-19 01:33:21 +00:00
commit 256579c4d8
3 changed files with 11 additions and 4 deletions

View file

@ -201,7 +201,7 @@ def AskForInput( prompt ):
return vim.eval( "input( '{0}' )".format( Escape( prompt ) ) )
def AppendToBuffer( buf, line_or_lines ):
def AppendToBuffer( buf, line_or_lines, modified=False ):
# After clearing the buffer (using buf[:] = None) there is always a single
# empty line in the buffer object and no "is empty" method.
if len( buf ) > 1 or buf[ 0 ]:
@ -214,6 +214,9 @@ def AppendToBuffer( buf, line_or_lines ):
line = 1
buf[:] = line_or_lines
if not modified:
buf.options[ 'modified' ] = False
# Return the first Vim line number (1-based) that we just set.
return line