本文整理匯總了Python中prompt_toolkit.token.Token.CursorColumn方法的典型用法代碼示例。如果您正苦於以下問題:Python Token.CursorColumn方法的具體用法?Python Token.CursorColumn怎麽用?Python Token.CursorColumn使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類prompt_toolkit.token.Token
的用法示例。
在下文中一共展示了Token.CursorColumn方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from prompt_toolkit.token import Token [as 別名]
# 或者: from prompt_toolkit.token.Token import CursorColumn [as 別名]
def __init__(self, content, width=None, height=None, get_width=None,
get_height=None, dont_extend_width=False, dont_extend_height=False,
left_margins=None, right_margins=None, scroll_offsets=None,
allow_scroll_beyond_bottom=False, wrap_lines=False,
get_vertical_scroll=None, get_horizontal_scroll=None, always_hide_cursor=False,
cursorline=False, cursorcolumn=False, get_colorcolumns=None,
cursorline_token=Token.CursorLine, cursorcolumn_token=Token.CursorColumn):
assert isinstance(content, UIControl)
assert width is None or isinstance(width, LayoutDimension)
assert height is None or isinstance(height, LayoutDimension)
assert get_width is None or callable(get_width)
assert get_height is None or callable(get_height)
assert width is None or get_width is None
assert height is None or get_height is None
assert scroll_offsets is None or isinstance(scroll_offsets, ScrollOffsets)
assert left_margins is None or all(isinstance(m, Margin) for m in left_margins)
assert right_margins is None or all(isinstance(m, Margin) for m in right_margins)
assert get_vertical_scroll is None or callable(get_vertical_scroll)
assert get_horizontal_scroll is None or callable(get_horizontal_scroll)
assert get_colorcolumns is None or callable(get_colorcolumns)
self.allow_scroll_beyond_bottom = to_cli_filter(allow_scroll_beyond_bottom)
self.always_hide_cursor = to_cli_filter(always_hide_cursor)
self.wrap_lines = to_cli_filter(wrap_lines)
self.cursorline = to_cli_filter(cursorline)
self.cursorcolumn = to_cli_filter(cursorcolumn)
self.content = content
self.dont_extend_width = dont_extend_width
self.dont_extend_height = dont_extend_height
self.left_margins = left_margins or []
self.right_margins = right_margins or []
self.scroll_offsets = scroll_offsets or ScrollOffsets()
self.get_vertical_scroll = get_vertical_scroll
self.get_horizontal_scroll = get_horizontal_scroll
self._width = get_width or (lambda cli: width)
self._height = get_height or (lambda cli: height)
self.get_colorcolumns = get_colorcolumns or (lambda cli: [])
self.cursorline_token = cursorline_token
self.cursorcolumn_token = cursorcolumn_token
# Cache for the screens generated by the margin.
self._ui_content_cache = SimpleCache(maxsize=8)
self._margin_width_cache = SimpleCache(maxsize=1)
self.reset()