136a9256bec2

Plugin should work with Python 2 and 3 now.
[view raw] [browse files]
author Stefan Scherfke <stefan@sofa-rockers.org>
date Thu, 05 Mar 2015 09:38:49 +0100
parents 8e1c1dc358de
children 83293407b6f8
branches/tags (none)
files autoload/splice.vim autoload/splicelib/init.py autoload/splicelib/modes.py autoload/splicelib/util/__init__.py autoload/splicelib/util/bufferlib.py autoload/splicelib/util/keys.py

Changes

--- a/autoload/splice.vim	Tue Nov 05 08:29:36 2013 -0800
+++ b/autoload/splice.vim	Thu Mar 05 09:38:49 2015 +0100
@@ -27,6 +27,12 @@
 if sys.version_info[:2] < (2, 5):
     vim.command('let s:has_supported_python = 0')
 ENDPYTHON
+    let s:splice_pyfile = 'pyfile'
+    command! -nargs=1 SplicePython python <args>
+elseif has('python3')
+    let s:has_supported_python = 3
+    let s:splice_pyfile = 'py3file'
+    command! -nargs=1 SplicePython python3 <args>
 else
     let s:has_supported_python = 0
 endif
@@ -99,62 +105,62 @@
 
 function! splice#SpliceInit() "{{{
     let python_module = fnameescape(globpath(&runtimepath, 'autoload/splice.py'))
-    exe 'pyfile ' . python_module
-    python SpliceInit()
+    exe s:splice_pyfile . ' ' . python_module
+    SplicePython SpliceInit()
 endfunction "}}}
 
 function! splice#SpliceGrid() "{{{
-    python SpliceGrid()
+    SplicePython SpliceGrid()
 endfunction "}}}
 function! splice#SpliceLoupe() "{{{
-    python SpliceLoupe()
+    SplicePython SpliceLoupe()
 endfunction "}}}
 function! splice#SpliceCompare() "{{{
-    python SpliceCompare()
+    SplicePython SpliceCompare()
 endfunction "}}}
 function! splice#SplicePath() "{{{
-    python SplicePath()
+    SplicePython SplicePath()
 endfunction "}}}
 
 function! splice#SpliceOriginal() "{{{
-    python SpliceOriginal()
+    SplicePython SpliceOriginal()
 endfunction "}}}
 function! splice#SpliceOne() "{{{
-    python SpliceOne()
+    SplicePython SpliceOne()
 endfunction "}}}
 function! splice#SpliceTwo() "{{{
-    python SpliceTwo()
+    SplicePython SpliceTwo()
 endfunction "}}}
 function! splice#SpliceResult() "{{{
-    python SpliceResult()
+    SplicePython SpliceResult()
 endfunction "}}}
 
 function! splice#SpliceDiff() "{{{
-    python SpliceDiff()
+    SplicePython SpliceDiff()
 endfunction "}}}
 function! splice#SpliceDiffoff() "{{{
-    python SpliceDiffoff()
+    SplicePython SpliceDiffoff()
 endfunction "}}}
 function! splice#SpliceScroll() "{{{
-    python SpliceScroll()
+    SplicePython SpliceScroll()
 endfunction "}}}
 function! splice#SpliceLayout() "{{{
-    python SpliceLayout()
+    SplicePython SpliceLayout()
 endfunction "}}}
 function! splice#SpliceNext() "{{{
-    python SpliceNext()
+    SplicePython SpliceNext()
 endfunction "}}}
 function! splice#SplicePrev() "{{{
-    python SplicePrev()
+    SplicePython SplicePrev()
 endfunction "}}}
 function! splice#SpliceUse() "{{{
-    python SpliceUse()
+    SplicePython SpliceUse()
 endfunction "}}}
 function! splice#SpliceUse1() "{{{
-    python SpliceUse1()
+    SplicePython SpliceUse1()
 endfunction "}}}
 function! splice#SpliceUse2() "{{{
-    python SpliceUse2()
+    SplicePython SpliceUse2()
 endfunction "}}}
 
 " }}}
--- a/autoload/splicelib/init.py	Tue Nov 05 08:29:36 2013 -0800
+++ b/autoload/splicelib/init.py	Thu Mar 05 09:38:49 2015 +0100
@@ -1,7 +1,7 @@
 import vim
-import modes
-from settings import setting
-from util import buffers, keys, windows
+from . import modes
+from .settings import setting
+from .util import buffers, keys, windows
 
 
 CONFLICT_MARKER_START = '<<<<<<<'
--- a/autoload/splicelib/modes.py	Tue Nov 05 08:29:36 2013 -0800
+++ b/autoload/splicelib/modes.py	Thu Mar 05 09:38:49 2015 +0100
@@ -1,8 +1,8 @@
 from __future__ import with_statement
 
 import vim
-from util import buffers, keys, windows
-from settings import boolsetting, setting
+from .util import buffers, keys, windows
+from .settings import boolsetting, setting
 
 
 current_mode = None
--- a/autoload/splicelib/util/__init__.py	Tue Nov 05 08:29:36 2013 -0800
+++ b/autoload/splicelib/util/__init__.py	Thu Mar 05 09:38:49 2015 +0100
@@ -1,2 +1,2 @@
 # This is kind of a dirty hack.  Feels bad, man.
-from bufferlib import buffers
+from .bufferlib import buffers
--- a/autoload/splicelib/util/bufferlib.py	Tue Nov 05 08:29:36 2013 -0800
+++ b/autoload/splicelib/util/bufferlib.py	Thu Mar 05 09:38:49 2015 +0100
@@ -1,6 +1,6 @@
 import os
 import vim
-import windows
+from . import windows
 
 ap = os.path.abspath
 
--- a/autoload/splicelib/util/keys.py	Tue Nov 05 08:29:36 2013 -0800
+++ b/autoload/splicelib/util/keys.py	Thu Mar 05 09:38:49 2015 +0100
@@ -1,6 +1,6 @@
 from __future__ import with_statement
 import vim
-from bufferlib import buffers
+from .bufferlib import buffers
 from ..settings import setting