Code Monkey home page Code Monkey logo

splice.vim's Introduction

Splice

Splice is a Vim plugin for resolving conflicts during three-way merges.

Visit the site for more information.

Troubleshooting

Splice and Fugitive do not play well together. If you try to use Splice as a git mergetool while you have Fugitive installed it may segfault Vim, even if you're not using any Fugitive features.

Fugitive must be doing something behind the scenes even when you don't run any of its commands, but unfortunately the segfault doesn't give me a useful trace so I can find the issue. If you have any ideas on what might be happening please let me know -- I'd love to fix this.

splice.vim's People

Contributors

abudden avatar jofarnold avatar killphi avatar raphael-proust avatar sjl avatar sscherfke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

splice.vim's Issues

:SpliceUse1 stopped job

merge

-u1

results in:

stopped job

I'll try to restart the job with fg, but it doesn't do anything. I'm pretty sure this is some kind of crash.

using -u works, taking the hunk from the orig, but when I specify anything after :SpliceUse it will stop the job.

 vi --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Mar 24 2011 07:07:34)
Included patches: 1-35
Modified by [email protected]
Compiled by buildd@
Huge version with GTK2-GNOME GUI.  Features included (+) or not (-):
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent 
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments 
+conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con_gui +diff 
+digraphs +dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi 
+file_in_path +find_in_path +float +folding -footer +fork() +gettext 
-hangul_input +iconv +insert_expand +jumplist +keymap +langmap +libcall 
+linebreak +lispindent +listcmds +localmap +lua/dyn +menu +mksession 
+modify_fname +mouse +mouseshape +mouse_dec +mouse_gpm -mouse_jsbterm 
+mouse_netterm -mouse_sysmouse +mouse_xterm +multi_byte +multi_lang -mzscheme 
+netbeans_intg -osfiletype +path_extra +perl/dyn +persistent_undo +postscript 
+printer +profile +python/dyn +python3/dyn +quickfix +reltime +rightleft +ruby 
+scrollbind +signs +smartindent -sniff +startuptime +statusline -sun_workshop 
+syntax +tag_binary +tag_old_static -tag_any_white +tcl +terminfo +termresponse
 +textobjects +title +toolbar +user_commands +vertsplit +virtualedit +visual 
+visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup 
+X11 -xfontset +xim +xsmp_interact +xterm_clipboard -xterm_save 
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/libdrm -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pixman-1   -pthread -DORBIT2=1 -D_REENTRANT -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/atk-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/libpng12 -I/usr/include/libdrm -I/usr/include/libgnomeui-2.0 -I/usr/include/libart-2.0 -I/usr/include/gconf/2 -I/usr/include/gnome-keyring-1 -I/usr/include/libgnome-2.0 -I/usr/include/libbonoboui-2.0 -I/usr/include/libgnomecanvas-2.0 -I/usr/include/gtk-2.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gnome-vfs-2.0 -I/usr/lib/gnome-vfs-2.0/include -I/usr/include/orbit-2.0 -I/usr/include/libbonobo-2.0 -I/usr/include/bonobo-activation-2.0 -I/usr/include/libxml2 -I/usr/include/gail-1.0 -I/usr/lib/gtk-2.0/include -I/usr/include/cairo -I/usr/include/pixman-1     -Wall -g -O2 -D_FORTIFY_SOURCE=1    -I/usr/include/tcl8.4  -D_REENTRANT=1  -D_THREAD_SAFE=1  -D_LARGEFILE64_SOURCE=1  -I/usr/lib/ruby/1.8/x86_64-linux -DRUBY_VERSION=18 
Linking: gcc -L/usr/lib/x86_64-linux-gnu    -L. -Wl,-Bsymbolic-functions -rdynamic -Wl,-export-dynamic  -Wl,-E  -Wl,--as-needed -o vim   -pthread -L/usr/lib/x86_64-linux-gnu -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0   -L/usr/lib/x86_64-linux-gnu   -lgnomeui-2 -lbonoboui-2 -lgnomevfs-2 -lgnomecanvas-2 -lgnome-2 -lpopt -lbonobo-2 -lbonobo-activation -lORBit-2 -lart_lgpl_2 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgconf-2 -lgmodule-2.0 -lgobject-2.0 -lgthread-2.0 -lrt -lglib-2.0   -lXt -lncurses -lselinux   -lacl -lgpm -Wl,-E  -fstack-protector -L/usr/local/lib  -L/usr/lib/perl/5.10/CORE -L/usr/lib -ltcl8.4 -lieee -lruby1.8 -lrt -lm   

Broken for some version of vim python: self._buffer.name fails with "no attribute '_buffer'"

All splice commands are failing for me with cryptic python NameErrors like
NameError: name 'SpliceCompare' is not defined

I had to dig into the code to find the real error (which the plugin was silently swallowing), which was that the code is accessing a Buffer._buffer attribute that doesn't seem to exist:

:execute 'py3file' fnameescape(globpath(&runtimepath, 'autoload/splice.py'))
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/google/home/dbarnett/.vim/plugged/splice.vim/autoload/splice.py", line 13, in <module>
    import splicelib.init as splice
  File "/usr/local/google/home/dbarnett/.vim/plugged/splice.vim/autoload/splicelib/init.py", line 2, in <module>
    from . import modes
  File "/usr/local/google/home/dbarnett/.vim/plugged/splice.vim/autoload/splicelib/modes.py", line 893, in <module>
    loupe = LoupeMode()
  File "/usr/local/google/home/dbarnett/.vim/plugged/splice.vim/autoload/splicelib/modes.py", line 433, in __init__
    self._current_buffer = buffers.result
  File "/usr/local/google/home/dbarnett/.vim/plugged/splice.vim/autoload/splicelib/util/bufferlib.py", line 52, in result
    return Buffer(4)
  File "/usr/local/google/home/dbarnett/.vim/plugged/splice.vim/autoload/splicelib/util/bufferlib.py", line 14, in __init__
    self.name = self._buffer.name
AttributeError: 'Buffer' object has no attribute '_buffer'

third layout in grid mode causes vim.error: Vim(wincmd):E16: Invalid range: 5wincmd

Relating to splice, I noticed that when in grid mode and toggling to the
third layout I was seeing this error (I'm using a vim 7.4 patched to
658):

Error detected while processing function splice#SpliceLayout:
line 1:
Traceback (most recent call last):
File "", line 1, in
File "/home/wfiveash/.vim/bundle/splice/autoload/splice.py", line 58, in SpliceLayout
splice.modes.current_mode.key_layout()
File "/home/wfiveash/.vim/bundle/splice/autoload/splicelib/modes.py", line 81, in key_layout
self.layout(next_layout)
File "/home/wfiveash/.vim/bundle/splice/autoload/splicelib/modes.py", line 74, in layout
self.diff(self._current_diff_mode)
File "/home/wfiveash/.vim/bundle/splice/autoload/splicelib/modes.py", line 18, in diff
getattr(self, 'diff%d' % diffmode)()
File "/home/wfiveash/.vim/bundle/splice/autoload/splicelib/modes.py", line 276, in _diff_0
self.diffoff()
File "/home/wfiveash/.vim/bundle/splice/autoload/splicelib/modes.py", line 34, in diffoff
windows.focus(winnr)
File "/home/wfiveash/.vim/bundle/splice/autoload/splicelib/util/windows.py", line 5, in focus
vim.command('%dwincmd w' % winnr)
vim.error: Vim(wincmd):E16: Invalid range: 5wincmd w

I think I found a fix for this in splice (in ~/.vim/bundle/splice):

diff --git a/autoload/splicelib/modes.py b/autoload/splicelib/modes.py
--- a/autoload/splicelib/modes.py
+++ b/autoload/splicelib/modes.py
@@ -249,7 +249,8 @@
         windows.focus(3)
 
     def _layout_2(self):
-        self._number_of_windows = 4
+        self._number_of_windows = 3
         self._current_layout = 2
 
         # Open the layout

I haven't done extensive testing of this but so far it seems to have
fixed that issue and I haven't noticed a regression.

g:splice_prefix does not work

Index: doc/splice.txt
===================================================================
--- doc/splice.txt      (revision 4307)
+++ doc/splice.txt      (working copy)
@@ -566,15 +566,15 @@
 Default: "grid"
 
 ------------------------------------------------------------------------------
-5.16 g:splice_prefix                                     *SpliceConfig_prefix*
+5.16 g:splice_leader                                     *SpliceConfig_leader*
 
 Set this to change the prefix Splice will bind all of its mappings to.
 
 For example: >
 
-    let g:splice_prefix = "t"
+    let g:splice_leader = "s"
 
-Will make all Splice commands start with t instead of the default '-'.
+Will make all Splice commands start with s instead of the default '-'.
 
 Options: Any valid key mapping string
 Default: "-"

Error: Splice (maybe) deleted some lines when merging.

I run command $ git mergetool to call Splice, I found some lines should be over there, but they are remove automatically when I run Splice.
Here are two screenshots show my problem.
after start Splice. (I can see the vim file changed statusline indicator +)
screenshot 1

After I press u to undo.
screenshot 2

SegFault collection with Fugitive

I got some ugly crashes when using splice with fugitive:

Occured randomly on changing to [c]ompare

Vim: Caught deadly signal SEGV
Vim: Finished.
/usr/lib/git-core/git-mergetool--lib: line 137: 17339 Segmentation fault      vim -f $BASE $LOCAL $REMOTE $MERGED -c 'SpliceInit'

Occured randomly on changing to [p]ath

*** glibc detected *** vim: malloc(): smallbin double linked list corrupted: 0x00000000026dadb0 ***
$ vim --version | head -4
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Oct 23 2012 18:42:18)
Included patches: 1-712
Compiled by ArchLinux
Big version with GTK2 GUI.  Features included (+) or not (-):

$ git --version
git version 1.8.0

$ pacman -Q glibc
glibc 2.16.0-5

How can I provide better logs/stacktraces?

Feature: diffing between 1, 2 and result, without original

I often understand how to resolve conflicts if I see the difference between 1, 2 and result, without the changes against the original (although having it present is very useful). Currently I'm doing this by using :diffoff in the buffer for original, but then splice enables it again. I would be nice if this were an option (for grid mode).

Thanks

Splice fails to start on macOS 10.13.3

Following the documentation and then provoking a conflict and running git mergetool I get the following error:

Error detected while processing function splice#SpliceInit[3]..provider#python#Call:
line   18:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/pedromss/.dotfiles/vim/.vim/plugged/splice.vim/autoload/splice.py", line 19, in SpliceInit
    splice.init()
  File "/Users/pedromss/.dotfiles/vim/.vim/plugged/splice.vim/autoload/splicelib/init.py", line 103, in init
    setlocal_buffers()
  File "/Users/pedromss/.dotfiles/vim/.vim/plugged/splice.vim/autoload/splicelib/init.py", line 62, in setlocal_buffers
    vim.command('set filetype=%s' % filetype)
  File "/usr/local/lib/python2.7/site-packages/neovim/api/nvim.py", line 218, in command
    return self.request('nvim_command', string, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/neovim/api/nvim.py", line 131, in request
    res = self._session.request(name, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/neovim/msgpack_rpc/session.py", line 98, in request
    raise self.error_wrapper(err)
NvimError: Vim(normal):E21: Cannot make changes, 'modifiable' is off

I use neovim, but I tried it with vim just to see if it interfered. I get the same result.

After that error, if I press enter I see the BASE file and the LOCAL file (horizontally split)

No syntax highlight for Original and Two (non-scripting languages)

Steps to reproduce:

hg init foo
cd foo
echo 'public class Foo { }' > Foo.java
hg ci -A -m 'empty Foo'
echo 'public class Foo { int x; }' > Foo.java
hg ci -m 'int x'
hg up 0
echo 'public class Foo { long x; }' > Foo.java
hg ci -m 'long x'
hg merge

Original (Foo.javabase.xxxxxx) and Two (Foo.javaother.xxxxxx) don't get syntax highlighted.

From what I can grasp by reading through $VIMRUNTIME/filetype.vim, Vim detects the file type from the file extension. Some extensions are ignored, and that's why One (Foo.java.orig) gets syntax highlighted in the example above - Vim ignores the "orig" extension.

If a file starts with "#!", Vim can detect the filetype based on the file contents ($VIMRUNTIME/scripts.vim). But that's not the case for Java and other non-scripting languages.

Maybe Splice should explicitly set the filetype of Original and Two to the same type of One and Result, since they are all alternate versions of the same file...

Splice closes immediatly on Windows

Hello , as i was trying to get splice up and running with the Windows git bash a ran into the problem, that the tool closes immediatly.

Git only gives the error message "merge of file.xyz failed" .

I'm using the current vim 7.4 msi installer version on windows 8. I added the path to the binaries of the vim installation to windows path, gvim works fine with the git bash and i did not ran into any troubles with it or the current config except of the splice tool.

Maybe this could be a conflict related to the python 3.3 Installation? Do i need the 2.5 + branch?

Sorry if i make any trouble ;)

Splice fails to load if any input file is missing

Attempting to open splice with less than four input files results in the following traceback:

"README.markdown" 18L, 672C
Error detected while processing function splice#SpliceInit:
line    2:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/srathbun/.vim/bundle/splice/autoload/splice.py", line 13, in <module>
    import splicelib.init as splice
  File "/Users/srathbun/.vim/bundle/splice/autoload/splicelib/init.py", line 2, in <module>
    import modes
  File "/Users/srathbun/.vim/bundle/splice/autoload/splicelib/modes.py", line 893, in <module>
    loupe = LoupeMode()
  File "/Users/srathbun/.vim/bundle/splice/autoload/splicelib/modes.py", line 433, in __init__
    self._current_buffer = buffers.result
  File "/Users/srathbun/.vim/bundle/splice/autoload/splicelib/util/bufferlib.py", line 52, in result
    return Buffer(4)
  File "/Users/srathbun/.vim/bundle/splice/autoload/splicelib/util/bufferlib.py", line 14, in __init__
    self.name = self._buffer.name
AttributeError: 'Buffer' object has no attribute '_buffer'
line    3:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'SpliceInit' is not defined

This also happens if you have four input files, but some of them are the same file.

Placing a print statement in the init method for buffer shows that the first buffer created is 4, and if there are less than 4 vim buffers, none are matched and the _buffer property is never defined.

Ability to quickly switch both panels in 'compare' mode

More often I find myself switching between "one <-> result" and and "original <-> two". I am copying the changes from "Original <-> two" into "one <-> result". The diff between "original <-> result" is not very helpful as it shows too many differences. I thought it would be nice to have simple way of switching the two views.

At the moment I am using these two command lines to achieve that:

:exe 2 . "wincmd w" | call splice#SpliceOriginal() | :exe 3 . "wincmd w" | call splice#SpliceTwo()

and

:exe 2 . "wincmd w" | call splice#SpliceOne() | :exe 3 . "wincmd w" | call splice#SpliceResult()

_BufferList::current fails in some cases

To summarize
In _BufferList::current there are checks like
abspath(bufname("%")) == abspath(vim.buffers[i].name)
or, in my case, simplified
abspath('/Users/err') == abspath('c:/Users/err')
which specifically is
'C:\Users\err' == 'c:\Users\err'
and this test fails because of drive letter case. It appears that abspath
preserves the case of a driver letter that is passed in, and uses upper
case when it adds a drive letter.
A fix is to do
bufname = ap(vim.buffers[vim.eval('bufnr("%")')].name)
at the entry to current and not use bufname("%"). Doing this, abspath
is no longer needed, the vim doc says buffers[].name is full path, so...
BTW, if there is concern about symlinks... then realpath should be used.

This is further simplified by using integers. The function becomes

    bufnr = int(vim.eval('bufnr("%")'))
    return Buffer(bufnr)

I don't know why this hasn't shown up for others previously.
I've just started using Splice. I'm using Cygwin, win7, though both hg and gvim
are native win apps. I think cygwin plays into it, but I can't tell why.
I'll investigate further and I'll set up a submit a pull request over the next few weeks.

Keeping the strings, it looks like

    bufname = vim.buffers[int(vim.eval('bufnr("%")'))].name

    if bufname == self.original.name:
        return self.original
    elif bufname == self.one.name:
        return self.one
    elif bufname == self.two.name:
        return self.two
    elif bufname == self.result.name:
        return self.result

Following is gory detail, summarizing my explorations...

given:
splice.executable = an essentially empty .bat file
splice.args = $base $local $other $output,
the output is:
...
merging f00
"c:\users\err\appdata\local\temp\f00base.kqpucf"
"c:\users\err\appdata\local\temp\f00
local.ym6qvj"
"c:\users\err\appdata\local\temp\f00~other.dyblkj"
"C:\f\play\mercurial\merge2\c0\f00"
2 files updated, 1 files merged, 0 files removed, 0 files unresolved
Note drive letter case is inconsistent, the output file has upper case "C".
F: is mounted on C: as f, so C:/f goes into the F: drive. That might have
something to do with it.

And from gvim, there is

:args
[/Users/err/AppData/Local/Temp/f00~base.ppb8mc]
/Users/err/AppData/Local/Temp/f00~local.hoolxp
/Users/err/AppData/Local/Temp/f00~other.jvwbfy
f00

:py import vim
:py for b in vim.buffers: print(b.name)
c:/Users/err/AppData/Local/Temp/f00~base.ppb8mc
c:/Users/err/AppData/Local/Temp/f00~local.hoolxp
c:/Users/err/AppData/Local/Temp/f00~other.jvwbfy
C:/f/play/mercurial/merge2/c0/f00

BUT
:echo bufname("%")
/Users/err/AppData/Local/Temp/f00~local.rorffx
:echo bufname("%")
f00

So vim.buffers[].name may be different from bufname("%")

It's curious that the .bat file shows a full path for f00,
but :args and bufname only shows the basename.

In a trivial python program that invokes abspath on its arguments
and prints before/after for each argument
$ ./apTest /Users/err c:/Users/err
=== using F:/pf/Python27/python
('/Users/err', 'C:\Users\err')
('c:/Users/err', 'c:\Users\err')
notice that abspath preserves the lower case "c:".

This all comes together in splicelib/util/bufferlib.py::_BufferList::current.
In _BufferList::current there are checks like
abspath(bufname("%")) == abspath(vim.buffers[i].name)
or simplified
abspath('/Users/err') == abspath('c:/Users/err')
which is
'c:\Users\err' == 'C:\Users\err'
and this test fails because of drive letter case.

I guess the discrepancy enters into it because vim's buffer[].name
is fname converted to an absolute path, forcing the drive letter to upper.

can't open submodule dir

when i open bundle/my_submodule dir by Gedit command ,
it will throw error: fugitive: unrecognized git type

[wishlist] support three file operation (i.e., where local == output)

Currently splice seems to support the hg/git/bzr way of doing a three-way merge, which involves having a different output file into which you are merging.

Other version control systems (e.g., Rational Team Concert) work in a way that the localFile and the outputFile are effectively the same file.

i.e., splice really gets called with:
gvim -f $BASE $LOCAL $REMOTE $LOCAL
but, because vim won't let you have more than one buffer pointing at the same file, this only opens three buffers and SpliceInit fails

The workaround I'm currently using is to just clone the local file into a temp file to use for $LOCAL, and then supply the actual local file path as $OUTPUT

i.e.,

#!/bin/sh                                                                       

BASE=$1                                                                         
LOCAL=`mktemp`                                                                  
REMOTE=$3                                                                       
OUTPUT=$4                                                                       

cp $OUTPUT $LOCAL                                                               

/usr/bin/gvim -f $BASE $LOCAL $REMOTE $OUTPUT -c 'SpliceInit'

However, it would be useful if Splice could support this operation natively?

Unknown function: splice#SpliceInit at launch

Hi there!

I installed Splice.vim through Vundle but I got these error when running git mergetool. Here is my .gitconfig:

[merge]¬                                                                         
▸   tool = splice¬                                                               
[mergetool "splice"cmd = "vim -f $BASE $LOCAL $REMOTE $MERGED -c 'SpliceInit'"¬trustExitCode = true

Nothing original as you can see.

Any idea?

Problem when file path contains dot

I have the following problem when one of files passed to splice has path like this

/normal/path/./with/dot


"~/tmp/20140926/intel/addin/SPAthena/src/SPUtils/SPSchedule.cpp.base" [readonly][noeol] 304L, 5854C
Error detected while processing function splice#SpliceInit:
line 2:
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/summit/ga2jaku/Summit/usr/local/share/vim/vim74/autoload/splice.py", line 13, in
import splicelib.init as splice
File "/usr/local/summit/ga2jaku/Summit/usr/local/share/vim/vim74/autoload/splicelib/init.py", line 2, in
import modes
File "/usr/local/summit/ga2jaku/Summit/usr/local/share/vim/vim74/autoload/splicelib/modes.py", line 893, in
loupe = LoupeMode()
File "/usr/local/summit/ga2jaku/Summit/usr/local/share/vim/vim74/autoload/splicelib/modes.py", line 433, in init
self.current_buffer = buffers.result
File "/usr/local/summit/ga2jaku/Summit/usr/local/share/vim/vim74/autoload/splicelib/util/bufferlib.py", line 52, in re
sult
return Buffer(4)
File "/usr/local/summit/ga2jaku/Summit/usr/local/share/vim/vim74/autoload/splicelib/util/bufferlib.py", line 14, in __
init
_
self.name = self._buffer.name
AttributeError: 'Buffer' object has no attribute '_buffer'
line 3:
Traceback (most recent call last):
File "", line 1, in
NameError: name 'SpliceInit' is not defined
Press ENTER or type command to continue

Add different diff combinations (and tweak their order)

Two requests: an addition and a change

  1. In grid-mode, 3 buffer view (both vertical and horizontal split) add the option of diff'ing 2 of those 3 buffers, like in path mode

  2. In path-mode, make diff'ing all 3 buffers the first option of the cycle

can't view Two and Result in diff mode

Sorry, I did no investigation so far, it would be interesting to see if you can reproduce it.

This script reproduces it for me:

set -x
rm -rf a b
hg init a                                                                                                                                                     
cd a                                                                                                                                                          
echo a > a                                                                                                                                                    
hg ci -A -m a                                                                                                                                                 
cd ..                                                                                                                                                         
hg clone a b                                                                                                                                                  
cd a                                                                                                                                                          
echo b >> a                                                                                                                                                   
hg ci -A -m a                                                                                                                                                 
cd ../b                                                                                                                                                       
echo c >> a                                                                                                                                                   
hg ci -A -m b                                                                                                                                                 
hg pull --rebase
  • now I'm in grid mode, so pressing leader d
  • now I do see Original (left) and Result (right). I want to compare Two and Result, so going to left window ctrl-w h and leader 2
  • now I do see One (left) and Two(right)

I would suppose to see One (left) and Result (right).

Thank you

Vlad

Unknown Function: splice#SpliceInit

I've got the following error message when running $ git mergetool:

Error executing "command line":
E117: Unknown Function: splice#SpliceInit

I'm working with

  • vim 7.4.131
  • git 1.8.5.2
  • upstream version of Splice
  • Gentoo with linux-3.12.6 as my OS
  • python 3.2

Pathogen is installed and :help splice shows me the documentation.

SpliceInit; bufferlib.py: Value must be greater than zero.

When using git mergetool and opening gvim, I get the following stacktrace:

Error detected while processing function splice#SpliceInit:
line    2:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/philip/.vim/bundle/splice.vim/autoload/splice.py", line 13, in <module>
    import splicelib.init as splice
  File "/home/philip/.vim/bundle/splice.vim/autoload/splicelib/init.py", line 2, in <module>
    import modes
  File "/home/philip/.vim/bundle/splice.vim/autoload/splicelib/modes.py", line 894, in <module>
    compare = CompareMode()
  File "/home/philip/.vim/bundle/splice.vim/autoload/splicelib/modes.py", line 512, in __init__
    self._current_buffer_first = buffers.original
  File "/home/philip/.vim/bundle/splice.vim/autoload/splicelib/util/bufferlib.py", line 37, in original
    return Buffer(0)
  File "/home/philip/.vim/bundle/splice.vim/autoload/splicelib/util/bufferlib.py", line 10, in __init__
    self._buffer = vim.buffers[i]
ValueError: number must be greater then zero
line    3:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'SpliceInit' is not defined

gvim 7.3.1287-1

Splice error during startup, modifiable is off

When attempting to use splice, I get the following traceback:

"Database.js.BASE.67139.js" 945L, 31423C
"Database.js.REMOTE.67139.js" 953L, 31708C
Error detected while processing function splice#SpliceInit:
line    3:
E21: Cannot make changes, 'modifiable' is off
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/srathbun/.vim/bundle/splice/autoload/splice.py", line 19, in SpliceInit
    splice.init()
  File "/Users/srathbun/.vim/bundle/splice/autoload/splicelib/init.py", line 113, in init
    modes.current_mode.activate()
  File "/Users/srathbun/.vim/bundle/splice/autoload/splicelib/modes.py", line 394, in activate
    return super(GridMode, self).activate()
  File "/Users/srathbun/.vim/bundle/splice/autoload/splicelib/modes.py", line 102, in activate
    self.layout(self._current_layout)
  File "/Users/srathbun/.vim/bundle/splice/autoload/splicelib/modes.py", line 73, in layout
    getattr(self, '_layout_%d' % layoutnr)()
  File "/Users/srathbun/.vim/bundle/splice/autoload/splicelib/modes.py", line 224, in _layout_0
    self.open_hud(5)
  File "/Users/srathbun/.vim/bundle/splice/autoload/splicelib/modes.py", line 124, in open_hud
    self.redraw_hud()
  File "/Users/srathbun/.vim/bundle/splice/autoload/splicelib/modes.py", line 165, in redraw_hud
    buffers.hud.set_lines(self.hud_lines())
  File "/Users/srathbun/.vim/bundle/splice/autoload/splicelib/util/bufferlib.py", line 19, in set_lines
    self._buffer[:] = lines
vim.error: cannot save undo information

Use hunks from both 1 and 2

I'm able to select a hunk for a conflict from either 1 or 2 but can't seem to add both files' hunks to the result file.
Is this possible?

KeyError occurs in SpliceInit

KeyError following occurs when I run vim 1 2 3 4 -c SpliceInit.

Error detected while processing function splice#SpliceInit:
line    2:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/test/.vim/autoload/splice.py", line 13, in <module>
    import splicelib.init as splice
  File "/home/test/.vim/autoload/splicelib/init.py", line 2, in <module>
    import modes
  File "/home/test/.vim/autoload/splicelib/modes.py", line 894, in <module>
    compare = CompareMode()
  File "/home/test/.vim/autoload/splicelib/modes.py", line 512, in __init__
    self._current_buffer_first = buffers.original
  File "/home/test/.vim/autoload/splicelib/util/bufferlib.py", line 37, in original
    return Buffer(0)
  File "/home/test/.vim/autoload/splicelib/util/bufferlib.py", line 10, in __init__
    self._buffer = vim.buffers[i]
KeyError: 0
line    3:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'SpliceInit' is not defined

It seems to have occurred by accessing vim.buffers[0].

I suspect the impact of Patch 7.3.945.

Patch 7.3.945
Problem: Python: List of buffers is not very useful.
Solution: Make vim.buffers a map. No iterator yet. (ZyX)

ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.945

In the following states,

:ls
  1 %a   "1"                            line 1
  2      "2"                            line 0
  3      "3"                            line 0
  4      "4"                            line 0

when I run the following:

python print vim.buffers[0]
python print vim.buffers[1]
python print vim.buffers[2]
python print vim.buffers[3]
python print vim.buffers[4]
python print vim.buffers[5]

It will be the following results:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
KeyError: 0
<buffer 1>
<buffer 2>
<buffer 3>
<buffer 4>
Traceback (most recent call last):
  File "<string>", line 1, in <module>
KeyError: 5

Index of vim.buffers is made to 1-4 in this case.

version:
  • VIM 7.3.1214
  • Python 2.7.5

Bug in changing files to compare

When in compare mode, I'm having trouble switching from comparing One and Result to Two and Result.

With One select I try and switch it with Two, but the result is One and Two instead.

Update docs on fugitive

If fugitive is still a "sometimes" problem with splice, can we update the help docs to include:

if you have problems with fugitive, or any other vim plugin, modify your git command to run splice:
    cmd = "vim -f $BASE $LOCAL $REMOTE $MERGED --cmd 'let g:pathogen_disabled=[\"fugitive\"]' -c 'SpliceInit'"

and add this to your vimrc:
    if !exists("g:pathogen_disabled")
        let g:pathogen_disabled = []
    endif

this will set fugitive to be disabled with pathogen when you use splice, and it won't get loaded, thereby avoiding the conflicts. You can add any additional conflicting plugins into the list as well.

Add Python 3 support

The homebrewed MacVim can only be installed with either Python 2 *or 3 support, but not both. So I enabled Python 3 support and noticed that splice.vim does not work with Python 3.

I think it is “relatively” easy to support both versions. The Python code looks relatively compatible with both versions. Maybe you have to fix the relative-import thing introduced with Python 3.3(?). You also need to modify autoload/splice.vim as followed (inspired by the python-mode plug-in which supports both Python versions). You basically define aliases for pyfile and python depending on the Python version and use them instead of the orginal commands:

" [...]

" 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
    " Define aliases to pyfile and python
    let s:splice_pyfile = 'pyfile'
    command! -nargs=1 SplicePython python <args>
elseif has('python3')
    let s:has_supported_python = 3
    " Define aliases to py3file and python3
    let s:splice_pyfile = 'py3file'
    command! -nargs=1 SplicePython python3 <args>
else
    let s:has_supported_python = 0
endif
" [...]

" Wrappers {{{

function! splice#SpliceInit() "{{{
    let python_module = fnameescape(globpath(&runtimepath, 'autoload/splice.py'))
    exe s:splice_pyfile . ' ' . python_module
    SplicePython SpliceInit()
endfunction "}}}

" [...]

" }}}

Please let me now if I can help you (e.g., with testing).

Splice.vim is awesome. Thanks! :-)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.