mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.0.1758: open_line() returns TRUE/FALSE for success/failure
Problem: open_line() returns TRUE/FALSE for success/failure. Solution: Return OK or FAIL.
This commit is contained in:
parent
b691de05f6
commit
24a2d7264f
@ -1374,7 +1374,7 @@ doESCkey:
|
|||||||
goto doESCkey;
|
goto doESCkey;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (ins_eol(c) && !p_im)
|
if (ins_eol(c) == FAIL && !p_im)
|
||||||
goto doESCkey; /* out of memory */
|
goto doESCkey; /* out of memory */
|
||||||
auto_format(FALSE, FALSE);
|
auto_format(FALSE, FALSE);
|
||||||
inserted_space = FALSE;
|
inserted_space = FALSE;
|
||||||
@ -10201,7 +10201,7 @@ ins_tab(void)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Handle CR or NL in insert mode.
|
* Handle CR or NL in insert mode.
|
||||||
* Return TRUE when out of memory or can't undo.
|
* Return FAIL when out of memory or can't undo.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
ins_eol(int c)
|
ins_eol(int c)
|
||||||
@ -10266,7 +10266,7 @@ ins_eol(int c)
|
|||||||
foldOpenCursor();
|
foldOpenCursor();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return (!i);
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEAT_DIGRAPHS
|
#ifdef FEAT_DIGRAPHS
|
||||||
|
@ -588,7 +588,7 @@ cin_is_cinword(char_u *line)
|
|||||||
* "second_line_indent": indent for after ^^D in Insert mode or if flag
|
* "second_line_indent": indent for after ^^D in Insert mode or if flag
|
||||||
* OPENLINE_COM_LIST
|
* OPENLINE_COM_LIST
|
||||||
*
|
*
|
||||||
* Return TRUE for success, FALSE for failure
|
* Return OK for success, FAIL for failure
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
open_line(
|
open_line(
|
||||||
@ -606,7 +606,7 @@ open_line(
|
|||||||
int newindent = 0; /* auto-indent of the new line */
|
int newindent = 0; /* auto-indent of the new line */
|
||||||
int n;
|
int n;
|
||||||
int trunc_line = FALSE; /* truncate current line afterwards */
|
int trunc_line = FALSE; /* truncate current line afterwards */
|
||||||
int retval = FALSE; /* return value, default is FAIL */
|
int retval = FAIL; /* return value */
|
||||||
#ifdef FEAT_COMMENTS
|
#ifdef FEAT_COMMENTS
|
||||||
int extra_len = 0; /* length of p_extra string */
|
int extra_len = 0; /* length of p_extra string */
|
||||||
int lead_len; /* length of comment leader */
|
int lead_len; /* length of comment leader */
|
||||||
@ -1642,7 +1642,7 @@ open_line(
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
retval = TRUE; /* success! */
|
retval = OK; /* success! */
|
||||||
theend:
|
theend:
|
||||||
curbuf->b_p_pi = saved_pi;
|
curbuf->b_p_pi = saved_pi;
|
||||||
vim_free(saved_line);
|
vim_free(saved_line);
|
||||||
|
@ -8491,7 +8491,7 @@ n_opencmd(cmdarg_T *cap)
|
|||||||
#ifdef FEAT_COMMENTS
|
#ifdef FEAT_COMMENTS
|
||||||
has_format_option(FO_OPEN_COMS) ? OPENLINE_DO_COM :
|
has_format_option(FO_OPEN_COMS) ? OPENLINE_DO_COM :
|
||||||
#endif
|
#endif
|
||||||
0, 0))
|
0, 0) == OK)
|
||||||
{
|
{
|
||||||
#ifdef FEAT_CONCEAL
|
#ifdef FEAT_CONCEAL
|
||||||
if (curwin->w_p_cole > 0 && oldline != curwin->w_cursor.lnum)
|
if (curwin->w_p_cole > 0 && oldline != curwin->w_cursor.lnum)
|
||||||
|
@ -761,6 +761,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 */
|
||||||
|
/**/
|
||||||
|
1758,
|
||||||
/**/
|
/**/
|
||||||
1757,
|
1757,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user