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.
This commit is contained in:
Marco Hinz 2017-07-18 16:40:29 +02:00
parent d9918a69bc
commit 1bdf100aad
No known key found for this signature in database
GPG Key ID: 1C980A1B657B4A4F

View File

@ -4,12 +4,12 @@ scriptencoding utf-8
" Init: values {{{1
if get(g:, 'signify_sign_show_text', 1)
let s:sign_delete = get(g:, 'signify_sign_delete', '_')
let s:sign_show_count = get(g:, 'signify_sign_show_count', 1)
let s:sign_delete = get(g:, 'signify_sign_delete', '_')
else
let s:sign_delete = ' '
let s:sign_show_count = 0
let s:sign_delete = ' '
endif
let s:sign_show_count = get(g:, 'signify_sign_show_count', 1)
let s:delete_highlight = ['', 'SignifyLineDelete']
" Function: #id_next {{{1