本文整理汇总了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()