本文整理匯總了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