本文整理匯總了Python中Vintageous.state.State.enter_visual_mode方法的典型用法代碼示例。如果您正苦於以下問題:Python State.enter_visual_mode方法的具體用法?Python State.enter_visual_mode怎麽用?Python State.enter_visual_mode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Vintageous.state.State
的用法示例。
在下文中一共展示了State.enter_visual_mode方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: testFromVisualModeToNormalMode
# 需要導入模塊: from Vintageous.state import State [as 別名]
# 或者: from Vintageous.state.State import enter_visual_mode [as 別名]
def testFromVisualModeToNormalMode(self):
self.write('abc\nxxx\nabc\nabc')
self.clear_sel()
self.add_sel(self.R((1, 0), (1, 1)))
state = State(self.view)
state.enter_visual_mode()
prev_mode = state.mode
self.view.run_command('ex_move', {'command_line': 'move3'})
state = State(self.view)
new_mode = state.mode
self.assertNotEqual(prev_mode, new_mode)
示例2: testFromVisualModeToNormalMode
# 需要導入模塊: from Vintageous.state import State [as 別名]
# 或者: from Vintageous.state.State import enter_visual_mode [as 別名]
def testFromVisualModeToNormalMode(self):
self.write('abc\nxxx\nabc\nabc')
self.clear_sel()
self.add_sel(self.R((1, 0), (1, 1)))
state = State(self.view)
state.enter_visual_mode()
prev_mode = state.mode
self.view.run_command('ex_copy', {'address': '3'})
state = State(self.view)
new_mode = state.mode
self.assertNotEqual(prev_mode, new_mode)
self.assertEqual(new_mode, modes.NORMAL)
示例3: testCaretEndsInExpectedRegion
# 需要導入模塊: from Vintageous.state import State [as 別名]
# 或者: from Vintageous.state.State import enter_visual_mode [as 別名]
def testCaretEndsInExpectedRegion(self):
self.write("".join(("foo bar\nfoo bar\nfoo bar\n",)))
self.clear_sel()
self.add_sel(self.R((1, 3), (1, 0)))
state = State(self.view)
state.enter_visual_mode()
# TODO: we should bypass vi_r and define the values directly.
data = CmdData(state)
# data = vi_r(data)
data["action"]["args"]["character"] = "X"
self.view.run_command("vi_run", data)
self.assertEqual(self.R((1, 0), (1, 0)), first_sel(self.view))
示例4: testCaretEndsInExpectedRegion
# 需要導入模塊: from Vintageous.state import State [as 別名]
# 或者: from Vintageous.state.State import enter_visual_mode [as 別名]
def testCaretEndsInExpectedRegion(self):
self.write(''.join(('foo bar\nfoo bar\nfoo bar\n',)))
self.clear_sel()
self.add_sel(self.R((1, 3), (1, 0)))
state = State(self.view)
state.enter_visual_mode()
# TODO: we should bypass vi_r and define the values directly.
data = CmdData(state)
# data = vi_r(data)
data['action']['args']['character'] = 'X'
self.view.run_command('vi_run', data)
self.assertEqual(self.R((1, 0), (1, 0)), first_sel(self.view))
示例5: testFromVisualModeToNormalMode
# 需要導入模塊: from Vintageous.state import State [as 別名]
# 或者: from Vintageous.state.State import enter_visual_mode [as 別名]
def testFromVisualModeToNormalMode(self):
self.write('abc\nxxx\nabc\nabc')
self.clear_sel()
self.add_sel(self.R((1, 0), (1, 1)))
state = State(self.view)
state.enter_visual_mode()
prev_mode = state.mode
self.range['left_ref'] = "'<"
self.range['right_ref'] = "'>"
self.range['text_range'] = "'<,'>"
self.view.run_command('ex_delete', {'line_range': self.range})
state = State(self.view)
new_mode = state.mode
self.assertNotEqual(prev_mode, new_mode)
self.assertEqual(new_mode, MODE_NORMAL)