Commit Graph

565 Commits

Author SHA1 Message Date
Marco Hinz
63efffcae7
Realtime: don't run twice on BufEnter 2017-02-24 18:16:14 +01:00
Marco Hinz
0a09008179
Remove now useless workarounds 2017-02-24 18:09:06 +01:00
Marco Hinz
9d0947952e
Avoid running detection more than once
Before this change, it was possible that a buffer was disabled, when Sy was run
more than once at startup, e.g. because of `BufEnter` and `FocusGained`.

The first call would start the detection and the second call would disable the
buffer, because the first call hadn't changed the VCS type from "unknown" yet.
2017-02-24 17:16:17 +01:00
Marco Hinz
0a65a0c504
Avoid useless updates 2017-02-24 12:48:35 +01:00
Marco Hinz
01bcf8afab
Win/gVim: fix "no signs at start" race 2017-02-21 17:10:48 +01:00
Marco Hinz
d155dffd9d
GUI: use :redraw for all GUIs except MacVim 2017-02-20 16:47:35 +01:00
Marco Hinz
01ec338fdb
Add User event "SignifySetup" 2017-02-20 16:42:05 +01:00
Marco Hinz
8fa3524a13
Remove g:signify_cursorhold_normal and g:signify_cursorhold_insert
If you want that behaviour, set 'autowrite' instead.

References #226.
2017-02-20 16:16:07 +01:00
Marco Hinz
88cae56c30
Simplify autocmd setup 2017-02-20 16:05:55 +01:00
Marco Hinz
bf099a3fe2
Nvim: provide cwd to jobstart() 2017-02-20 15:14:24 +01:00
Marco Hinz
61d5a48c71
Simplify has-patch condition
The new format is supported since 7.4.237. If a Vim doesn't recognize the
format, it's too old by definition.
2017-02-20 15:03:34 +01:00
Marco Hinz
7a639b0263
Rename callback functions 2017-02-20 14:52:24 +01:00
Marco Hinz
0908e37758
Vim: make sure all stdout is read when job exits
References #228.
2017-02-20 14:47:51 +01:00
Marco Hinz
3020873ee4
Use correct cwd in verbose output 2017-02-20 01:38:25 +01:00
Marco Hinz
2778fd928c
GUIs: redraw screen after sign update
Some GUIs (MacVim, gVim) wouldn't show placed signs after updating. Force a
redraw.

References #228.
2017-02-20 01:15:50 +01:00
Marco Hinz
40deeb3fdf
Win: string passed to job_start() must contain shell
References #228.
2017-02-19 17:11:07 +01:00
Marco Hinz
e1396b903c
Add cmd and cwd to verbose output 2017-02-19 02:23:06 +01:00
Marco Hinz
e8252ba44d
Doc: update g:signify_realtime 2017-02-18 20:26:40 +01:00
Marco Hinz
5940039dcf
REAMDE: cosmetic changes 2017-02-18 20:17:17 +01:00
Marco Hinz
05f6ff91f4
New option: g:signify_realtime
By default Sy only updates signs when opening or writing a buffer that is backed
by a file on disk.

If that's too conservative to you, enable this option. It makes Sy update signs
on almost every occasion.
2017-02-18 18:06:44 +01:00
Marco Hinz
34ee12d179
Vim compat fix: type variables were introduced in 7.4.2071
To avoid issues for Vim versions between 7.4.1966 and 7.4.2071, we now use
type() to distinguish between the type of variable `job_id` being either Number
or Job.
2017-02-17 16:25:00 +01:00
Marco Hinz
255b2a636a
Doc: add modus operandi and debug section 2017-02-17 16:21:04 +01:00
Marco Hinz
8d35722aa1
Fix "Calling dict function without Dictionary"
Closes #223.
2017-02-17 15:14:34 +01:00
Marco Hinz
b7db40e58e
Vim uses Job instances instead of job IDs
References #222.
2017-02-17 11:29:06 +01:00
Marco Hinz
6364e8f7f2 Vim: use close_cb to trigger exit_cb
Before Vim 8.0.50, an exited job was only detected with a potentially huge
delay.

Thus, for versions smaller than 8.0.50, we add a close_cb callback that runs
job_status() which in return runs the exit_cb callback immeditely if the job was
found to be dead.

Vim patch:

    01688ad545

References: #216.
2017-02-16 15:29:41 +01:00
Marco Hinz
45a28549bd
FAQ: Line highlighting without showing signs?
References #220.
2017-02-15 21:54:55 +01:00
Marco Hinz
f6d76b41d6
Neovim: fix stdout logic
References #218.
2017-02-15 15:27:24 +01:00
Marco Hinz
a2c28f6540
A diff is a list of lines and no long string anymore
References #216.
2017-02-10 17:40:11 +01:00
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