def buffer_create(self):
		self.config_load()

		# Open the window
		window_height = self.config['g:filepirate_max_results'] + 1
		vim.command('silent! topleft %dsplit FilePirate' % (window_height))

		for option in BUFFER_OPTIONS:
			vim.command('setlocal ' + option)

		assert 'FilePirate' in vim.current.buffer.name

		# Set the mode
		if self.config['g:filepirate_is_modal']:
			self.mode = MODE_INSERT
		else:
			self.mode = MODE_NOMODE

		# Set up the window.
		self.buffer_register_keys()
		self.buf = vim.current.buffer

		self.draw_search_line()
		self.unlock_buffer()
		for idx in range(self.config['g:filepirate_max_results']):
			if len(self.buf) - 2 < idx:
				self.buf.append('')
		self.lock_buffer()
		vim.current.window.cursor = (2, 0)
dataset/ETHPy150Open nfd/filepirate/plugin/vimfilepirate.py/VimFilePirate.buffer_create/original