Use split() instead of substitute(), since the latter simply parses strings
and doesn't understand the notion of path separators. Backslashes would be
interpreted as beginning escape sequences.
Using split() works around this problem.
Closes#163.
This merge removes g:signify_diffoptions and replaces it by the much more
general g:signify_vcs_commands. Users can customize the entire command to be
run now.
This reverts commit 5cdf72acd1.
`shellescape()`, which is what `sy#util#escape()` is a front-end to, is
only supposed to escape a single element of an argv list. In this case,
it's being used to escape multiple -- `p4 info 2>&1 >`. None of that
should be escaped anyway, because they need to be interpreted by the
shell.
“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>
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>
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>
I wanted to be able to customize signify in a way that wasn't possible
with the current set of options. This commit adds 2 new options and 2
new highlight groups.
Specifically, we can now
1. differentiate between changes, deletes AND signs that have both
with the `signify_sign_changedelete` option.
2. disable showing the number of deleted lines in the sign column with
the `signify_sign_delete_use_count` option.
3. highlight lines with changes and deletes specifically with the
`SignifySignChangeDelete` highlight group.
4. highlight the first line differently with the
`SignifySignDeleteFirstLine` highlight group.
All of these default to existing settings/highlight groups, so
everything should continue working the way it does now.
--------------------------------------------------------------------------------
For those that are curious, I wanted to configure signify to show no
symbols in the sign column, and to just use the highlight groups to give
me all the information I needed. I am able to achieve that now with the
following settings and the Solarized colorscheme:
let g:signify_sign_add = "\<Char-0xa0>\<Char-0xa0>"
let g:signify_sign_change = "\<Char-0xa0>\<Char-0xa0>"
let g:signify_sign_changedelete = "__"
let g:signify_sign_delete = "__"
let g:signify_sign_delete_first_line = "‾‾"
let g:signify_sign_delete_use_count = 0
hi SignifySignDelete term=bold,underline cterm=bold,underline ctermfg=1 ctermbg=12
hi SignifySignDeleteFirstLine ctermfg=1 ctermbg=12
hi SignifySignChangeDelete term=bold,underline cterm=bold,underline ctermfg=1 ctermbg=3
You can see it in action here:
https://twitter.com/_bentomas/status/486266117204090880