Mercurial > vim
diff src/netbeans.c @ 13244:ac42c4b11dbc v8.0.1496
patch 8.0.1496: clearing a pointer takes two lines
commit https://github.com/vim/vim/commit/d23a823669d93fb2a570a039173eefe4856ac806
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Feb 10 18:45:26 2018 +0100
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)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 10 Feb 2018 19:00:07 +0100 |
parents | 6559e98f3e74 |
children | 69517d67421f |
line wrap: on
line diff
--- a/src/netbeans.c +++ b/src/netbeans.c @@ -580,8 +580,7 @@ nb_free(void) buf.bufp->b_was_netbeans_file = FALSE; } } - vim_free(buf_list); - buf_list = NULL; + VIM_CLEAR(buf_list); buf_list_size = 0; buf_list_used = 0; @@ -1477,8 +1476,7 @@ nb_do_cmd( EMSG("E636: invalid buffer identifier in create"); return FAIL; } - vim_free(buf->displayname); - buf->displayname = NULL; + VIM_CLEAR(buf->displayname); netbeansReadFile = 0; /* don't try to open disk file */ do_ecmd(0, NULL, 0, 0, ECMD_ONE, ECMD_HIDE + ECMD_OLDBUF, curwin); @@ -3447,8 +3445,7 @@ print_read_msg(nbbuf_T *buf) msg_add_lines(c, (long)lnum, nchars); /* Now display it */ - vim_free(keep_msg); - keep_msg = NULL; + VIM_CLEAR(keep_msg); msg_scrolled_ign = TRUE; msg_trunc_attr(IObuff, FALSE, 0); msg_scrolled_ign = FALSE; @@ -3475,8 +3472,7 @@ print_save_msg(nbbuf_T *buf, off_T nchar msg_add_lines(c, buf->bufp->b_ml.ml_line_count, buf->bufp->b_orig_size); - vim_free(keep_msg); - keep_msg = NULL; + VIM_CLEAR(keep_msg); msg_scrolled_ign = TRUE; p = msg_trunc_attr(IObuff, FALSE, 0); if ((msg_scrolled && !need_wait_return) || !buf->initDone)