Mercurial > vim
diff src/ex_cmds2.c @ 14301:3c80092eb211 v8.1.0166
patch 8.1.0166: using dict_add_nr_str() is clumsy
commit https://github.com/vim/vim/commit/e0be167a805fd547c25ec1ec97fd4c7f13046236
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jul 8 16:50:37 2018 +0200
patch 8.1.0166: using dict_add_nr_str() is clumsy
Problem: Using dict_add_nr_str() is clumsy.
Solution: Split into two functions. (Ozaki Kiichi, closes https://github.com/vim/vim/issues/3154)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 08 Jul 2018 17:00:07 +0200 |
parents | 4cb334816bb1 |
children | f761a55a8aed |
line wrap: on
line diff
--- a/src/ex_cmds2.c +++ b/src/ex_cmds2.c @@ -689,7 +689,7 @@ dbg_parsearg( } /* - * ":breakadd". + * ":breakadd". Also used for ":profile". */ void ex_breakadd(exarg_T *eap) @@ -1497,16 +1497,16 @@ add_timer_info(typval_T *rettv, timer_T return; list_append_dict(list, dict); - dict_add_nr_str(dict, "id", timer->tr_id, NULL); - dict_add_nr_str(dict, "time", (long)timer->tr_interval, NULL); + dict_add_number(dict, "id", timer->tr_id); + dict_add_number(dict, "time", (long)timer->tr_interval); profile_start(&now); remaining = proftime_time_left(&timer->tr_due, &now); - dict_add_nr_str(dict, "remaining", (long)remaining, NULL); - - dict_add_nr_str(dict, "repeat", - (long)(timer->tr_repeat < 0 ? -1 : timer->tr_repeat + 1), NULL); - dict_add_nr_str(dict, "paused", (long)(timer->tr_paused), NULL); + dict_add_number(dict, "remaining", (long)remaining); + + dict_add_number(dict, "repeat", + (long)(timer->tr_repeat < 0 ? -1 : timer->tr_repeat + 1)); + dict_add_number(dict, "paused", (long)(timer->tr_paused)); di = dictitem_alloc((char_u *)"callback"); if (di != NULL)