mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-08 11:33:48 -05:00
Handle edge case in common prefix calculation
This commit is contained in:
@@ -162,6 +162,9 @@ endif
|
||||
"
|
||||
function! s:common_prefix(a, b)
|
||||
let len = min([len(a:a), len(a:b)])
|
||||
if len == 0
|
||||
return -1
|
||||
endif
|
||||
for i in range(len)
|
||||
if a:a[i:i] != a:b[i:i]
|
||||
return i - 1
|
||||
|
||||
Reference in New Issue
Block a user