Andy Stewart
dfe985a1a6
Use buffer numbers instead of buffer names.
...
Also don't pass buffer number to functions when they can look it up
themselves.
Using buffer numbers also eliminates any ambiguity which might arise
from symbolic links, where you have potentially two names for a file.
Thanks to @Z1MM32M4N for work on this (see #209 ).
2014-11-14 12:55:40 +01:00
Andy Stewart
39f0119096
Whitespace.
2014-10-17 09:24:52 +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
64ad9e46a5
Specify UTF-8 to avoid problems with overscore character.
2014-06-11 18:49:12 +02:00
Andy Stewart
c6e5cf49f2
Show sign on first line when line(s) deleted at start of file.
...
This time with silly mistake fixed.
2014-06-02 09:20:51 +02:00
Andy Stewart
d1e66b71f9
Revert "Show sign on first line when line(s) deleted at start of file."
...
Signs aren't shown for deleted lines which aren't at the start of the
file.
This reverts commit 0fd18d66f6 .
2014-05-31 16:57:15 +02:00
Andy Stewart
0fd18d66f6
Show sign on first line when line(s) deleted at start of file.
2014-05-30 17:03:54 +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
Andy Stewart
eee8ba4cff
Refactor hunk functionality.
2014-03-17 10:48:05 +01:00
Andy Stewart
fd98657d2f
Handle vim versions lacking gettabvar().
2014-03-14 09:35:54 +01:00
Andy Stewart
973c19e1d5
Don't pester user if their Vim is too old for realtime updates.
2014-02-20 11:56:50 +01:00
Andy Stewart
f291db08c7
Disable realtime updates when Vim older than 7.3.105.
2014-02-14 12:59:39 +00:00
Andy Stewart
37491628f4
Add debug command.
2014-02-03 14:13:05 +01:00
Andy Stewart
072846e945
Don't place/unplace dummy sign unnecessarily.
2014-01-27 14:15:19 +01:00
Andy Stewart
8ada986fcf
More accurate error message.
2014-01-27 13:41:05 +01:00
Andy Stewart
f2e08dbeb3
Move git-tracking check into diff command.
...
This avoids shelling out twice per buffer: once to check whether git
knows about the file and once to perform the diff. Now we simply do
both in one external call.
Profiling showed external calls to git taking ~20ms. This doesn't seem
too bad but it adds up.
2014-01-27 10:48:47 +01:00
Andy Stewart
811d9af7a9
Comment code sections.
2014-01-16 11:33:46 +01:00
Andy Stewart
9e99e4d4f1
Neater way to toggle conditional.
2014-01-16 11:33:25 +01:00
Andy Stewart
bb87232842
Add ability to toggle signs on and off.
2014-01-16 11:32:41 +01:00
Andy Stewart
ecdf2e58a1
Whitespace.
2014-01-16 10:42:54 +01:00
Andy Stewart
0537c6945a
Use [c and ]c to jump between hunks (changes).
...
This is more consistent with Vim.
2014-01-15 15:36:13 +01:00
Andy Stewart
6c435e5681
Fix typo in map for staging hunk.
2014-01-14 15:07:22 +01:00
Andy Stewart
ae81dccb67
Add configuration option to disable key maps.
...
And add a little documentation.
2014-01-13 11:01:14 +01:00
Andy Stewart
648281497f
Standardise on .
2014-01-10 10:48:20 +01:00
Andy Stewart
ff79a0ab85
Disable vim-gitgutter during :vimgrep.
2014-01-10 10:34:24 +01:00
Andy Stewart
92abcce1ff
Stage and revert individual hunks.
2014-01-09 12:14:59 +01:00
Andy Stewart
03ca0f8d93
Extract utility functions.
2014-01-08 09:55:54 +01:00
Andy Stewart
6369f5033b
Inline boolean logic.
2014-01-08 09:49:15 +01:00
Andy Stewart
2caf156c47
Eliminate redundant argument.
2014-01-08 09:47:43 +01:00
Andy Stewart
7919906105
Fix bug that processed buffers it shouldn't have.
...
All processing logic should be guarded by `utility#is_active()`.
2014-01-08 09:40:16 +01:00
darrenli
0218e08c9e
Fix GitGutter argument errors on save and toggle.
2014-01-07 21:40:34 +01:00
Andy Stewart
d420a44536
Reduce duplicate work due to overlapping autocommands.
2014-01-07 15:02:27 +01:00
Andy Stewart
fa582f7863
Only redraw when changing line highlighting.
2014-01-07 10:21:04 +01:00
Andy Stewart
faa6aaf669
Minimise sign place/unplace calls to speed things up.
...
Profiling shows that `:sign place` and `:sign unplace` are slow despite
being native vimscript functions. This commit minimises the number of
such calls by only updating signs that have changed.
2014-01-06 17:05:01 +01:00
Andy Stewart
cde54e3066
Simplify initialisation.
2014-01-06 11:47:42 +01:00
Andy Stewart
8a3d1cb88b
Remove obsolete code.
2014-01-06 10:43:53 +01:00
Andy Stewart
702d27a84f
Autoload.
2013-12-17 11:03:52 +01:00
Bailey Ling
926aea86c1
Clear out hunks stats when file is not tracked.
2013-12-07 14:51:16 +00:00
Andy Stewart
f2e794b484
Always use realtime diff when buffer is modified.
...
This was motivated by Vim regaining focus into a buffer with unsaved
changes, and the realtime diff being replaced with an out of date disk
diff. With this commit the realtime diff will be run again.
2013-12-07 14:42:45 +00:00
Jakob Rath
cdfde92a15
Use correct line ending for realtime diff.
2013-12-07 14:00:07 +00:00
Suraj N. Kurapati
c5872cd042
support using POSIX sh(1) as set shell=/bin/sh
...
Use `cd` instead of `popd` because POSIX sh(1) does not have `pushd` and
also because this plugin did not pair its `pushd` with a `popd` anyway.
Use file redirection because POSIX sh(1) does not have anonymous pipes.
2013-09-25 10:42:13 -07:00
Bailey Ling
c44f4b8be6
Fix calculation of removed lines for hunk summary.
2013-08-21 11:30:10 +02:00
Wilson Y. Wong
6955f6dc91
Replace cd with pushd,
...
currently NOT working for windows
2013-08-19 19:22:05 -07:00
Andy Stewart
e07e6aa601
Move hunk summary function to diff utility section.
2013-08-19 17:55:46 +02:00
Bailey Ling
bdaff53497
add documentation for GitGutterGetHunkSummary.
2013-08-19 15:41:26 +00:00
Bailey Ling
8951f68795
extract updating hunk summary into another function.
2013-08-19 15:26:24 +00:00
Bailey Ling
ab58e070cf
introduce GitGutterGetHunkSummary for statusline integration.
2013-08-19 14:53:57 +00:00