本文整理汇总了Python中prompt_toolkit.buffer.Buffer.yank_last_arg方法的典型用法代码示例。如果您正苦于以下问题:Python Buffer.yank_last_arg方法的具体用法?Python Buffer.yank_last_arg怎么用?Python Buffer.yank_last_arg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类prompt_toolkit.buffer.Buffer
的用法示例。
在下文中一共展示了Buffer.yank_last_arg方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_repeated_search
# 需要导入模块: from prompt_toolkit.buffer import Buffer [as 别名]
# 或者: from prompt_toolkit.buffer.Buffer import yank_last_arg [as 别名]
def test_repeated_search(_history):
buff = Buffer(history=_history)
buff.yank_last_arg()
buff.yank_last_arg()
assert buff.document.current_line == 'delta'
示例2: test_repeated_search_with_wraparound
# 需要导入模块: from prompt_toolkit.buffer import Buffer [as 别名]
# 或者: from prompt_toolkit.buffer.Buffer import yank_last_arg [as 别名]
def test_repeated_search_with_wraparound(_history):
buff = Buffer(history=_history)
buff.yank_last_arg()
buff.yank_last_arg()
buff.yank_last_arg()
assert buff.document.current_line == 'four'
示例3: test_simple_search_with_arg_out_of_bounds
# 需要导入模块: from prompt_toolkit.buffer import Buffer [as 别名]
# 或者: from prompt_toolkit.buffer.Buffer import yank_last_arg [as 别名]
def test_simple_search_with_arg_out_of_bounds(_history):
buff = Buffer(history=_history)
buff.yank_last_arg(n=8)
assert buff.document.current_line == ''
示例4: test_simple_search_with_arg
# 需要导入模块: from prompt_toolkit.buffer import Buffer [as 别名]
# 或者: from prompt_toolkit.buffer.Buffer import yank_last_arg [as 别名]
def test_simple_search_with_arg(_history):
buff = Buffer(history=_history)
buff.yank_last_arg(n=2)
assert buff.document.current_line == 'three'
示例5: test_simple_search_with_quotes
# 需要导入模块: from prompt_toolkit.buffer import Buffer [as 别名]
# 或者: from prompt_toolkit.buffer.Buffer import yank_last_arg [as 别名]
def test_simple_search_with_quotes(_history):
_history.append_string("""one two "three 'x' four"\n""")
buff = Buffer(history=_history)
buff.yank_last_arg()
assert buff.document.current_line == '''"three 'x' four"'''
示例6: test_simple_search
# 需要导入模块: from prompt_toolkit.buffer import Buffer [as 别名]
# 或者: from prompt_toolkit.buffer.Buffer import yank_last_arg [as 别名]
def test_simple_search(_history):
buff = Buffer(history=_history)
buff.yank_last_arg()
assert buff.document.current_line == 'four'
示例7: test_empty_history
# 需要导入模块: from prompt_toolkit.buffer import Buffer [as 别名]
# 或者: from prompt_toolkit.buffer.Buffer import yank_last_arg [as 别名]
def test_empty_history():
buf = Buffer()
buf.yank_last_arg()
assert buf.document.current_line == ''