Commit Graph

38 Commits

Author SHA1 Message Date
Marco Hinz
1bdf100aad
Do not make option defaults depend on each other
Having default values for options that depend on another option's value is a bad
practice. Be more explicit:

  g:signify_sign_show_text  is ON by default
  g:signify_sign_show_count is ON by default

So, people who want just background colors and no text at all in their signs
have to set both:

  let g:signify_sign_show_text  = 0
  let g:signify_sign_show_count = 0

Before this change, only the first line was needed.

This also fixes a bug that happened with:

  let g:signify_sign_show_text  = 0
  let g:signify_sign_show_count = 1

Removed lines wouldn't show a count whereas changed + removed lines would.
2017-07-18 16:47:03 +02:00
Marco Hinz
952920b92d
Always set sy.updated_by
References #235.
2017-04-21 13:34:02 +02:00
Marco Hinz
179fe50edf
Improve debug output 2017-04-18 17:18:19 +02:00
Marco Hinz
b119f8d81b
Allow multiple active VCS
When you have nested repos of different VCS and you edit a file from the inner
repo, more than one VCS can return a valid diff. Only one VCS should return a
non-empty diff, though.

Once a non-empty diff is found, all other VCS get disabled to reduce overhead.

References #235.
2017-04-18 17:00:12 +02:00
Marco Hinz
b1e58456cf
MacVim: don't use ^L in insert mode
References #234.
2017-04-12 11:18:38 +02:00
Marco Hinz
0a09008179
Remove now useless workarounds 2017-02-24 18:09:06 +01:00
Marco Hinz
d155dffd9d
GUI: use :redraw for all GUIs except MacVim 2017-02-20 16:47:35 +01:00
Marco Hinz
2778fd928c
GUIs: redraw screen after sign update
Some GUIs (MacVim, gVim) wouldn't show placed signs after updating. Force a
redraw.

References #228.
2017-02-20 01:15:50 +01:00
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
68013238b4
Restrict to be removed sign IDs to buffer 2017-01-29 02:22:35 +01:00
Marco Hinz
304a2b9c27
Simplify sign ID handling 2017-01-18 16:28:35 +01:00
Marco Hinz
0e609fdf1d
Make Vim and job_start() work 2017-01-17 23:12:00 +01:00
Marco Hinz
4aca2ee9c5 Don't rely on :language
Fixes #187.
2016-12-15 14:56:20 +01:00
Marco Hinz
faf7a03071
New option: g:signify_sign_show_text
This makes all Signify signs use a non-breaking space as text. This is
convenient if only the background colors of the signs are important.

References #188.
2016-09-28 17:05:40 +02:00
James McCoy
f708bc475f Stop clearing stats in sy#sign#remove_all_the_signs 2016-06-01 21:13:33 -04:00
Marco Hinz
a58fbe93df Useless use of :execute 2015-05-25 16:37:37 +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
c2f3b364d2 Introduce g:signify_sign_show_count
This option replaces g:signify_sign_delete_use_count and works for both,
delete and change/delete.

Referenes #125.
2014-10-07 23:02:17 +02:00
Benjamin Thomas
bdc0c5eb15 Add finer grained control over signs and highlights
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
2014-10-07 23:02:17 +02:00
Marco Hinz
fe3bafce11 Introduce smarter sign management 2014-10-04 15:56:10 +02:00
blacksand
2b05c7fd04 Fix locale setting for Chinese Windows versions
On the Chinese version of Windows, v:lang is "zh_CN", but execute
":language zh_CN" will fail and ":language chinese_china" must be used
to change the locale instead.

Closes #116.
2014-02-05 22:07:27 +01:00
James McCoy
159b171e4a Use _> for more than 99 deletes lines (again)
Closes #110.
2014-01-04 09:40:10 +01:00
Marco Hinz
5db82c4d2a Let counter overflow if more than 100 lines deleted
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.
2014-01-01 22:54:49 +01:00
Marco Hinz
9e83f243e7 Fix unicode + subscripting bug
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:]
2013-12-29 19:18:54 +01:00
James McCoy
7f57ee5af6 Use two digit numbers for SignifyDelete signs
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.
2013-12-11 10:04:52 +01:00
Marco Hinz
2f1def6b9d Don't remember the dummy sign
References #102.
2013-12-06 22:43:51 +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
Denys Lózko
f4b2350458 Fix sign_overwrite for non-EN locales 2013-11-19 08:24:19 +01: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
be4d622bb9 Don't reset signs when another window gets updated
References #73.
2013-09-25 11:17:52 +02:00
Marco Hinz
da5eabe3c9 Relocate emptying of other signs dict
References #64.
2013-09-06 16:43:08 +02:00
Marco Hinz
4167fa0373 Fix sign overwrite issue
References #64.
2013-09-06 15:34:13 +02:00
Bailey Ling
a8f67e0f0f Reset stats when signs are cleared 2013-08-26 15:52:29 +00:00
Marco Hinz
b29cd71f6d Set encoding for plugin files
Closes #54.
2013-08-19 17:36:16 +02:00
Marco Hinz
ea331d6065 Populate autoload/ 2013-07-17 12:30:58 +02:00