Skip to content

Commit

Permalink
Merge pull request #14088 from janlazo/vim-8.2.2577
Browse files Browse the repository at this point in the history
vim-patch:8.1.0783,8.2.{1507,2152,2438,2577}
  • Loading branch information
janlazo committed Mar 10, 2021
2 parents e355cc8 + 7da8056 commit cc23c95
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 21 deletions.
24 changes: 8 additions & 16 deletions src/nvim/eval.c
Expand Up @@ -5280,14 +5280,10 @@ bool set_ref_in_item(typval_T *tv, int copyID, ht_stack_T **ht_stack,
if (ht_stack == NULL) {
abort = set_ref_in_ht(&dd->dv_hashtab, copyID, list_stack);
} else {
ht_stack_T *newitem = try_malloc(sizeof(ht_stack_T));
if (newitem == NULL) {
abort = true;
} else {
newitem->ht = &dd->dv_hashtab;
newitem->prev = *ht_stack;
*ht_stack = newitem;
}
ht_stack_T *const newitem = xmalloc(sizeof(ht_stack_T));
newitem->ht = &dd->dv_hashtab;
newitem->prev = *ht_stack;
*ht_stack = newitem;
}

QUEUE *w = NULL;
Expand All @@ -5308,14 +5304,10 @@ bool set_ref_in_item(typval_T *tv, int copyID, ht_stack_T **ht_stack,
if (list_stack == NULL) {
abort = set_ref_in_list(ll, copyID, ht_stack);
} else {
list_stack_T *newitem = try_malloc(sizeof(list_stack_T));
if (newitem == NULL) {
abort = true;
} else {
newitem->list = ll;
newitem->prev = *list_stack;
*list_stack = newitem;
}
list_stack_T *const newitem = xmalloc(sizeof(list_stack_T));
newitem->list = ll;
newitem->prev = *list_stack;
*list_stack = newitem;
}
}
break;
Expand Down
5 changes: 3 additions & 2 deletions src/nvim/eval/typval.h
Expand Up @@ -341,8 +341,9 @@ struct ufunc {
///< used for s: variables
int uf_refcount; ///< reference count, see func_name_refcount()
funccall_T *uf_scoped; ///< l: local variables for closure
char_u uf_name[]; ///< Name of function; can start with <SNR>123_
///< (<SNR> is K_SPECIAL KS_EXTRA KE_SNR)
char_u uf_name[]; ///< Name of function (actual size equals name);
///< can start with <SNR>123_
///< (<SNR> is K_SPECIAL KS_EXTRA KE_SNR)
};

struct partial_S {
Expand Down
4 changes: 2 additions & 2 deletions src/nvim/memline.c
Expand Up @@ -3859,8 +3859,8 @@ static void ml_updatechunk(buf_T *buf, linenr_T line, long len, int updtype)
/* May resize here so we don't have to do it in both cases below */
if (buf->b_ml.ml_usedchunks + 1 >= buf->b_ml.ml_numchunks) {
buf->b_ml.ml_numchunks = buf->b_ml.ml_numchunks * 3 / 2;
buf->b_ml.ml_chunksize = (chunksize_T *)
xrealloc(buf->b_ml.ml_chunksize,
buf->b_ml.ml_chunksize = xrealloc(
buf->b_ml.ml_chunksize,
sizeof(chunksize_T) * buf->b_ml.ml_numchunks);
}

Expand Down
2 changes: 1 addition & 1 deletion src/nvim/screen.c
Expand Up @@ -2656,7 +2656,7 @@ static int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow,
// already be in use.
xfree(p_extra_free);
p_extra_free = xmalloc(MAX_MCO * fdc + 1);
n_extra = fill_foldcolumn(p_extra_free, wp, foldinfo, lnum);
n_extra = (int)fill_foldcolumn(p_extra_free, wp, foldinfo, lnum);
p_extra_free[n_extra] = NUL;
p_extra = p_extra_free;
c_extra = NUL;
Expand Down
5 changes: 5 additions & 0 deletions src/nvim/testdir/test_cursor_func.vim
Expand Up @@ -92,6 +92,11 @@ func Test_screenpos()
\ 'endcol': wincol + 9}, screenpos(winid, 2, 22))
close
bwipe!

call assert_equal({'col': 1, 'row': 1, 'endcol': 1, 'curscol': 1}, screenpos(win_getid(), 1, 1))
nmenu WinBar.TEST :
call assert_equal({'col': 1, 'row': 2, 'endcol': 1, 'curscol': 1}, screenpos(win_getid(), 1, 1))
nunmenu WinBar.TEST
endfunc

func Test_screenpos_number()
Expand Down

0 comments on commit cc23c95

Please sign in to comment.