Skip to content

Commit

Permalink
Enable turning off limit on maximum number of signs
Browse files Browse the repository at this point in the history
Setting the variable to a known value (-1) is neater than an arbitrary
high number.

See airblade#681.
  • Loading branch information
airblade committed Apr 27, 2020
1 parent f411d86 commit 70855aa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion autoload/gitgutter/diff.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
2 changes: 2 additions & 0 deletions doc/gitgutter.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 70855aa

Please sign in to comment.