本文整理汇总了Python中prompt_toolkit.token.Token.Digraph方法的典型用法代码示例。如果您正苦于以下问题:Python Token.Digraph方法的具体用法?Python Token.Digraph怎么用?Python Token.Digraph使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类prompt_toolkit.token.Token
的用法示例。
在下文中一共展示了Token.Digraph方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _get_digraph_char
# 需要导入模块: from prompt_toolkit.token import Token [as 别名]
# 或者: from prompt_toolkit.token.Token import Digraph [as 别名]
def _get_digraph_char(self, cli):
" Return `False`, or the Digraph symbol to be used. "
if cli.quoted_insert:
return '^'
if cli.vi_state.waiting_for_digraph:
if cli.vi_state.digraph_symbol1:
return cli.vi_state.digraph_symbol1
return '?'
return False
示例2: _highlight_digraph
# 需要导入模块: from prompt_toolkit.token import Token [as 别名]
# 或者: from prompt_toolkit.token.Token import Digraph [as 别名]
def _highlight_digraph(self, cli, new_screen):
"""
When we are in Vi digraph mode, put a question mark underneath the
cursor.
"""
digraph_char = self._get_digraph_char(cli)
if digraph_char:
cpos = new_screen.cursor_position
new_screen.data_buffer[cpos.y][cpos.x] = \
_CHAR_CACHE[digraph_char, Token.Digraph]
示例3: _get_digraph_char
# 需要导入模块: from prompt_toolkit.token import Token [as 别名]
# 或者: from prompt_toolkit.token.Token import Digraph [as 别名]
def _get_digraph_char(self, cli):
" Return `False`, or the Digraph symbol to be used. "
if cli.vi_state.waiting_for_digraph:
if cli.vi_state.digraph_symbol1:
return cli.vi_state.digraph_symbol1
return '?'
return False