Enable turning off limit on maximum number of signs

Setting the variable to a known value (-1) is neater than an arbitrary
high number.

See #681.
This commit is contained in:
Andy Stewart
2020-04-27 10:02:03 +01:00
parent f411d8680e
commit 70855aa93d
3 changed files with 5 additions and 1 deletions

View File

@@ -143,6 +143,8 @@ To keep your Vim snappy, vim-gitgutter will suppress the signs when a file has m
let g:gitgutter_max_signs = 500 " default value
```
You can also remove the limit by setting `g:gitgutter_max_signs = -1`.
#### Hunks
You can jump between hunks:

View File

@@ -182,7 +182,7 @@ function! gitgutter#diff#handler(bufnr, diff) abort
let modified_lines = gitgutter#diff#process_hunks(a:bufnr, gitgutter#hunk#hunks(a:bufnr))
let signs_count = len(modified_lines)
if signs_count > g:gitgutter_max_signs
if g:gitgutter_max_signs != -1 && signs_count > g:gitgutter_max_signs
call gitgutter#utility#warn_once(a:bufnr, printf(
\ 'exceeded maximum number of signs (%d > %d, configured by g:gitgutter_max_signs).',
\ signs_count, g:gitgutter_max_signs), 'max_signs')

View File

@@ -419,6 +419,8 @@ signs, so to avoid slowing down the GUI the number of signs is capped. When
the number of changed lines exceeds this value, the plugin removes all signs
and displays a warning message.
Set to -1 to remove the limit.
*g:gitgutter_sign_priority*
Default: 10