1
0
forked from aniani/vim

patch 8.0.1496: clearing a pointer takes two lines

Problem:    Clearing a pointer takes two lines.
Solution:   Add VIM_CLEAR() and replace vim_clear(). (Hirohito Higashi,
            closes #2629)
This commit is contained in:
Bram Moolenaar
2018-02-10 18:45:26 +01:00
parent 42443c7d7f
commit d23a823669
54 changed files with 233 additions and 465 deletions

View File

@@ -1176,8 +1176,7 @@ move_terminal_to_buffer(term_T *term)
set_terminal_mode(term_T *term, int normal_mode)
{
term->tl_normal_mode = normal_mode;
vim_free(term->tl_status_text);
term->tl_status_text = NULL;
VIM_CLEAR(term->tl_status_text);
if (term->tl_buffer == curbuf)
maketitle();
}
@@ -1739,10 +1738,8 @@ term_job_ended(job_T *job)
for (term = first_term; term != NULL; term = term->tl_next)
if (term->tl_job == job)
{
vim_free(term->tl_title);
term->tl_title = NULL;
vim_free(term->tl_status_text);
term->tl_status_text = NULL;
VIM_CLEAR(term->tl_title);
VIM_CLEAR(term->tl_status_text);
redraw_buf_and_status_later(term->tl_buffer, VALID);
did_one = TRUE;
}
@@ -2023,8 +2020,7 @@ handle_settermprop(
#endif
else
term->tl_title = vim_strsave((char_u *)value->string);
vim_free(term->tl_status_text);
term->tl_status_text = NULL;
VIM_CLEAR(term->tl_status_text);
if (term == curbuf->b_term)
maketitle();
break;
@@ -2189,10 +2185,8 @@ term_channel_closed(channel_T *ch)
term->tl_channel_closed = TRUE;
did_one = TRUE;
vim_free(term->tl_title);
term->tl_title = NULL;
vim_free(term->tl_status_text);
term->tl_status_text = NULL;
VIM_CLEAR(term->tl_title);
VIM_CLEAR(term->tl_status_text);
/* Unless in Terminal-Normal mode: clear the vterm. */
if (!term->tl_normal_mode)