mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 18:55:14 -07:00
Merge pull request #13273 from janlazo/vim-8.2.1972
vim-patch:8.2.{1972,1973,1974}
This commit is contained in:
commit
4ae31c46f7
@ -616,7 +616,11 @@ void foldCreate(win_T *wp, pos_T start, pos_T end)
|
||||
break;
|
||||
}
|
||||
}
|
||||
i = (int)(fp - (fold_T *)gap->ga_data);
|
||||
if (gap->ga_len == 0) {
|
||||
i = 0;
|
||||
} else {
|
||||
i = (int)(fp - (fold_T *)gap->ga_data);
|
||||
}
|
||||
}
|
||||
|
||||
ga_grow(gap, 1);
|
||||
|
@ -805,4 +805,14 @@ func Test_move_no_folds()
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" this was crashing
|
||||
func Test_fold_create_delete_create()
|
||||
new
|
||||
fold
|
||||
fold
|
||||
normal zd
|
||||
fold
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
@ -1970,11 +1970,21 @@ bool has_nvim_version(const char *const version_str)
|
||||
///
|
||||
/// @return true if patch `n` has been included.
|
||||
bool has_vim_patch(int n)
|
||||
FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT
|
||||
{
|
||||
for (int i = 0; included_patches[i] != 0; i++) {
|
||||
if (included_patches[i] == n) {
|
||||
// Perform a binary search.
|
||||
int l = 0;
|
||||
int h = (int)(ARRAY_SIZE(included_patches)) - 1;
|
||||
while (l < h) {
|
||||
const int m = (l + h) / 2;
|
||||
if (included_patches[m] == n) {
|
||||
return true;
|
||||
}
|
||||
if (included_patches[m] < n) {
|
||||
h = m;
|
||||
} else {
|
||||
l = m + 1;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user