mirror of
https://github.com/neovim/neovim.git
synced 2025-09-25 04:28:33 +00:00
Simple refatorings that didn't fit the pattern of the last commit
This commit is contained in:
@@ -2105,14 +2105,10 @@ void get_winopts(buf_T *buf)
|
|||||||
*/
|
*/
|
||||||
pos_T *buflist_findfpos(buf_T *buf)
|
pos_T *buflist_findfpos(buf_T *buf)
|
||||||
{
|
{
|
||||||
wininfo_T *wip;
|
|
||||||
static pos_T no_position = INIT_POS_T(1, 0, 0);
|
static pos_T no_position = INIT_POS_T(1, 0, 0);
|
||||||
|
|
||||||
wip = find_wininfo(buf, FALSE);
|
wininfo_T *wip = find_wininfo(buf, FALSE);
|
||||||
if (wip != NULL)
|
return (wip == NULL) ? &no_position : &(wip->wi_fpos);
|
||||||
return &(wip->wi_fpos);
|
|
||||||
else
|
|
||||||
return &no_position;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -3329,13 +3329,12 @@ void ex_z(exarg_T *eap)
|
|||||||
if (!VIM_ISDIGIT(*x)) {
|
if (!VIM_ISDIGIT(*x)) {
|
||||||
EMSG(_("E144: non-numeric argument to :z"));
|
EMSG(_("E144: non-numeric argument to :z"));
|
||||||
return;
|
return;
|
||||||
} else {
|
}
|
||||||
bigness = atoi((char *)x);
|
bigness = atoi((char *)x);
|
||||||
p_window = bigness;
|
p_window = bigness;
|
||||||
if (*kind == '=')
|
if (*kind == '=')
|
||||||
bigness += 2;
|
bigness += 2;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* the number of '-' and '+' multiplies the distance */
|
/* the number of '-' and '+' multiplies the distance */
|
||||||
if (*kind == '-' || *kind == '+')
|
if (*kind == '-' || *kind == '+')
|
||||||
|
@@ -246,9 +246,7 @@ int cause_errthrow(char_u *mesg, int severe, int *ignore)
|
|||||||
plist = &(*plist)->next;
|
plist = &(*plist)->next;
|
||||||
|
|
||||||
elem = xmalloc(sizeof(struct msglist));
|
elem = xmalloc(sizeof(struct msglist));
|
||||||
{
|
|
||||||
elem->msg = vim_strsave(mesg);
|
elem->msg = vim_strsave(mesg);
|
||||||
{
|
|
||||||
elem->next = NULL;
|
elem->next = NULL;
|
||||||
elem->throw_msg = NULL;
|
elem->throw_msg = NULL;
|
||||||
*plist = elem;
|
*plist = elem;
|
||||||
@@ -268,8 +266,6 @@ int cause_errthrow(char_u *mesg, int severe, int *ignore)
|
|||||||
(*msg_list)->throw_msg = tmsg;
|
(*msg_list)->throw_msg = tmsg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -233,9 +233,7 @@ static int cin_islabel_skip(char_u **s)
|
|||||||
*/
|
*/
|
||||||
int cin_islabel(void)
|
int cin_islabel(void)
|
||||||
{ /* XXX */
|
{ /* XXX */
|
||||||
char_u *s;
|
char_u *s = cin_skipcomment(get_cursor_line_ptr());
|
||||||
|
|
||||||
s = cin_skipcomment(get_cursor_line_ptr());
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Exclude "default" from labels, since it should be indented
|
* Exclude "default" from labels, since it should be indented
|
||||||
|
@@ -4283,7 +4283,7 @@ static int comp_char_differs(int off_from, int off_to)
|
|||||||
*/
|
*/
|
||||||
static int char_needs_redraw(int off_from, int off_to, int cols)
|
static int char_needs_redraw(int off_from, int off_to, int cols)
|
||||||
{
|
{
|
||||||
if (cols > 0
|
return (cols > 0
|
||||||
&& ((ScreenLines[off_from] != ScreenLines[off_to]
|
&& ((ScreenLines[off_from] != ScreenLines[off_to]
|
||||||
|| ScreenAttrs[off_from] != ScreenAttrs[off_to])
|
|| ScreenAttrs[off_from] != ScreenAttrs[off_to])
|
||||||
|
|
||||||
@@ -4299,10 +4299,7 @@ static int char_needs_redraw(int off_from, int off_to, int cols)
|
|||||||
&& comp_char_differs(off_from, off_to))
|
&& comp_char_differs(off_from, off_to))
|
||||||
|| ((*mb_off2cells)(off_from, off_from + cols) > 1
|
|| ((*mb_off2cells)(off_from, off_from + cols) > 1
|
||||||
&& ScreenLines[off_from + 1]
|
&& ScreenLines[off_from + 1]
|
||||||
!= ScreenLines[off_to + 1])))
|
!= ScreenLines[off_to + 1])))));
|
||||||
))
|
|
||||||
return TRUE;
|
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -1513,7 +1513,6 @@ syn_finish_line (
|
|||||||
stateitem_T *cur_si;
|
stateitem_T *cur_si;
|
||||||
colnr_T prev_current_col;
|
colnr_T prev_current_col;
|
||||||
|
|
||||||
if (!current_finished) {
|
|
||||||
while (!current_finished) {
|
while (!current_finished) {
|
||||||
(void)syn_current_attr(syncing, FALSE, NULL, FALSE);
|
(void)syn_current_attr(syncing, FALSE, NULL, FALSE);
|
||||||
/*
|
/*
|
||||||
@@ -1540,7 +1539,6 @@ syn_finish_line (
|
|||||||
}
|
}
|
||||||
++current_col;
|
++current_col;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user