本文整理汇总了Python中pyqode.core.api.utils.TextHelper.match_select方法的典型用法代码示例。如果您正苦于以下问题:Python TextHelper.match_select方法的具体用法?Python TextHelper.match_select怎么用?Python TextHelper.match_select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyqode.core.api.utils.TextHelper
的用法示例。
在下文中一共展示了TextHelper.match_select方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_matched_selection
# 需要导入模块: from pyqode.core.api.utils import TextHelper [as 别名]
# 或者: from pyqode.core.api.utils.TextHelper import match_select [as 别名]
def test_matched_selection(editor):
line, column, text = 233, 14, ''' editor.textCursor(), 'import', QtGui.QTextDocument.FindCaseSensitively'''
cursor = editor.textCursor()
assert not cursor.hasSelection()
helper = TextHelper(editor)
helper.goto_line(line, column)
assert helper.cursor_position()[0] == line
assert helper.cursor_position()[1] == column
cursor = editor.textCursor()
helper.match_select()
cursor = editor.textCursor()
assert cursor.hasSelection()
assert text in cursor.selectedText()
示例2: test_matched_selection
# 需要导入模块: from pyqode.core.api.utils import TextHelper [as 别名]
# 或者: from pyqode.core.api.utils.TextHelper import match_select [as 别名]
def test_matched_selection(editor):
line, column, text = 297, 14, '''__file__'''
cursor = editor.textCursor()
assert not cursor.hasSelection()
helper = TextHelper(editor)
helper.goto_line(line, column)
assert helper.cursor_position()[0] == line
assert helper.cursor_position()[1] == column
cursor = editor.textCursor()
helper.match_select()
cursor = editor.textCursor()
assert cursor.hasSelection()
assert text in cursor.selectedText()