Fix - don't switch windows/buffers to create a new hidden buffer
This commit is contained in:
parent
375ff4aa27
commit
98bef3db03
5 changed files with 155 additions and 58 deletions
|
|
@ -52,6 +52,12 @@ def BufferForFile( file_name ):
|
|||
return vim.buffers[ BufferNumberForFile( file_name ) ]
|
||||
|
||||
|
||||
def NewEmptyBuffer():
|
||||
bufnr = int( vim.eval( 'bufadd("")' ) )
|
||||
Call( 'bufload', bufnr )
|
||||
return vim.buffers[ bufnr ]
|
||||
|
||||
|
||||
def WindowForBuffer( buf ):
|
||||
for w in vim.current.tabpage.windows:
|
||||
if w.buffer == buf:
|
||||
|
|
@ -353,6 +359,7 @@ def AskForInput( prompt, default_value = None ):
|
|||
|
||||
|
||||
def AppendToBuffer( buf, line_or_lines, modified=False ):
|
||||
line = 1
|
||||
try:
|
||||
# After clearing the buffer (using buf[:] = None) there is always a single
|
||||
# empty line in the buffer object and no "is empty" method.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue