本文整理汇总了Python中prompt_toolkit.buffer.Buffer.text方法的典型用法代码示例。如果您正苦于以下问题:Python Buffer.text方法的具体用法?Python Buffer.text怎么用?Python Buffer.text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类prompt_toolkit.buffer.Buffer
的用法示例。
在下文中一共展示了Buffer.text方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Buffer
# 需要导入模块: from prompt_toolkit.buffer import Buffer [as 别名]
# 或者: from prompt_toolkit.buffer.Buffer import text [as 别名]
quis interdum enim. Nam viverra, mauris et blandit malesuada, ante est bibendum
mauris, ac dignissim dui tellus quis ligula. Aenean condimentum leo at
dignissim placerat. In vel dictum ex, vulputate accumsan mi. Donec ut quam
placerat massa tempor elementum. Sed tristique mauris ac suscipit euismod. Ut
tempus vehicula augue non venenatis. Mauris aliquam velit turpis, nec congue
risus aliquam sit amet. Pellentesque blandit scelerisque felis, faucibus
consequat ante. Curabitur tempor tortor a imperdiet tincidunt. Nam sed justo
sit amet odio bibendum congue. Quisque varius ligula nec ligula gravida, sed
convallis augue faucibus. Nunc ornare pharetra bibendum. Praesent blandit ex
quis sodales maximus."""
# Create text buffers. Cursorcolumn/cursorline are mostly combined with an
# (editable) text buffers, where the user can move the cursor.
buff = Buffer()
buff.text = LIPSUM
# 1. The layout
body = HSplit([
Window(FormattedTextControl('Press "q" to quit.'), height=1, style='reverse'),
Window(BufferControl(buffer=buff), cursorcolumn=True, cursorline=True),
])
# 2. Key bindings
kb = KeyBindings()
@kb.add('q')
def _(event):
" Quit application. "