def CloseBuffersForFilename(filename):
 buffer_number = GetBufferNumberForFilename(filename, False)
 while (buffer_number != (-1)):
  vim.command(u'silent! bwipeout! {0}'.format(buffer_number))
  new_buffer_number = GetBufferNumberForFilename(filename, False)
  if (buffer_number == new_buffer_number):
   raise RuntimeError(u"Buffer {0} for filename '{1}' should already be wiped out.".format(buffer_number, filename))
  buffer_number = new_buffer_number

def CloseBuffersForFilename ( filename ) : buffer_number = GetBufferNumberForFilename ( filename , False ) while ( buffer_number != ( - 1 ) ) : vim . command ( u'silent! bwipeout! {0}' . format ( buffer_number ) ) new_buffer_number = GetBufferNumberForFilename ( filename , False ) if ( buffer_number == new_buffer_number ) : raise RuntimeError ( u"Buffer {0} for filename '{1}' should already be wiped out." . format ( buffer_number , filename ) ) buffer_number = new_buffer_number
close all buffers for a specific file .