示例#1
0
 def key_two(self):
     windows.focus(3)
     buffers.two.open()
     self._current_mid_buffer = buffers.two
     self.diff(self._current_diff_mode)
     windows.focus(3)
     self.redraw_hud()
示例#2
0
 def key_two(self):
     windows.focus(3)
     buffers.two.open()
     self._current_mid_buffer = buffers.two
     self.diff(self._current_diff_mode)
     windows.focus(3)
     self.redraw_hud()
示例#3
0
 def key_original(self):
     if self._current_layout == 0:
         windows.focus(2)
     elif self._current_layout == 1:
         return
     elif self._current_layout == 2:
         return
示例#4
0
    def key_result(self):
        windows.focus(3)
        buffers.result.open()
        self._current_buffer_second = buffers.result
        self.diff(self._current_diff_mode)

        self.redraw_hud()
示例#5
0
    def key_original(self):
        windows.focus(2)
        buffers.original.open()
        self._current_buffer_first = buffers.original
        self.diff(self._current_diff_mode)

        self.redraw_hud()
示例#6
0
    def _diff_1(self):
        self.diffoff()
        self._current_diff_mode = 1

        for i in range(2, self._number_of_windows + 2):
            windows.focus(i)
            vim.command('diffthis')
示例#7
0
    def key_original(self):
        windows.focus(2)
        buffers.original.open()
        self._current_buffer_first = buffers.original
        self.diff(self._current_diff_mode)

        self.redraw_hud()
示例#8
0
 def key_original(self):
     if self._current_layout == 0:
         windows.focus(2)
     elif self._current_layout == 1:
         return
     elif self._current_layout == 2:
         return
示例#9
0
    def key_result(self):
        windows.focus(3)
        buffers.result.open()
        self._current_buffer_second = buffers.result
        self.diff(self._current_diff_mode)

        self.redraw_hud()
示例#10
0
    def _diff_1(self):
        self.diffoff()
        self._current_diff_mode = 1

        for i in range(2, self._number_of_windows + 2):
            windows.focus(i)
            vim.command('diffthis')
示例#11
0
    def _diff_3(self):
        self.diffoff()
        self._current_diff_mode = 3

        windows.focus(3)
        vim.command('diffthis')

        windows.focus(4)
        vim.command('diffthis')
示例#12
0
    def _diff_3(self):
        self.diffoff()
        self._current_diff_mode = 3

        windows.focus(3)
        vim.command('diffthis')

        windows.focus(4)
        vim.command('diffthis')
示例#13
0
    def redraw_hud(self):
        with windows.remain():
            windows.focus(1)

            vim.command('setlocal modifiable')
            buffers.hud.set_lines(self.hud_lines())
            vim.command('setlocal nomodifiable')

            vim.command('set winfixheight')
            vim.command('resize ' + setting('hud_size', '3'))
            vim.command('wincmd =')
示例#14
0
    def _key_use_12(self, target):
        targetwin = 2 if target == 1 else 4

        with windows.remain():
            self.diffoff()

            windows.focus(3)
            vim.command('diffthis')

            windows.focus(targetwin)
            vim.command('diffthis')
示例#15
0
    def _key_use_12(self, target):
        targetwin = 2 if target == 1 else 4

        with windows.remain():
            self.diffoff()

            windows.focus(3)
            vim.command('diffthis')

            windows.focus(targetwin)
            vim.command('diffthis')
示例#16
0
    def redraw_hud(self):
        with windows.remain():
            windows.focus(1)

            vim.command('setlocal modifiable')
            buffers.hud.set_lines(self.hud_lines())
            vim.command('setlocal nomodifiable')

            vim.command('set winfixheight')
            vim.command('resize ' + setting('hud_size', '3'))
            vim.command('wincmd =')
示例#17
0
    def diffoff(self):
        with windows.remain():
            for winnr in range(2, 2 + self._number_of_windows):
                windows.focus(winnr)
                curbuffer = buffers.current

                for buffer in buffers.all:
                    buffer.open()
                    vim.command('diffoff')
                    if setting('wrap'):
                        vim.command('setlocal ' + setting('wrap'))

                curbuffer.open()
示例#18
0
    def diffoff(self):
        with windows.remain():
            for winnr in range(2, 2 + self._number_of_windows):
                windows.focus(winnr)
                curbuffer = buffers.current

                for buffer in buffers.all:
                    buffer.open()
                    vim.command('diffoff')
                    if setting('wrap'):
                        vim.command('setlocal ' + setting('wrap'))

                curbuffer.open()
示例#19
0
    def _layout_0(self):
        self._number_of_windows = 1
        self._current_layout = 0

        # Open the layout
        windows.close_all()

        # Put the buffers in the appropriate windows
        windows.focus(1)
        self._current_buffer.open()

        self.open_hud(2)

        windows.focus(2)
示例#20
0
    def _layout_0(self):
        self._number_of_windows = 1
        self._current_layout = 0

        # Open the layout
        windows.close_all()

        # Put the buffers in the appropriate windows
        windows.focus(1)
        self._current_buffer.open()

        self.open_hud(2)

        windows.focus(2)
示例#21
0
    def scrollbind(self, enabled):
        if self._current_diff_mode:
            return

        with windows.remain():
            self._current_scrollbind = enabled

            for winnr in range(2, 2 + self._number_of_windows):
                windows.focus(winnr)

                if enabled:
                    vim.command('set scrollbind')
                else:
                    vim.command('set noscrollbind')

            if enabled:
                vim.command('syncbind')
示例#22
0
    def scrollbind(self, enabled):
        if self._current_diff_mode:
            return

        with windows.remain():
            self._current_scrollbind = enabled

            for winnr in range(2, 2 + self._number_of_windows):
                windows.focus(winnr)

                if enabled:
                    vim.command('set scrollbind')
                else:
                    vim.command('set noscrollbind')

            if enabled:
                vim.command('syncbind')
示例#23
0
 def key_two(self):
     if self._current_layout == 0:
         windows.focus(4)
     elif self._current_layout == 1:
         windows.focus(4)
     elif self._current_layout == 2:
         windows.focus(4)
示例#24
0
 def key_one(self):
     if self._current_layout == 0:
         windows.focus(3)
     elif self._current_layout == 1:
         windows.focus(2)
     elif self._current_layout == 2:
         windows.focus(2)
示例#25
0
 def key_one(self):
     if self._current_layout == 0:
         windows.focus(3)
     elif self._current_layout == 1:
         windows.focus(2)
     elif self._current_layout == 2:
         windows.focus(2)
示例#26
0
 def key_two(self):
     if self._current_layout == 0:
         windows.focus(4)
     elif self._current_layout == 1:
         windows.focus(4)
     elif self._current_layout == 2:
         windows.focus(4)
示例#27
0
 def goto_result(self):
     if self._current_layout == 0:
         windows.focus(5)
     elif self._current_layout == 1:
         windows.focus(3)
     elif self._current_layout == 2:
         windows.focus(3)
示例#28
0
    def key_two(self):
        def open_two(winnr):
            buffers.two.open(winnr)
            if winnr == 2:
                self._current_buffer_first = buffers.two
            else:
                self._current_buffer_second = buffers.two
            self.diff(self._current_diff_mode)
            self.redraw_hud()

        curwindow = windows.currentnr()
        if curwindow == 1:
            curwindow = 2

        # If file two is showing, go to it.
        windows.focus(2)
        if buffers.current == buffers.two:
            return

        windows.focus(3)
        if buffers.current == buffers.two:
            return

        # If both the original and result are showing, open file two in the
        # current window.
        windows.focus(2)
        if buffers.current == buffers.original:
            windows.focus(3)
            if buffers.current == buffers.result:
                open_two(curwindow)
                return

        # If file one is in window 2, then we open file two in window 2.
        windows.focus(3)
        if buffers.current == buffers.two:
            open_two(3)
            return

        # Otherwise, open file two in window 2.
        open_two(curwindow)
示例#29
0
    def key_one(self):
        def open_one(winnr):
            buffers.one.open(winnr)
            if winnr == 2:
                self._current_buffer_first = buffers.one
            else:
                self._current_buffer_second = buffers.one
            self.diff(self._current_diff_mode)
            self.redraw_hud()

        curwindow = windows.currentnr()
        if curwindow == 1:
            curwindow = 2

        # If file one is showing, go to it.
        windows.focus(2)
        if buffers.current == buffers.one:
            return

        windows.focus(3)
        if buffers.current == buffers.one:
            return

        # If both the original and result are showing, open file one in the
        # current window.
        windows.focus(2)
        if buffers.current == buffers.original:
            windows.focus(3)
            if buffers.current == buffers.result:
                open_one(curwindow)
                return

        # If file two is in window 1, then we open file one in window 1.
        windows.focus(2)
        if buffers.current == buffers.two:
            open_one(2)
            return

        # Otherwise, open file one in the current window.
        open_one(curwindow)
示例#30
0
 def goto_result(self):
     if self._current_layout == 0:
         windows.focus(5)
     elif self._current_layout == 1:
         windows.focus(3)
     elif self._current_layout == 2:
         windows.focus(3)
示例#31
0
    def _layout_1(self):
        self._number_of_windows = 3
        self._current_layout = 1

        # Open the layout
        windows.close_all()
        windows.split()
        windows.split()

        # Put the buffers in the appropriate windows
        windows.focus(1)
        buffers.original.open()

        windows.focus(2)
        self._current_mid_buffer.open()

        windows.focus(3)
        buffers.result.open()

        self.open_hud(4)

        windows.focus(4)
示例#32
0
    def _layout_2(self):
        self._number_of_windows = 4
        self._current_layout = 2

        # Open the layout
        windows.close_all()
        windows.split()
        windows.split()

        # Put the buffers in the appropriate windows
        windows.focus(1)
        buffers.one.open()

        windows.focus(2)
        buffers.result.open()

        windows.focus(3)
        buffers.two.open()

        self.open_hud(4)

        windows.focus(3)
示例#33
0
    def _layout_2(self):
        self._number_of_windows = 4
        self._current_layout = 2

        # Open the layout
        windows.close_all()
        windows.split()
        windows.split()

        # Put the buffers in the appropriate windows
        windows.focus(1)
        buffers.one.open()

        windows.focus(2)
        buffers.result.open()

        windows.focus(3)
        buffers.two.open()

        self.open_hud(4)

        windows.focus(3)
示例#34
0
    def _layout_1(self):
        self._number_of_windows = 3
        self._current_layout = 1

        # Open the layout
        windows.close_all()
        windows.split()
        windows.split()

        # Put the buffers in the appropriate windows
        windows.focus(1)
        buffers.original.open()

        windows.focus(2)
        self._current_mid_buffer.open()

        windows.focus(3)
        buffers.result.open()

        self.open_hud(4)

        windows.focus(4)
示例#35
0
    def _layout_1(self):
        self._number_of_windows = 2
        self._current_layout = 1

        # Open the layout
        windows.close_all()
        windows.split()

        # Put the buffers in the appropriate windows
        windows.focus(1)
        self._current_buffer_first.open()

        windows.focus(2)
        self._current_buffer_second.open()

        self.open_hud(3)

        windows.focus(3)
示例#36
0
    def _layout_1(self):
        self._number_of_windows = 2
        self._current_layout = 1

        # Open the layout
        windows.close_all()
        windows.split()

        # Put the buffers in the appropriate windows
        windows.focus(1)
        self._current_buffer_first.open()

        windows.focus(2)
        self._current_buffer_second.open()

        self.open_hud(3)

        windows.focus(3)
示例#37
0
 def key_original(self):
     windows.focus(2)
示例#38
0
 def key_original(self):
     windows.focus(2)
     buffers.original.open()
     self._current_buffer = buffers.original
     self.redraw_hud()
示例#39
0
 def key_one(self):
     windows.focus(2)
     buffers.one.open()
     self._current_buffer = buffers.one
     self.redraw_hud()
示例#40
0
 def key_two(self):
     windows.focus(2)
     buffers.two.open()
     self._current_buffer = buffers.two
     self.redraw_hud()
示例#41
0
 def key_result(self):
     windows.focus(2)
     buffers.result.open()
     self._current_buffer = buffers.result
     self.redraw_hud()
示例#42
0
 def key_two(self):
     windows.focus(2)
     buffers.two.open()
     self._current_buffer = buffers.two
     self.redraw_hud()
示例#43
0
 def key_one(self):
     windows.focus(2)
     buffers.one.open()
     self._current_buffer = buffers.one
     self.redraw_hud()
示例#44
0
 def key_original(self):
     windows.focus(2)
     buffers.original.open()
     self._current_buffer = buffers.original
     self.redraw_hud()
示例#45
0
 def key_result(self):
     windows.focus(2)
     buffers.result.open()
     self._current_buffer = buffers.result
     self.redraw_hud()
示例#46
0
 def key_original(self):
     windows.focus(2)
示例#47
0
 def open(self, winnr=None):
     if winnr is not None:
         windows.focus(winnr)
     vim.command('%dbuffer' % self.number)
示例#48
0
 def open_hud(self, winnr):
     windows.split()
     windows.focus(winnr)
     buffers.hud.open()
     vim.command('wincmd K')
     self.redraw_hud()
示例#49
0
 def key_result(self):
     windows.focus(4)
示例#50
0
 def open_hud(self, winnr):
     windows.split()
     windows.focus(winnr)
     buffers.hud.open()
     vim.command('wincmd K')
     self.redraw_hud()
示例#51
0
 def key_result(self):
     windows.focus(4)
示例#52
0
 def goto_result(self):
     windows.focus(4)
示例#53
0
 def goto_result(self):
     windows.focus(4)
示例#54
0
 def open(self, winnr=None):
     if winnr is not None:
         windows.focus(winnr)
     vim.command('%dbuffer' % self.number)