當前位置: 首頁>>代碼示例>>Python>>正文


Python State.enter_visual_mode方法代碼示例

本文整理匯總了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)
開發者ID:DamnWidget,項目名稱:Vintageous,代碼行數:16,代碼來源:test_move.py

示例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)
開發者ID:TetragrammatonHermit,項目名稱:Vintageous,代碼行數:17,代碼來源:test_copy.py

示例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))
開發者ID:xlinkerz,項目名稱:Vintageous,代碼行數:18,代碼來源:test_entering_normal_mode.py

示例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))
開發者ID:TetragrammatonHermit,項目名稱:Vintageous,代碼行數:18,代碼來源:test_entering_normal_mode.py

示例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)
開發者ID:TetragrammatonHermit,項目名稱:Vintageous,代碼行數:20,代碼來源:test_delete.py


注:本文中的Vintageous.state.State.enter_visual_mode方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。