Permalink
Browse files

Rename to Splice, and change default prefix.

--HG--
rename : autoload/threesomelib/init.py => autoload/splicelib/init.py
rename : autoload/threesomelib/modes.py => autoload/splicelib/modes.py
rename : autoload/threesomelib/settings.py => autoload/splicelib/settings.py
rename : autoload/threesomelib/util/__init__.py => autoload/splicelib/util/__init__.py
rename : autoload/threesomelib/util/bufferlib.py => autoload/splicelib/util/bufferlib.py
rename : autoload/threesomelib/util/io.py => autoload/splicelib/util/io.py
rename : autoload/threesomelib/util/keys.py => autoload/splicelib/util/keys.py
rename : autoload/threesomelib/util/windows.py => autoload/splicelib/util/windows.py
  • Loading branch information...
1 parent 8d4ce2e commit bbddc2000cb93f744b1b2db9429f45176a7d168b @sjl committed Apr 20, 2012
View
19 LICENSE
@@ -1,19 +0,0 @@
-Copyright (C) 2011 by Steve Losh and contributors
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this
-software and associated documentation files (the "Software"), to deal in the Software
-without restriction, including without limitation the rights to use, copy, modify,
-merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be included in all copies
-or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR
-A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
-OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
View
@@ -0,0 +1,19 @@
+Copyright (C) 2011 by Steve Losh and contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+**THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.**
+
View
@@ -1,8 +1,8 @@
-Threesome
+Splice
=========
-Threesome is a Vim plugin for resolving conflicts during three-way merges.
+Splice is a Vim plugin for resolving conflicts during three-way merges.
-Visit [the site](http://sjl.bitbucket.org/threesome.vim/) for more information.
+Visit [the site](http://sjl.bitbucket.org/splice.vim/) for more information.
View
@@ -0,0 +1,74 @@
+import vim, os, sys
+
+
+# Add the library to the Python path.
+for p in vim.eval("&runtimepath").split(','):
+ plugin_dir = os.path.join(p, "autoload")
+ if os.path.exists(os.path.join(plugin_dir, "splicelib")):
+ if plugin_dir not in sys.path:
+ sys.path.append(plugin_dir)
+ break
+
+
+import splicelib.init as splice
+
+
+# Wrapper functions ----------------------------------------------------------------
+
+def SpliceInit():
+ splice.init()
+
+
+def SpliceOriginal():
+ splice.modes.current_mode.key_original()
+
+def SpliceOne():
+ splice.modes.current_mode.key_one()
+
+def SpliceTwo():
+ splice.modes.current_mode.key_two()
+
+def SpliceResult():
+ splice.modes.current_mode.key_result()
+
+
+def SpliceGrid():
+ splice.modes.key_grid()
+
+def SpliceLoupe():
+ splice.modes.key_loupe()
+
+def SpliceCompare():
+ splice.modes.key_compare()
+
+def SplicePath():
+ splice.modes.key_path()
+
+
+def SpliceDiff():
+ splice.modes.current_mode.key_diff()
+
+def SpliceDiffoff():
+ splice.modes.current_mode.key_diffoff()
+
+def SpliceScroll():
+ splice.modes.current_mode.key_scrollbind()
+
+def SpliceLayout():
+ splice.modes.current_mode.key_layout()
+
+def SpliceNext():
+ splice.modes.current_mode.key_next()
+
+def SplicePrev():
+ splice.modes.current_mode.key_prev()
+
+def SpliceUse():
+ splice.modes.current_mode.key_use()
+
+def SpliceUse1():
+ splice.modes.current_mode.key_use1()
+
+def SpliceUse2():
+ splice.modes.current_mode.key_use2()
+
View
@@ -0,0 +1,153 @@
+" ============================================================================
+" File: splice.vim
+" Description: vim global plugin for resolving three-way merge conflicts
+" Maintainer: Steve Losh <steve@stevelosh.com>
+" License: MIT X11
+" ============================================================================
+
+" Init {{{
+
+" Vim version check {{{
+
+if v:version < '703'
+ function! s:SpliceDidNotLoad()
+ echohl WarningMsg|echomsg "Splice unavailable: requires Vim 7.3+"|echohl None
+ endfunction
+ command! -nargs=0 SpliceInit call s:SpliceDidNotLoad()
+ finish
+endif
+
+"}}}
+" Python version check {{{
+
+if has('python')
+ let s:has_supported_python = 2
+python << ENDPYTHON
+import sys, vim
+if sys.version_info[:2] < (2, 5):
+ vim.command('let s:has_supported_python = 0')
+ENDPYTHON
+else
+ let s:has_supported_python = 0
+endif
+
+if !s:has_supported_python
+ function! s:SpliceDidNotLoad()
+ echohl WarningMsg|echomsg "Splice requires Vim to be compiled with Python 2.5+"|echohl None
+ endfunction
+ command! -nargs=0 SpliceInit call s:SpliceDidNotLoad()
+ finish
+endif
+
+"}}}
+" Configuration variables {{{
+
+if !exists('g:splice_disable') "{{{
+ let g:splice_disable = 0
+endif " }}}
+if !exists('g:splice_initial_mode') "{{{
+ let g:splice_initial_mode = 'grid'
+endif "}}}
+if !exists('g:splice_initial_layout_grid') "{{{
+ let g:splice_initial_layout_grid = 0
+endif "}}}
+if !exists('g:splice_initial_layout_loupe') "{{{
+ let g:splice_initial_layout_loupe = 0
+endif "}}}
+if !exists('g:splice_initial_layout_compare') "{{{
+ let g:splice_initial_layout_compare = 0
+endif "}}}
+if !exists('g:splice_initial_layout_path') "{{{
+ let g:splice_initial_layout_path = 0
+endif "}}}
+if !exists('g:splice_initial_diff_grid') "{{{
+ let g:splice_initial_diff_grid = 0
+endif "}}}
+if !exists('g:splice_initial_diff_loupe') "{{{
+ let g:splice_initial_diff_loupe = 0
+endif "}}}
+if !exists('g:splice_initial_diff_compare') "{{{
+ let g:splice_initial_diff_compare = 0
+endif "}}}
+if !exists('g:splice_initial_diff_path') "{{{
+ let g:splice_initial_diff_path = 0
+endif "}}}
+if !exists('g:splice_initial_scrollbind_grid') "{{{
+ let g:splice_initial_scrollbind_grid = 0
+endif "}}}
+if !exists('g:splice_initial_scrollbind_loupe') "{{{
+ let g:splice_initial_scrollbind_loupe = 0
+endif "}}}
+if !exists('g:splice_initial_scrollbind_compare') "{{{
+ let g:splice_initial_scrollbind_compare = 0
+endif "}}}
+if !exists('g:splice_initial_scrollbind_path') "{{{
+ let g:splice_initial_scrollbind_path = 0
+endif "}}}
+
+" }}}
+
+" }}}
+" Wrappers {{{
+
+function! splice#SpliceInit() "{{{
+ let python_module = fnameescape(globpath(&runtimepath, 'autoload/splice.py'))
+ exe 'pyfile ' . python_module
+ python SpliceInit()
+endfunction "}}}
+
+function! splice#SpliceGrid() "{{{
+ python SpliceGrid()
+endfunction "}}}
+function! splice#SpliceLoupe() "{{{
+ python SpliceLoupe()
+endfunction "}}}
+function! splice#SpliceCompare() "{{{
+ python SpliceCompare()
+endfunction "}}}
+function! splice#SplicePath() "{{{
+ python SplicePath()
+endfunction "}}}
+
+function! splice#SpliceOriginal() "{{{
+ python SpliceOriginal()
+endfunction "}}}
+function! splice#SpliceOne() "{{{
+ python SpliceOne()
+endfunction "}}}
+function! splice#SpliceTwo() "{{{
+ python SpliceTwo()
+endfunction "}}}
+function! splice#SpliceResult() "{{{
+ python SpliceResult()
+endfunction "}}}
+
+function! splice#SpliceDiff() "{{{
+ python SpliceDiff()
+endfunction "}}}
+function! splice#SpliceDiffoff() "{{{
+ python SpliceDiffoff()
+endfunction "}}}
+function! splice#SpliceScroll() "{{{
+ python SpliceScroll()
+endfunction "}}}
+function! splice#SpliceLayout() "{{{
+ python SpliceLayout()
+endfunction "}}}
+function! splice#SpliceNext() "{{{
+ python SpliceNext()
+endfunction "}}}
+function! splice#SplicePrev() "{{{
+ python SplicePrev()
+endfunction "}}}
+function! splice#SpliceUse() "{{{
+ python SpliceUse()
+endfunction "}}}
+function! splice#SpliceUse1() "{{{
+ python SpliceUse1()
+endfunction "}}}
+function! splice#SpliceUse2() "{{{
+ python SpliceUse2()
+endfunction "}}}
+
+" }}}
File renamed without changes.
@@ -31,23 +31,23 @@ def process_result():
buffers.result.set_lines(lines)
def bind_global_keys():
- keys.bind('g', ':ThreesomeGrid<cr>')
- keys.bind('l', ':ThreesomeLoupe<cr>')
- keys.bind('c', ':ThreesomeCompare<cr>')
- keys.bind('p', ':ThreesomePath<cr>')
-
- keys.bind('o', ':ThreesomeOriginal<cr>')
- keys.bind('1', ':ThreesomeOne<cr>')
- keys.bind('2', ':ThreesomeTwo<cr>')
- keys.bind('r', ':ThreesomeResult<cr>')
-
- keys.bind('d', ':ThreesomeDiff<cr>')
- keys.bind('D', ':ThreesomeDiffoff<cr>')
- keys.bind('s', ':ThreesomeScroll<cr>')
- keys.bind('n', ':ThreesomeNext<cr>')
- keys.bind('N', ':ThreesomePrev<cr>')
- keys.bind('<space>', ':ThreesomeLayout<cr>')
- keys.bind('u', ':ThreesomeUse<cr>')
+ keys.bind('g', ':SpliceGrid<cr>')
+ keys.bind('l', ':SpliceLoupe<cr>')
+ keys.bind('c', ':SpliceCompare<cr>')
+ keys.bind('p', ':SplicePath<cr>')
+
+ keys.bind('o', ':SpliceOriginal<cr>')
+ keys.bind('1', ':SpliceOne<cr>')
+ keys.bind('2', ':SpliceTwo<cr>')
+ keys.bind('r', ':SpliceResult<cr>')
+
+ keys.bind('d', ':SpliceDiff<cr>')
+ keys.bind('D', ':SpliceDiffoff<cr>')
+ keys.bind('s', ':SpliceScroll<cr>')
+ keys.bind('n', ':SpliceNext<cr>')
+ keys.bind('N', ':SplicePrev<cr>')
+ keys.bind('<space>', ':SpliceLayout<cr>')
+ keys.bind('u', ':SpliceUse<cr>')
keys.bind('q', ':wa<cr>:qa<cr>')
keys.bind('CC', ':cq<cr>')
@@ -82,12 +82,12 @@ def setlocal_buffers():
vim.command('setlocal buftype=nofile')
vim.command('setlocal noundofile')
vim.command('setlocal nolist')
- vim.command('setlocal ft=threesome')
+ vim.command('setlocal ft=splice')
vim.command('setlocal nowrap')
vim.command('resize ' + setting('hud_size', '3'))
def create_hud():
- vim.command('new __Threesome_HUD__')
+ vim.command('new __Splice_HUD__')
def init():
@@ -130,15 +130,15 @@ def pad(lines):
sep = ' | '
modes = pad([
- r'Threesome Modes',
+ r'Splice Modes',
r'x[g]rid y[c]ompare'.replace('x', self._id == 'grid' and '*' or ' ')
.replace('y', self._id == 'comp' and '*' or ' '),
r'x[l]oupe y[p]ath'.replace('x', self._id == 'loup' and '*' or ' ')
.replace('y', self._id == 'path' and '*' or ' '),
])
diagram = pad(self.hud_diagram())
commands = pad([
- r'Threesome Commands',
+ r'Splice Commands',
r'd: cycle diffs n: next conflict space: cycle layouts u: use hunk o: original 1: one q: save and quit',
r'D: diffs off N: prev conflict s: toggle scrollbind r: result 2: two CC: exit with error',
])
@@ -388,14 +388,14 @@ def goto_result(self):
def activate(self):
keys.unbind('u')
- keys.bind('u1', ':ThreesomeUse1<cr>')
- keys.bind('u2', ':ThreesomeUse2<cr>')
+ keys.bind('u1', ':SpliceUse1<cr>')
+ keys.bind('u2', ':SpliceUse2<cr>')
return super(GridMode, self).activate()
def deactivate(self):
keys.unbind('u1')
keys.unbind('u2')
- keys.bind('u', ':ThreesomeUse<cr>')
+ keys.bind('u', ':SpliceUse<cr>')
return super(GridMode, self).deactivate()
@@ -656,7 +656,7 @@ def open_two(winnr):
return
# Otherwise, open file two in window 2.
- open_two(curwindow)
+ open_two(3)
def key_result(self):
windows.focus(3)
@@ -2,7 +2,7 @@
def setting(name, default=None):
- full_name = 'g:threesome_' + name
+ full_name = 'g:splice_' + name
if not int(vim.eval('exists("%s")' % full_name)):
return default
@@ -50,7 +50,7 @@ def result(self):
@property
def hud(self):
- return Buffer(int(vim.eval("bufnr('__Threesome_HUD__')")) - 1)
+ return Buffer(int(vim.eval("bufnr('__Splice_HUD__')")) - 1)
@property
File renamed without changes.
Oops, something went wrong.

0 comments on commit bbddc20

Please sign in to comment.