If there are more than 99 deleted lines, the actual count isn't being
important anymore. Thus we just let it overflow and save another
conditional.
100 deleted lines -> "00"
Closes#109.
This bug happened when a unicode character was used for the delete sign.
Prior to this patch we used string subscripting which worked fine for
ASCII characters, but see yourself:
:echo '«5'[-2:]
Defining the SignifyDelete set of signs on the fly provides the ability
to specify the exact line deletion count for up to 99 lines, rather than
the current limit of 9 lines.
This also has the benefit of reducing the number of signs defined when
there aren't many hunks of deleted lines. On the flip side, if there
are other sign-placing plugins in use, then it also increases the chance
of nearing the ~120 sign definition limit if there are many hunks of
varying line deletions.
`:SyDebug` is displaying info if an alternate buffer is set. This
occurs because a buffer number of 0 represents the alternate buffer.
Using a 1-based range in sy#debug#list_active_buffers fixes this.
Signed-off-by: James McCoy <vega.james@gmail.com>
References #97.
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.