Mercurial > vim
diff src/eval.c @ 16872:a836d122231a v8.1.1437
patch 8.1.1437: code to handle callbacks is duplicated
commit https://github.com/vim/vim/commit/3a97bb3f0f8bd118ae23f1c97e55d84ff42eef20
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jun 1 13:28:35 2019 +0200
patch 8.1.1437: code to handle callbacks is duplicated
Problem: Code to handle callbacks is duplicated.
Solution: Add callback_T and functions to deal with it.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 01 Jun 2019 13:30:07 +0200 |
parents | ce04ebdf26b8 |
children | 586d625e21b4 |
line wrap: on
line diff
--- a/src/eval.c +++ b/src/eval.c @@ -5920,10 +5920,10 @@ set_ref_in_item( dtv.vval.v_channel = job->jv_channel; set_ref_in_item(&dtv, copyID, ht_stack, list_stack); } - if (job->jv_exit_partial != NULL) + if (job->jv_exit_cb.cb_partial != NULL) { dtv.v_type = VAR_PARTIAL; - dtv.vval.v_partial = job->jv_exit_partial; + dtv.vval.v_partial = job->jv_exit_cb.cb_partial; set_ref_in_item(&dtv, copyID, ht_stack, list_stack); } } @@ -5946,29 +5946,30 @@ set_ref_in_item( set_ref_in_item(jq->jq_value, copyID, ht_stack, list_stack); for (cq = ch->ch_part[part].ch_cb_head.cq_next; cq != NULL; cq = cq->cq_next) - if (cq->cq_partial != NULL) + if (cq->cq_callback.cb_partial != NULL) { dtv.v_type = VAR_PARTIAL; - dtv.vval.v_partial = cq->cq_partial; + dtv.vval.v_partial = cq->cq_callback.cb_partial; set_ref_in_item(&dtv, copyID, ht_stack, list_stack); } - if (ch->ch_part[part].ch_partial != NULL) + if (ch->ch_part[part].ch_callback.cb_partial != NULL) { dtv.v_type = VAR_PARTIAL; - dtv.vval.v_partial = ch->ch_part[part].ch_partial; + dtv.vval.v_partial = + ch->ch_part[part].ch_callback.cb_partial; set_ref_in_item(&dtv, copyID, ht_stack, list_stack); } } - if (ch->ch_partial != NULL) + if (ch->ch_callback.cb_partial != NULL) { dtv.v_type = VAR_PARTIAL; - dtv.vval.v_partial = ch->ch_partial; + dtv.vval.v_partial = ch->ch_callback.cb_partial; set_ref_in_item(&dtv, copyID, ht_stack, list_stack); } - if (ch->ch_close_partial != NULL) + if (ch->ch_close_cb.cb_partial != NULL) { dtv.v_type = VAR_PARTIAL; - dtv.vval.v_partial = ch->ch_close_partial; + dtv.vval.v_partial = ch->ch_close_cb.cb_partial; set_ref_in_item(&dtv, copyID, ht_stack, list_stack); } }