diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-12-23 18:17:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-23 18:17:01 +0100 |
commit | dee78a4095a27369e428572f74f7b64bcc5f670e (patch) | |
tree | 4f06de0fd7a5a80d746c2ffaf18cb0719e66cccd /src/nvim/ex_cmds.c | |
parent | ec86f4215fc58246998c6017df84206153d0df1a (diff) | |
parent | 5cb7a709e7f60b0e7bcde70a1aa9fea5f060fe0f (diff) | |
download | rneovim-dee78a4095a27369e428572f74f7b64bcc5f670e.tar.gz rneovim-dee78a4095a27369e428572f74f7b64bcc5f670e.tar.bz2 rneovim-dee78a4095a27369e428572f74f7b64bcc5f670e.zip |
Merge #7708 from ZyX-I/hide-container-impl
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r-- | src/nvim/ex_cmds.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 8616508d88..4f54d4c88b 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -6334,7 +6334,6 @@ char_u *skip_vimgrep_pat(char_u *p, char_u **s, int *flags) void ex_oldfiles(exarg_T *eap) { list_T *l = get_vim_var_list(VV_OLDFILES); - listitem_T *li; long nr = 0; if (l == NULL) { @@ -6342,19 +6341,22 @@ void ex_oldfiles(exarg_T *eap) } else { msg_start(); msg_scroll = true; - for (li = l->lv_first; li != NULL && !got_int; li = li->li_next) { + TV_LIST_ITER(l, li, { + if (got_int) { + break; + } nr++; - const char *fname = tv_get_string(&li->li_tv); + const char *fname = tv_get_string(TV_LIST_ITEM_TV(li)); if (!message_filtered((char_u *)fname)) { msg_outnum(nr); MSG_PUTS(": "); - msg_outtrans((char_u *)tv_get_string(&li->li_tv)); + msg_outtrans((char_u *)tv_get_string(TV_LIST_ITEM_TV(li))); msg_clr_eos(); msg_putchar('\n'); ui_flush(); // output one line at a time os_breakcheck(); } - } + }); // Assume "got_int" was set to truncate the listing. got_int = false; @@ -6364,7 +6366,7 @@ void ex_oldfiles(exarg_T *eap) quit_more = false; nr = prompt_for_number(false); msg_starthere(); - if (nr > 0 && nr <= l->lv_len) { + if (nr > 0 && nr <= tv_list_len(l)) { const char *const p = tv_list_find_str(l, nr - 1); if (p == NULL) { return; |