vim-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.
24a2d7264f
This commit is contained in:
Jan Edmund Lazo
2018-11-01 23:11:09 -04:00
parent c45a859171
commit 44c111e49f
2 changed files with 5 additions and 5 deletions

View File

@@ -1096,7 +1096,7 @@ static int insert_handle_key(InsertState *s)
cmdwin_result = CAR; cmdwin_result = CAR;
return 0; return 0;
} }
if (ins_eol(s->c) && !p_im) { if (!ins_eol(s->c) && !p_im) {
return 0; // out of memory return 0; // out of memory
} }
auto_format(false, false); auto_format(false, false);
@@ -8356,7 +8356,7 @@ static bool ins_tab(void)
/// Handle CR or NL in insert mode. /// Handle CR or NL in insert mode.
/// ///
/// @return true when it can't undo. /// @return false when it can't undo.
static bool ins_eol(int c) static bool ins_eol(int c)
{ {
if (echeck_abbr(c + ABBR_OFF)) { if (echeck_abbr(c + ABBR_OFF)) {
@@ -8405,7 +8405,7 @@ static bool ins_eol(int c)
// When inserting a line the cursor line must never be in a closed fold. // When inserting a line the cursor line must never be in a closed fold.
foldOpenCursor(); foldOpenCursor();
return !i; return i;
} }
/* /*

View File

@@ -98,7 +98,7 @@ open_line (
colnr_T newcol = 0; // new cursor column colnr_T newcol = 0; // new cursor column
int newindent = 0; // auto-indent of the new line int newindent = 0; // auto-indent of the new line
bool trunc_line = false; // truncate current line afterwards bool trunc_line = false; // truncate current line afterwards
bool retval = false; // return value, default is false bool retval = false; // return value
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
char_u *lead_flags; // position in 'comments' for comment leader char_u *lead_flags; // position in 'comments' for comment leader
@@ -922,7 +922,7 @@ open_line (
next_line = NULL; next_line = NULL;
} }
retval = TRUE; /* success! */ retval = true; // success!
theend: theend:
curbuf->b_p_pi = saved_pi; curbuf->b_p_pi = saved_pi;
xfree(saved_line); xfree(saved_line);