Mercurial > vim
comparison src/undo.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 | 487d7bda80ea |
children | b8f1167aa8ad |
comparison
equal
deleted
inserted
replaced
14300:7a0639d9fdc8 | 14301:3c80092eb211 |
---|---|
3565 while (uhp != NULL) | 3565 while (uhp != NULL) |
3566 { | 3566 { |
3567 dict = dict_alloc(); | 3567 dict = dict_alloc(); |
3568 if (dict == NULL) | 3568 if (dict == NULL) |
3569 return; | 3569 return; |
3570 dict_add_nr_str(dict, "seq", uhp->uh_seq, NULL); | 3570 dict_add_number(dict, "seq", uhp->uh_seq); |
3571 dict_add_nr_str(dict, "time", (long)uhp->uh_time, NULL); | 3571 dict_add_number(dict, "time", (long)uhp->uh_time); |
3572 if (uhp == curbuf->b_u_newhead) | 3572 if (uhp == curbuf->b_u_newhead) |
3573 dict_add_nr_str(dict, "newhead", 1, NULL); | 3573 dict_add_number(dict, "newhead", 1); |
3574 if (uhp == curbuf->b_u_curhead) | 3574 if (uhp == curbuf->b_u_curhead) |
3575 dict_add_nr_str(dict, "curhead", 1, NULL); | 3575 dict_add_number(dict, "curhead", 1); |
3576 if (uhp->uh_save_nr > 0) | 3576 if (uhp->uh_save_nr > 0) |
3577 dict_add_nr_str(dict, "save", uhp->uh_save_nr, NULL); | 3577 dict_add_number(dict, "save", uhp->uh_save_nr); |
3578 | 3578 |
3579 if (uhp->uh_alt_next.ptr != NULL) | 3579 if (uhp->uh_alt_next.ptr != NULL) |
3580 { | 3580 { |
3581 list_T *alt_list = list_alloc(); | 3581 list_T *alt_list = list_alloc(); |
3582 | 3582 |