def _add_editor_buffer(self, editor_buffer, show_in_current_window=False):
        """
        Insert this new buffer in the list of buffers, right after the active
        one.
        """
        assert isinstance(editor_buffer, EditorBuffer) and editor_buffer not in self.editor_buffers

        # Add to list of EditorBuffers
        eb = self.active_editor_buffer
        if eb is None:
            self.editor_buffers.append(editor_buffer)
        else:
            # Append right after the currently active one.
            try:
                index = self.editor_buffers.index(self.active_editor_buffer)
            except ValueError:
                index = 0
            self.editor_buffers.insert(index, editor_buffer)

        # When there are no tabs/windows yet, create one for this buffer.
        if self.tab_pages == []:
            self.tab_pages.append(TabPage(Window(editor_buffer)))
            self.active_tab_index = 0

        # To be shown?
        if show_in_current_window and self.active_tab:
            self.active_tab.show_editor_buffer(editor_buffer)

        # Start reporter.
        editor_buffer.run_reporter()
def _add_editor_buffer ( self , editor_buffer , show_in_current_window = False ) : assert isinstance ( editor_buffer , EditorBuffer ) and editor_buffer not in self . editor_buffers eb = self . active_editor_buffer if eb is None : self . editor_buffers . append ( editor_buffer ) else : try : index = self . editor_buffers . index ( self . active_editor_buffer ) except ValueError : index = 0 self . editor_buffers . insert ( index , editor_buffer ) if self . tab_pages == [ ] : self . tab_pages . append ( TabPage ( Window ( editor_buffer ) ) ) self . active_tab_index = 0 if show_in_current_window and self . active_tab : self . active_tab . show_editor_buffer ( editor_buffer ) editor_buffer . run_reporter ( )
Insert this new buffer in the list of buffers, right after the active
        one.