class_docstr: Control for visualising the content of a `Buffer`.
  
  :param input_processors: list of :class:`~prompt_toolkit.layout.processors.Processor`.
  :param lexer: :class:`~prompt_toolkit.layout.lexers.Lexer` instance for syntax highlighting.
  :param preview_search: `bool` or `CLIFilter`: Show search while typing.
  :param get_search_state: Callable that takes a CommandLineInterface and
      returns the SearchState to be used. (If not CommandLineInterface.search_state.)
  :param buffer_name: String representing the name of the buffer to display.
  :param default_char: :class:`.Char` instance to use to fill the background. This is
      transparent by default.
  :param focus_on_click: Focus this buffer when it's click, but not yet focussed.
class_docstr_tok: ["Control","for","visualising","the","content","of","a","`","Buffer","`",".",":","param","input_processors",":","list","of",":","class",":","`","~prompt_toolkit.layout.processors.Processor","`",".",":","param","lexer",":",":","class",":","`","~prompt_toolkit.layout.lexers.Lexer","`","instance","for","syntax","highlighting",".",":","param","preview_search",":","`","bool","`","or","`","CLIFilter","`",":","Show","search","while","typing",".",":","param","get_search_state",":","Callable","that","takes","a","CommandLineInterface","and","returns","the","SearchState","to","be","used",".","(","If","not","CommandLineInterface.search_state",".",")",":","param","buffer_name",":","String","representing","the","name","of","the","buffer","to","display",".",":","param","default_char",":",":","class",":","`",".Char","`","instance","to","use","to","fill","the","background",".","This","is","transparent","by","default",".",":","param","focus_on_click",":","Focus","this","buffer","when","it","'s","click",",","but","not","yet","focussed","."]
code: def __init__(
      self,
      buffer_name=DEFAULT_BUFFER,
      input_processors=None,
      lexer=None,
      preview_search=False,
      search_buffer_name=SEARCH_BUFFER,
      get_search_state=None,
      menu_position=None,
      default_char=None,
      focus_on_click=False,
  ):
      assert input_processors is None or all(
          isinstance(i, Processor) for i in input_processors
      )
      assert menu_position is None or callable(menu_position)
      assert lexer is None or isinstance(lexer, Lexer)
      assert get_search_state is None or callable(get_search_state)
      assert default_char is None or isinstance(default_char, Char)
  
      self.preview_search = to_cli_filter(preview_search)
      self.get_search_state = get_search_state
      self.focus_on_click = to_cli_filter(focus_on_click)
  
      self.input_processors = input_processors or []
      self.buffer_name = buffer_name
      self.menu_position = menu_position
      self.lexer = lexer or SimpleLexer()
      self.default_char = default_char or Char(token=Token.Transparent)
      self.search_buffer_name = search_buffer_name
  
      #: Cache for the lexer.
      #: Often, due to cursor movement, undo/redo and window resizing
      #: operations, it happens that a short time, the same document has to be
      #: lexed. This is a faily easy way to cache such an expensive operation.
      self._token_cache = SimpleCache(maxsize=8)
  
      self._xy_to_cursor_position = None
      self._last_click_timestamp = None
      self._last_get_processed_line = None
  
imports: from __future__ import unicode_literals
  from abc import ABCMeta, abstractmethod
  from collections import namedtuple
  from six import with_metaclass
  from six.moves import range
  from prompt_toolkit.cache import SimpleCache
  from prompt_toolkit.enums import DEFAULT_BUFFER, SEARCH_BUFFER
  from prompt_toolkit.filters import to_cli_filter
  from prompt_toolkit.mouse_events import MouseEventType
  from prompt_toolkit.search_state import SearchState
  from prompt_toolkit.selection import SelectionType
  from prompt_toolkit.token import Token
  from prompt_toolkit.utils import get_cwidth
  from .lexers import Lexer, SimpleLexer
  from .processors import Processor
  from .screen import Char, Point
  from .utils import token_list_width, split_lines, token_list_to_text
  import six
  import time
label_desc: Use image node_id 1 to create a new BufferControl object from inherited base classes: UIControl with example: obj = BufferControl(buffer_name, input_processors, lexer, preview_search, search_buffer_name, get_search_state, menu_position, default_char, focus_on_click)