Commit Graph

9 Commits

Author SHA1 Message Date
Andy Stewart
e5eb9e6ecf Fix staging of hunks coming after deleted lines.
Previously vim-gitgutter generated context-free patches and applied
those to the index.  However when staging a hunk situated after any
deleted lines, the line numbers on the patch were out by the number
of lines deleted, and without any context git would apply the patch
to the wrong part of the file in the index.

This commit ensure patches are generated with 1 line of context,
allowing git to adjust the line numbers appropriately and apply the
patch to the right location.

More lines of context would help git more to adjust line numbers; but
the more context we have the more we group together hunks we would
like to treat separately.
2014-10-16 11:50:20 +02:00
Andy Stewart
1e8201963c Ensure closing preview window deletes previewed buffer. 2014-09-23 10:03:14 +02:00
Andy Stewart
83ace2014a Suppress signs when there are more than 500. 2014-07-21 16:36:16 +02:00
Andy Stewart
fed2dbad34 Move every function into gitgutter namespace.
This makes profiling much easier.
2014-06-26 11:09:29 +02:00
Andy Stewart
a2aa2b1100 Avoid Windows command prompt popups when possible.
Before this commit some Windows users saw the command prompt pop
up briefly, and/or the taskbar flicker, every time the plugin ran.

Now the plugin will use xolox's vim-shell and vim-misc, if they are
available and we are on Windows, to execute external commands.  Xolox's
clever plugins avoid the command prompt popup and taskbar flicker.

Windows users with those plugins installed can opt out by setting a
variable in their vimrc.

Many thanks to @suxpert for the initial code.
2014-06-19 10:45:40 +02:00
Andy Stewart
ceeba75239 Fix independent toggling of signs in sign column and line highlights.
Note that line highlighting requires signs to be placed (because the
line highlight is simply an attribute of a sign).  If the user doesn't
want to see signs in the sign column, but does want line highlighting,
then we make the signs in the sign column invisible.

If neither the signs in the sign column nor the line highlights are
needed (presumably the user just looks at the hunks stats) then we can
remove all signs, at which point Vim removes the sign column...unless
the "sign column always" option is set.
2014-05-19 15:50:51 +02:00
Andy Stewart
a4347c57ea When disabling, disable across all buffers. 2014-04-14 15:24:25 +02:00
Andy Stewart
0ca3f7e3cd Add hunk previewing. 2014-03-18 13:50:22 +01:00
Andy Stewart
9c66906d56 Move logic out of main plugin file. 2014-03-17 11:27:31 +01:00