Commit Graph

193 Commits

Author SHA1 Message Date
Marco Hinz
dd34401bc3
Prevent running Sy more than once during startup 2017-02-03 20:48:48 +01:00
Marco Hinz
dea49a1967
Fix toggling when g:signify_disable_by_default is set 2017-02-03 01:49:46 +01:00
James McCoy
8d5e018519 Rename variable to work with older (n)vim, when types were sticky
Closes #213
2017-02-01 09:10:06 -05:00
Marco Hinz
f194e3aced
Fix get_diff_start_{vcs}() for older Vims
Fixes #212.
2017-01-31 12:15:35 +01:00
Marco Hinz
6d8837f878
Fix TFS context stripping
Fixes #211.
2017-01-31 11:36:16 +01:00
James McCoy
716ce90fe4 Simplify job ID handling a little more 2017-01-30 09:31:14 -05:00
Marco Hinz
014b058d3d
Simplify job ID handling 2017-01-30 15:26:11 +01:00
Marco Hinz
82d6df9f71
Don't switch window in exit handler
Since we don't switch the window anymore, we can't simply refer to b:sy as we
used to do while Sy worked only synchronously.

Now we provide the buffer number to each job and the exit handler gets a pointer
to the b:sy of that buffer and passes it to all the subsequent functions.

References #209, #210.
2017-01-30 14:50:32 +01:00
Marco Hinz
68013238b4
Restrict to be removed sign IDs to buffer 2017-01-29 02:22:35 +01:00
Marco Hinz
f7678884f0
Race condition: make sure we're still in same buffer
Fixes #207.
2017-01-23 13:37:53 +01:00
Marco Hinz
e43155f3e1
Fix typo in callback_stdout_nvim()
Fixes #206.
2017-01-23 12:50:16 +01:00
Marco Hinz
0db69f4658
Fix CVS
References #205.
2017-01-23 02:58:41 +01:00
Marco Hinz
9ced2cf73f
Fix arguments of a few diff functions
Fixes #205.
2017-01-23 02:02:03 +01:00
Marco Hinz
faf5240823
Fix exit callback
Vim provides 2 arguments to the exit handler whereas Neovim always provides 3.
Change function signature to handle an optional third argument, even if it never
gets used.

Fixes #204.
2017-01-22 20:42:31 +01:00
Marco Hinz
8f3fc1c023
Simplify a few verbose messages 2017-01-18 17:27:44 +01:00
Marco Hinz
295e449db6
Add sy#util#chdir() 2017-01-18 17:15:15 +01:00
Marco Hinz
304a2b9c27
Simplify sign ID handling 2017-01-18 16:28:35 +01:00
Marco Hinz
b839e8092f
Add s:initialize_job() 2017-01-18 13:40:34 +01:00
Marco Hinz
3aa8eb9ec6
Jump to correct window in exit handler 2017-01-18 11:07:21 +01:00
Marco Hinz
3f9c4e4ea0
Don't retry VCS detection for performance purposes
For each new buffer sy#repo#detect() gets run. That function invokes callbacks
for all VCS from g:signify_vcs_list.

If no callback finds a valid repo, sy#set_signs() is never called and the VCS
type of the newly registered buffer keeps its initial value: "unknown".

The next time Sy gets run in that buffer, Sy will disable itself, so that all
subsequent times it gets run it will never even attempt to get a diff.

If a buffer was added to a repo that was initialized after Sy registered that
buffer, it will remain inactive.

In those cases, :SignifyEnable will purge the cache for the current buffer and
start all over.
2017-01-18 10:50:07 +01:00
Marco Hinz
f6a0a50e06
Only run s:set_signs() if diff was found 2017-01-18 03:43:59 +01:00
Marco Hinz
6c2b6c4f08
Refactoring 2017-01-18 02:42:00 +01:00
Marco Hinz
fcecc3c868
Remove rather useless :SignifyDebugDiff 2017-01-18 00:14:36 +01:00
Marco Hinz
31d4c55187
Make sy#verbose() slightly more useful 2017-01-17 23:57:29 +01:00
Marco Hinz
0e609fdf1d
Make Vim and job_start() work 2017-01-17 23:12:00 +01:00
Marco Hinz
72c7ba9e2b
Make all supported VCS work 2017-01-17 20:37:58 +01:00
Marco Hinz
d2fda2847f
Propagate the correct VCS 2017-01-17 19:45:03 +01:00
Marco Hinz
0df130ac6e
Make Vim + system() work 2017-01-17 19:41:55 +01:00
Marco Hinz
a67b613acf
Add more calls to sy#verbose() 2017-01-17 17:04:19 +01:00
Marco Hinz
e72ccb952d
PoC: make async work with git and Neovim 2017-01-17 16:17:16 +01:00
Marco Hinz
3ad10c65b5
First changes 2017-01-17 14:22:19 +01:00
Marco Hinz
379db4ad0b
Add missing comment 2017-01-10 14:45:28 +01:00
James McCoy
32d8797d88 Check whether :tcd exists before using tab-specific haslocaldir()
Closes #197
2016-12-31 15:52:09 +01:00
Marco Hinz
79d867a7a6
Remove unused argument
Temporarily changing directories is cheap.
2016-12-30 14:27:12 +01:00
Marco Hinz
4aca2ee9c5 Don't rely on :language
Fixes #187.
2016-12-15 14:56:20 +01:00
Marco Hinz
fab2a9d878 SignifyRefresh: use window ID instead of number
`win_getid()` and `win_gotoid()` were introduced in 7.4.1557.

Older versions will continue using the less accurate window number instead.
2016-12-11 01:02:35 +01:00
Henry Kupty
a7e3219de8 Fix tcd breakage
This fix is backwards compatible with vim.
2016-10-07 04:27:11 +02:00
Marco Hinz
faf7a03071
New option: g:signify_sign_show_text
This makes all Signify signs use a non-breaking space as text. This is
convenient if only the background colors of the signs are important.

References #188.
2016-09-28 17:05:40 +02:00
Marco Hinz
3037d0bd8a Only emit User event if there is a receiving end
This way we can also leave away the :silent and users can't walk into the
:unsilent trap.
2016-07-21 18:26:34 +02:00
Marco Hinz
76bde232d1 Avoid errors from older Vims that don't support <nomodeline>
The <nomodeline> flag for :doautocmd was implemented in 7.3.438. Certain
LTS distros, e.g. Ubuntu 12.04, come with even older Vim versions,
though.

Silently ignore the flag in such cases.

Closes https://github.com/mhinz/vim-signify/issues/185
2016-06-19 14:12:47 +02:00
James McCoy
f708bc475f Stop clearing stats in sy#sign#remove_all_the_signs 2016-06-01 21:13:33 -04:00
James McCoy
3f0df1498c Trigger the User autocommand when Sy detects differences
This provides the hook needed for the request in mhinz/vim-signify#181
to disable signs but still get the stats about the detected changes.

Closes mhinz/vim-signify#181
2016-06-01 21:13:15 -04:00
Marco Hinz
9c0e901579 TFS: support incomplete lines
Add support for incomplete lines according to:

    http://www.gnu.org/software/diffutils/manual/diffutils.html#Incomplete-Lines

Closes #183.
2016-06-01 18:12:29 +02:00
James McCoy
37376d9970 Treat v:shell_error >= 2 as "not version controlled" for AccuRev
When a user isn't logged in, "accurev diff" will return an exit code of
52.  Since the only well defined values are 0 or 1, treat anything else
as unversioned.
2016-04-08 11:16:14 -04:00
James McCoy
6b4abcd754 Detect AccuRev controlled, but unmodified, files properly
"accurev diff" returns 0 for no diff, 1 for differences, and 2 for error
(like not being run from a workspace).  Use 2 to indicate the file isn't
being versioned by AccuRev so Sy properly sets the vcs type to AccuRev
for unmodified files.
2016-03-31 10:16:54 -04:00
Marco Hinz
a02c8793bf New option: g:signify_skip_filename_pattern
Closes #179.
2016-03-03 14:53:17 +01:00
James McCoy
ca302f7233 Replace all modifiers in a vcs_cmd string, not just the first.
Closes #176

Signed-off-by: James McCoy <jamessan@jamessan.com>
2016-03-02 13:03:38 -05:00
Marco Hinz
051dc1a853 Add support for Team Foundation Server
The actual patch is courtesy of @Grueslayer. Thanks!

Closes #177.
2016-02-25 01:21:12 +01:00
Marco Hinz
4f69c11c7c De Morgan 2016-01-15 17:02:53 +01:00
Marco Hinz
e73a0114f3 Add sy#buffer_is_active()
Mostly an API function that can be used by other plugins.
2016-01-15 12:56:21 +01:00