diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-07-08 16:50:37 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-07-08 16:50:37 +0200 |
commit | e0be167a805fd547c25ec1ec97fd4c7f13046236 (patch) | |
tree | 423fb96f7b30329ef0b7ccf3d4b2a02620e7929c /src/terminal.c | |
parent | 4cde86c2ef885e82fff3d925dee9fb5671c025cf (diff) | |
download | vim-git-e0be167a805fd547c25ec1ec97fd4c7f13046236.tar.gz |
patch 8.1.0166: using dict_add_nr_str() is clumsyv8.1.0166
Problem: Using dict_add_nr_str() is clumsy.
Solution: Split into two functions. (Ozaki Kiichi, closes #3154)
Diffstat (limited to 'src/terminal.c')
-rw-r--r-- | src/terminal.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/terminal.c b/src/terminal.c index 6195ad51d..2e99a8598 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -4729,11 +4729,11 @@ f_term_getcursor(typval_T *argvars, typval_T *rettv) d = dict_alloc(); if (d != NULL) { - dict_add_nr_str(d, "visible", term->tl_cursor_visible, NULL); - dict_add_nr_str(d, "blink", blink_state_is_inverted() - ? !term->tl_cursor_blink : term->tl_cursor_blink, NULL); - dict_add_nr_str(d, "shape", term->tl_cursor_shape, NULL); - dict_add_nr_str(d, "color", 0L, cursor_color_get(term->tl_cursor_color)); + dict_add_number(d, "visible", term->tl_cursor_visible); + dict_add_number(d, "blink", blink_state_is_inverted() + ? !term->tl_cursor_blink : term->tl_cursor_blink); + dict_add_number(d, "shape", term->tl_cursor_shape); + dict_add_string(d, "color", cursor_color_get(term->tl_cursor_color)); list_append_dict(l, d); } } @@ -5059,18 +5059,17 @@ f_term_scrape(typval_T *argvars, typval_T *rettv) break; list_append_dict(l, dcell); - dict_add_nr_str(dcell, "chars", 0, mbs); + dict_add_string(dcell, "chars", mbs); vim_snprintf((char *)rgb, 8, "#%02x%02x%02x", fg.red, fg.green, fg.blue); - dict_add_nr_str(dcell, "fg", 0, rgb); + dict_add_string(dcell, "fg", rgb); vim_snprintf((char *)rgb, 8, "#%02x%02x%02x", bg.red, bg.green, bg.blue); - dict_add_nr_str(dcell, "bg", 0, rgb); + dict_add_string(dcell, "bg", rgb); - dict_add_nr_str(dcell, "attr", - cell2attr(attrs, fg, bg), NULL); - dict_add_nr_str(dcell, "width", width, NULL); + dict_add_number(dcell, "attr", cell2attr(attrs, fg, bg)); + dict_add_number(dcell, "width", width); ++pos.col; if (width == 2) |