mirror of
https://github.com/vim/vim.git
synced 2025-09-27 04:14:06 -04:00
patch 9.0.0934: various code formatting issues
Problem: Various code formatting issues. Solution: Improve code formatting.
This commit is contained in:
@@ -413,8 +413,7 @@ arglist_del_files(garray_T *alist_ga)
|
|||||||
|
|
||||||
didone = FALSE;
|
didone = FALSE;
|
||||||
for (match = 0; match < ARGCOUNT; ++match)
|
for (match = 0; match < ARGCOUNT; ++match)
|
||||||
if (vim_regexec(®match, alist_name(&ARGLIST[match]),
|
if (vim_regexec(®match, alist_name(&ARGLIST[match]), (colnr_T)0))
|
||||||
(colnr_T)0))
|
|
||||||
{
|
{
|
||||||
didone = TRUE;
|
didone = TRUE;
|
||||||
vim_free(ARGLIST[match].ae_fname);
|
vim_free(ARGLIST[match].ae_fname);
|
||||||
|
@@ -133,7 +133,7 @@ free_xim_stuff(void)
|
|||||||
|
|
||||||
#if defined(FEAT_EVAL) || defined(PROTO)
|
#if defined(FEAT_EVAL) || defined(PROTO)
|
||||||
/*
|
/*
|
||||||
* Mark the global 'imactivatefunc' and 'imstatusfunc' callbacks with 'copyID'
|
* Mark the global 'imactivatefunc' and 'imstatusfunc' callbacks with "copyID"
|
||||||
* so that they are not garbage collected.
|
* so that they are not garbage collected.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
|
@@ -34,7 +34,7 @@ static void do_csi(VTerm *vt, char command)
|
|||||||
|
|
||||||
if(vt->parser.callbacks && vt->parser.callbacks->csi)
|
if(vt->parser.callbacks && vt->parser.callbacks->csi)
|
||||||
if((*vt->parser.callbacks->csi)(
|
if((*vt->parser.callbacks->csi)(
|
||||||
vt->parser.v.csi.leaderlen ? vt->parser.v.csi.leader : NULL,
|
vt->parser.v.csi.leaderlen ? vt->parser.v.csi.leader : NULL,
|
||||||
vt->parser.v.csi.args,
|
vt->parser.v.csi.args,
|
||||||
vt->parser.v.csi.argi,
|
vt->parser.v.csi.argi,
|
||||||
vt->parser.intermedlen ? vt->parser.intermed : NULL,
|
vt->parser.intermedlen ? vt->parser.intermed : NULL,
|
||||||
|
47
src/list.c
47
src/list.c
@@ -109,6 +109,8 @@ list_alloc_id(alloc_id_T id UNUSED)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Allocate space for a list, plus "count" items.
|
* Allocate space for a list, plus "count" items.
|
||||||
|
* This uses one allocation for efficiency.
|
||||||
|
* The reference count is not set.
|
||||||
* Next list_set_item() must be called for each item.
|
* Next list_set_item() must be called for each item.
|
||||||
*/
|
*/
|
||||||
list_T *
|
list_T *
|
||||||
@@ -117,33 +119,34 @@ list_alloc_with_items(int count)
|
|||||||
list_T *l;
|
list_T *l;
|
||||||
|
|
||||||
l = (list_T *)alloc_clear(sizeof(list_T) + count * sizeof(listitem_T));
|
l = (list_T *)alloc_clear(sizeof(list_T) + count * sizeof(listitem_T));
|
||||||
if (l != NULL)
|
if (l == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
list_init(l);
|
||||||
|
|
||||||
|
if (count > 0)
|
||||||
{
|
{
|
||||||
list_init(l);
|
listitem_T *li = (listitem_T *)(l + 1);
|
||||||
|
int i;
|
||||||
|
|
||||||
if (count > 0)
|
l->lv_len = count;
|
||||||
|
l->lv_with_items = count;
|
||||||
|
l->lv_first = li;
|
||||||
|
l->lv_u.mat.lv_last = li + count - 1;
|
||||||
|
for (i = 0; i < count; ++i)
|
||||||
{
|
{
|
||||||
listitem_T *li = (listitem_T *)(l + 1);
|
if (i == 0)
|
||||||
int i;
|
li->li_prev = NULL;
|
||||||
|
else
|
||||||
l->lv_len = count;
|
li->li_prev = li - 1;
|
||||||
l->lv_with_items = count;
|
if (i == count - 1)
|
||||||
l->lv_first = li;
|
li->li_next = NULL;
|
||||||
l->lv_u.mat.lv_last = li + count - 1;
|
else
|
||||||
for (i = 0; i < count; ++i)
|
li->li_next = li + 1;
|
||||||
{
|
++li;
|
||||||
if (i == 0)
|
|
||||||
li->li_prev = NULL;
|
|
||||||
else
|
|
||||||
li->li_prev = li - 1;
|
|
||||||
if (i == count - 1)
|
|
||||||
li->li_next = NULL;
|
|
||||||
else
|
|
||||||
li->li_next = li + 1;
|
|
||||||
++li;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
17
src/main.c
17
src/main.c
@@ -1298,16 +1298,15 @@ main_loop(
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Trigger CursorMoved if the cursor moved.
|
// Trigger CursorMoved if the cursor moved.
|
||||||
if (!finish_op && (
|
if (!finish_op && (has_cursormoved()
|
||||||
has_cursormoved()
|
|
||||||
#ifdef FEAT_PROP_POPUP
|
#ifdef FEAT_PROP_POPUP
|
||||||
|| popup_visible
|
|| popup_visible
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_CONCEAL
|
#ifdef FEAT_CONCEAL
|
||||||
|| curwin->w_p_cole > 0
|
|| curwin->w_p_cole > 0
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
&& !EQUAL_POS(last_cursormoved, curwin->w_cursor))
|
&& !EQUAL_POS(last_cursormoved, curwin->w_cursor))
|
||||||
{
|
{
|
||||||
if (has_cursormoved())
|
if (has_cursormoved())
|
||||||
apply_autocmds(EVENT_CURSORMOVED, NULL, NULL,
|
apply_autocmds(EVENT_CURSORMOVED, NULL, NULL,
|
||||||
@@ -1401,10 +1400,8 @@ main_loop(
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
// Before redrawing, make sure w_topline is correct, and w_leftcol
|
||||||
* Before redrawing, make sure w_topline is correct, and w_leftcol
|
// if lines don't wrap, and w_skipcol if lines wrap.
|
||||||
* if lines don't wrap, and w_skipcol if lines wrap.
|
|
||||||
*/
|
|
||||||
update_topline();
|
update_topline();
|
||||||
validate_cursor();
|
validate_cursor();
|
||||||
|
|
||||||
|
@@ -3422,7 +3422,7 @@ free_operatorfunc_option(void)
|
|||||||
|
|
||||||
#if defined(FEAT_EVAL) || defined(PROTO)
|
#if defined(FEAT_EVAL) || defined(PROTO)
|
||||||
/*
|
/*
|
||||||
* Mark the global 'operatorfunc' callback with 'copyID' so that it is not
|
* Mark the global 'operatorfunc' callback with "copyID" so that it is not
|
||||||
* garbage collected.
|
* garbage collected.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
|
@@ -1017,7 +1017,7 @@ win_redr_custom(
|
|||||||
char_u *stl;
|
char_u *stl;
|
||||||
char_u *p;
|
char_u *p;
|
||||||
char_u *opt_name;
|
char_u *opt_name;
|
||||||
int opt_scope = 0;
|
int opt_scope = 0;
|
||||||
stl_hlrec_T *hltab;
|
stl_hlrec_T *hltab;
|
||||||
stl_hlrec_T *tabtab;
|
stl_hlrec_T *tabtab;
|
||||||
win_T *ewp;
|
win_T *ewp;
|
||||||
|
@@ -1234,8 +1234,8 @@ update_cursor(term_T *term, int redraw)
|
|||||||
gui_mch_flush();
|
gui_mch_flush();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
// Make sure an invoked autocmd doesn't delete the buffer (and the
|
// Make sure an invoked autocmd doesn't delete the buffer (and the
|
||||||
// terminal) under our fingers.
|
// terminal) under our fingers.
|
||||||
++term->tl_buffer->b_locked;
|
++term->tl_buffer->b_locked;
|
||||||
|
|
||||||
// save and restore curwin and curbuf, in case the autocmd changes them
|
// save and restore curwin and curbuf, in case the autocmd changes them
|
||||||
|
@@ -695,6 +695,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
934,
|
||||||
/**/
|
/**/
|
||||||
933,
|
933,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user