Commit Graph

62 Commits

Author SHA1 Message Date
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
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
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
31d4c55187
Make sy#verbose() slightly more useful 2017-01-17 23:57:29 +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
Henry Kupty
a7e3219de8 Fix tcd breakage
This fix is backwards compatible with vim.
2016-10-07 04:27:11 +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
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
a02c8793bf New option: g:signify_skip_filename_pattern
Closes #179.
2016-03-03 14:53:17 +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
Marco Hinz
a96f1a7dc7 Register non-versioned files as inactive 2016-01-15 02:04:59 +01:00
William Clemens
e134c152e0 Add :SignifyEnable and :SignifyDisable 2016-01-07 02:54:44 +01:00
Marco Hinz
861f1b24d8 Remove dead :autocmd! 2015-06-01 12:13:06 +02:00
Marco Hinz
0814b97d2a Refact: b:sy_path -> sy_path 2015-06-01 12:10:28 +02:00
Marco Hinz
335c2944be Stop Sy if file isn't readable anymore
References #162.
2015-06-01 12:04:50 +02:00
Marco Hinz
50a3161bd5 Update b:sy_info more often
This avoids outdated cache entries if paths changed between calls to Sy.

References #162.
2015-06-01 11:13:28 +02:00
Marco Hinz
c0da740d7e Don't cache cwd 2015-05-28 18:40:30 +02:00
Marco Hinz
23ddfa87a0 Use b:sy_info 2015-05-20 14:00:39 +02:00
James McCoy
c61dded98a Add the buffer number as an argument to sy#stop()
sy#stop() is called by the BufDelete autocmd so b: variables may not
correspond to the buffer actually being deleted.  Instead, we must use
<abuf> to determine which buffer is being deleted and pass that into
sy#stop().

There are some ripple effects, causing sy#sign#remove_all_signs to also
gain a buffer number argument.

Signed-off-by: James McCoy <vega.james@gmail.com>
2014-11-25 11:25:40 -05:00
Marco Hinz
a03bee658f Add support for lazy loading 2014-11-02 09:28:54 +01:00
Marco Hinz
8cef26186e Make sure b:sy_path is always set
References #136.
2014-10-04 19:48:10 +02:00
Marco Hinz
a149ad9510 README: update 2014-10-04 16:20:17 +02:00
Marco Hinz
fe3bafce11 Introduce smarter sign management 2014-10-04 15:56:10 +02:00
Marco Hinz
5baf161ae4 Skip help files by default 2014-09-18 15:39:50 +02:00
Marco Hinz
0725f93014 Fix help filetype skipping 2014-09-18 15:34:26 +02:00
Kevin
9ca274d792 Fix error when toggling on a new file
Toggling on a new file lead to an error since b:sy wouldn't exist at
that time.

Closes #124.
2014-06-13 16:36:08 +02:00
Marko Tibold
dcae627181 Improve speed of :vimgrep by using a global lock 2013-11-26 11:11:52 +01:00
Marco Hinz
6ecab1b621 Prevent potential regressions
References #95.
2013-11-22 16:44:06 +01:00
Marco Hinz
f7dc63e819 Remove 3-argument getbufvar() for better compatibility
References #95.
2013-11-22 16:14:28 +01:00
James McCoy
5211c19ee7 Move Sy's data from g:sy to b:sy 2013-11-22 13:48:49 +01:00
Øystein Walle
bf01a95f9e Stylistic change 2013-11-09 14:21:49 +01:00
Marco Hinz
1499f548a2 Improve repo detection
Prior to this patch a VCS was only detected by checking if a potential
diff was empty or not. Now the combination of return value and diff is
checked, so it detects an underlying VCS properly even when there are no
changes.

This can save many useless calls to the wrong version control systems.

Simple test:

 - open a version-controlled file without any changes
 - :SyDebug should show the correct VCS now (instead of 'unknown')

Closes #82.
2013-11-03 19:31:46 +01:00
Marco Hinz
ec4d88eb1c Change default value for sign overwriting
References #81.
2013-10-30 12:16:07 +01:00
Marco Hinz
c2cce93b13 Change warning message for sign overwriting
References #81.
2013-10-30 12:12:54 +01:00
Marco Hinz
531d3abd87 Remove misplaced modeline 2013-10-02 14:56:01 +02:00
Marco Hinz
50496311c5 Remove guards from autoload files 2013-09-30 10:22:20 +02:00
Marco Hinz
a9284f363c Move modelines to the top 2013-09-30 10:19:31 +02:00
Marco Hinz
5f36c16ff5 Test if 'sign unplace *' is supported 2013-09-30 09:40:46 +02:00
Marco Hinz
0b6ffd8d00 Add simple directory cache 2013-09-13 01:23:05 +02:00