diff options
author | lonerover <pathfinder1644@yahoo.com> | 2017-01-17 15:36:00 +0800 |
---|---|---|
committer | lonerover <pathfinder1644@yahoo.com> | 2017-01-19 10:11:53 +0800 |
commit | 1a06a3948861b11a9bae0b044f0342fc2190584d (patch) | |
tree | 9bce1f43e4cf4ff3d25604d008377e504e765477 /src/nvim/quickfix.c | |
parent | d3b4764dc137e0f6f2c219244e00fba92a64a384 (diff) | |
download | rneovim-1a06a3948861b11a9bae0b044f0342fc2190584d.tar.gz rneovim-1a06a3948861b11a9bae0b044f0342fc2190584d.tar.bz2 rneovim-1a06a3948861b11a9bae0b044f0342fc2190584d.zip |
vim-patch:7.4.2049
Problem: There is no way to get a list of the error lists.
Solution: Add ":chistory" and ":lhistory".
https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Diffstat (limited to 'src/nvim/quickfix.c')
-rw-r--r-- | src/nvim/quickfix.c | 45 |
1 files changed, 39 insertions, 6 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index 33a84660c1..2fa0fb9840 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -2105,6 +2105,28 @@ static void qf_fmt_text(char_u *text, char_u *buf, int bufsize) buf[i] = NUL; } +static void qf_msg(qf_info_T *qi, int which, char *lead) +{ + char *title = (char *)qi->qf_lists[which].qf_title; + int count = qi->qf_lists[which].qf_count; + char_u buf[IOSIZE]; + + vim_snprintf((char *)buf, IOSIZE, _("%serror list %d of %d; %d errors "), + lead, + which + 1, + qi->qf_listcount, + count); + + if (title != NULL) { + while (STRLEN(buf) < 34) { + STRCAT(buf, " "); + } + STRCAT(buf, title); + } + trunc_string(buf, buf, Columns - 1, IOSIZE); + msg(buf); +} + /* * ":colder [count]": Up in the quickfix stack. * ":cnewer [count]": Down in the quickfix stack. @@ -2145,15 +2167,26 @@ void qf_age(exarg_T *eap) ++qi->qf_curlist; } } - qf_msg(qi); + qf_msg(qi, qi->qf_curlist, ""); + qf_update_buffer(qi, NULL); } -static void qf_msg(qf_info_T *qi) +void qf_history(exarg_T *eap) { - smsg(_("error list %d of %d; %d errors"), - qi->qf_curlist + 1, qi->qf_listcount, - qi->qf_lists[qi->qf_curlist].qf_count); - qf_update_buffer(qi, NULL); + qf_info_T *qi = &ql_info; + int i; + + if (eap->cmdidx == CMD_lhistory) { + qi = GET_LOC_LIST(curwin); + } + if (qi == NULL || (qi->qf_listcount == 0 + && qi->qf_lists[qi->qf_curlist].qf_count == 0)) { + MSG(_("No entries")); + } else { + for (i = 0; i < qi->qf_listcount; i++) { + qf_msg(qi, i, i == qi->qf_curlist ? "> " : " "); + } + } } /* |