“p4 monitor info” isn't always available and can impose a heavy runtime
cost when it is if the server isn't responsive.
Closesmhinz/vim-signify#153
Signed-off-by: James McCoy <vega.james@gmail.com>
This handles the case where a user forces colors from the color extension via
hgrc:
[extensions]
color =
[defaults]
diff = --colors=always
Sy disables these for its 'hg diff' call, otherwise the output would be
riddled with color escape sequences and couldn't be parsed properly which
would result in no signs shown.
References #146.
Mercurial's detection for where a file's containing repo is doesn't work
well when the working directory is a different Mercurial repo (c.f.,
mhinz/vim-signify#146). Run "hg diff" from the target file's parent
directory to work around this.
Signed-off-by: James McCoy <vega.james@gmail.com>
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.
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.
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.