From 70855aa93d96465262bb6936c28005dd117c1f42 Mon Sep 17 00:00:00 2001 From: Andy Stewart Date: Mon, 27 Apr 2020 10:02:03 +0100 Subject: [PATCH] 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. --- README.mkd | 2 ++ autoload/gitgutter/diff.vim | 2 +- doc/gitgutter.txt | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.mkd b/README.mkd index 9c5e48c..11e6a65 100644 --- a/README.mkd +++ b/README.mkd @@ -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: diff --git a/autoload/gitgutter/diff.vim b/autoload/gitgutter/diff.vim index 04a0de9..5567009 100644 --- a/autoload/gitgutter/diff.vim +++ b/autoload/gitgutter/diff.vim @@ -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') diff --git a/doc/gitgutter.txt b/doc/gitgutter.txt index e8f8178..b8a1c8b 100644 --- a/doc/gitgutter.txt +++ b/doc/gitgutter.txt @@ -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