d4684baf9cfe

Add use hunk functionality for Compare and Path modes.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Mon, 13 Jun 2011 21:28:36 -0400
parents 338639048930
children bc6297aefe4b
branches/tags (none)
files plugin/threesomelib/modes.py

Changes

--- a/plugin/threesomelib/modes.py	Mon Jun 13 21:18:06 2011 -0400
+++ b/plugin/threesomelib/modes.py	Mon Jun 13 21:28:36 2011 -0400
@@ -604,11 +604,17 @@
         if buffers.one not in active and buffers.two not in active:
             return
 
+        current_diff = self._current_diff_mode
+        with windows.remain():
+            self._diff_1()  # diff the windows
+
         if buffers.current == buffers.result:
             vim.command('diffget')
         elif buffers.current in (buffers.one, buffers.two):
             vim.command('diffput')
 
+        self.diff(current_diff)
+
 
     def goto_result(self):
         self.key_result()
@@ -765,7 +771,16 @@
 
 
     def key_use(self):
-        pass
+        current_diff = self._current_diff_mode
+        with windows.remain():
+            self._diff_3()  # diff the middle and result windows
+
+        if buffers.current == buffers.result:
+            vim.command('diffget')
+        elif buffers.current in (buffers.one, buffers.two):
+            vim.command('diffput')
+
+        self.diff(current_diff)
 
 
     def goto_result(self):