Prior to this patch, it was not possible to dynamically apply arguments
to diff commands. The g:signify_diffoptions variable was only read when
the plugin was loaded.
This patch changes the behavior so that before each diff it checks
g:signify_diffoptions to see what arguments should be passed to the diff
tool.
The motivating use case behind this change is to be able to diff against
a different branch in Git via a key mapping. However, This change will
also allow any other arbitrary diff options to be dynamically updated,
such as whitespace, etc.
Example: Show diff against master instead of against HEAD in Git
nnoremap \u :let g:signify_diffoptions = { 'git': 'master'}<CR>:SignifyToggle<CR>
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.
After one of the recent changes 'deleted' was used in a place where
'removed' should have been used. This could lead errors:
Error detected while processing function
sy#toggle..sy#start..sy#repo#process_diff..sy#sign#set:
line 10:
E155: Unknown sign: SignifyChangeDelete12
ANSI escape sequences in a patch would confuse Sy. People are advised to
set their color settings to 'auto' instead of 'always', so color codes
would only be used if the output is meant for the terminal.
Thus we just ignore color.diff settings now.
References #72.
The [default] argument is used for setting the default highlighting for a group. If highlighting has already been specified for the group the command will be ignored. Also when there is an existing link.
This patch makes jumps go the the first/last hunk when the given count
was bigger than the available hunks.
E.g. when there are only 2 hunks and you use 4]c, the cursor jumps to
the last hunk nevertheless. Before this patch the cursor wouldn't move
at all (which mimics the standard behaviour of ]c/[c).
Closes#41.