code: def _create_buffer_control(self, editor_buffer):
          
          @Condition
          def preview_search():
              return self.editor.incsearch
  
          input_processors = [
              # Processor for visualising spaces. (should come before the
              # selection processor, otherwise, we won't see these spaces
              # selected.)
              ConditionalProcessor(
                  ShowTrailingWhiteSpaceProcessor(),
                  Condition(lambda: self.editor.display_unprintable_characters)),
  
              # Replace tabs by spaces.
              TabsProcessor(
                  tabstop=(lambda: self.editor.tabstop),
                  char1=(lambda: '|' if self.editor.display_unprintable_characters else ' '),
                  char2=(lambda: _try_char('\u2508', '.', get_app().output.encoding())
                                         if self.editor.display_unprintable_characters else ' '),
              ),
  
              # Reporting of errors, for Pyflakes.
              ReportingProcessor(editor_buffer),
              HighlightSelectionProcessor(),
              ConditionalProcessor(
                  HighlightSearchProcessor(),
                  Condition(lambda: self.editor.highlight_search)),
              ConditionalProcessor(
                  HighlightIncrementalSearchProcessor(),
                  Condition(lambda: self.editor.highlight_search) & preview_search),
              HighlightMatchingBracketProcessor(),
              DisplayMultipleCursors(),
          ]
  
          return BufferControl(
              lexer=DocumentLexer(editor_buffer),
              include_default_input_processors=False,
              input_processors=input_processors,
              buffer=editor_buffer.buffer,
              preview_search=preview_search,
              search_buffer_control=self.search_control,
              focus_on_click=True)
docs: Create a new BufferControl for a given location.