本文整理匯總了Python中Vintageous.vi.mappings.Mappings.remove方法的典型用法代碼示例。如果您正苦於以下問題:Python Mappings.remove方法的具體用法?Python Mappings.remove怎麽用?Python Mappings.remove使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Vintageous.vi.mappings.Mappings
的用法示例。
在下文中一共展示了Mappings.remove方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: run
# 需要導入模塊: from Vintageous.vi.mappings import Mappings [as 別名]
# 或者: from Vintageous.vi.mappings.Mappings import remove [as 別名]
def run(self, edit, mode=None, count=None, cmd=''):
mappings = Mappings(State(self.view))
try:
mappings.remove(modes.VISUAL, cmd)
mappings.remove(modes.VISUAL_LINE, cmd)
mappings.remove(modes.VISUAL_BLOCK, cmd)
except KeyError:
sublime.status_message('Vintageous: Mapping not found.')
示例2: Test_Mappings_AddingAndRemoving
# 需要導入模塊: from Vintageous.vi.mappings import Mappings [as 別名]
# 或者: from Vintageous.vi.mappings.Mappings import remove [as 別名]
class Test_Mappings_AddingAndRemoving(ViewTest):
def setUp(self):
super().setUp()
self.mappings = Mappings(self.state)
self.mappings.clear()
def testCanAdd(self):
for (i, data) in enumerate(adding_tests):
mode, keys, target, msg = data
self.mappings.add(mode, keys, target)
self.assertEqual(_mappings[mode][keys], {'name': target, 'type': cmd_types.USER}, '{0} [{1}] failed'.format(msg, i))
self.mappings.clear()
def testCanRemove(self):
for (i, data) in enumerate(adding_tests):
mode, keys, target, msg = data
self.mappings.add(mode, keys, target)
self.mappings.remove(mode, keys)
self.assertFalse(_mappings[modes.NORMAL])
self.assertFalse(_mappings[modes.VISUAL])
self.assertFalse(_mappings[modes.VISUAL_LINE])
self.assertFalse(_mappings[modes.VISUAL_BLOCK])