Mercurial > vim
comparison src/quickfix.c @ 9538:26da1efa9e46 v7.4.2049
commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jul 16 16:54:24 2016 +0200
patch 7.4.2049
Problem: There is no way to get a list of the error lists.
Solution: Add ":chistory" and ":lhistory".
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 16 Jul 2016 17:00:06 +0200 |
parents | 340106787852 |
children | 64a791c53418 |
comparison
equal
deleted
inserted
replaced
9537:eb80b386b249 | 9538:26da1efa9e46 |
---|---|
118 static void qf_store_title(qf_info_T *qi, char_u *title); | 118 static void qf_store_title(qf_info_T *qi, char_u *title); |
119 static void qf_new_list(qf_info_T *qi, char_u *qf_title); | 119 static void qf_new_list(qf_info_T *qi, char_u *qf_title); |
120 static void ll_free_all(qf_info_T **pqi); | 120 static void ll_free_all(qf_info_T **pqi); |
121 static int qf_add_entry(qf_info_T *qi, char_u *dir, char_u *fname, int bufnum, char_u *mesg, long lnum, int col, int vis_col, char_u *pattern, int nr, int type, int valid); | 121 static int qf_add_entry(qf_info_T *qi, char_u *dir, char_u *fname, int bufnum, char_u *mesg, long lnum, int col, int vis_col, char_u *pattern, int nr, int type, int valid); |
122 static qf_info_T *ll_new_list(void); | 122 static qf_info_T *ll_new_list(void); |
123 static void qf_msg(qf_info_T *qi); | |
124 static void qf_free(qf_info_T *qi, int idx); | 123 static void qf_free(qf_info_T *qi, int idx); |
125 static char_u *qf_types(int, int); | 124 static char_u *qf_types(int, int); |
126 static int qf_get_fnum(qf_info_T *qi, char_u *, char_u *); | 125 static int qf_get_fnum(qf_info_T *qi, char_u *, char_u *); |
127 static char_u *qf_push_dir(char_u *, struct dir_stack_T **, int is_file_stack); | 126 static char_u *qf_push_dir(char_u *, struct dir_stack_T **, int is_file_stack); |
128 static char_u *qf_pop_dir(struct dir_stack_T **); | 127 static char_u *qf_pop_dir(struct dir_stack_T **); |
2542 buf[i] = *p++; | 2541 buf[i] = *p++; |
2543 } | 2542 } |
2544 buf[i] = NUL; | 2543 buf[i] = NUL; |
2545 } | 2544 } |
2546 | 2545 |
2546 static void | |
2547 qf_msg(qf_info_T *qi, int which, char *lead) | |
2548 { | |
2549 char *title = (char *)qi->qf_lists[which].qf_title; | |
2550 int count = qi->qf_lists[which].qf_count; | |
2551 char_u buf[IOSIZE]; | |
2552 | |
2553 vim_snprintf((char *)buf, IOSIZE, _("%serror list %d of %d; %d errors "), | |
2554 lead, | |
2555 which + 1, | |
2556 qi->qf_listcount, | |
2557 count); | |
2558 | |
2559 if (title != NULL) | |
2560 { | |
2561 while (STRLEN(buf) < 34) | |
2562 STRCAT(buf, " "); | |
2563 STRCAT(buf, title); | |
2564 } | |
2565 trunc_string(buf, buf, Columns - 1, IOSIZE); | |
2566 msg(buf); | |
2567 } | |
2568 | |
2547 /* | 2569 /* |
2548 * ":colder [count]": Up in the quickfix stack. | 2570 * ":colder [count]": Up in the quickfix stack. |
2549 * ":cnewer [count]": Down in the quickfix stack. | 2571 * ":cnewer [count]": Down in the quickfix stack. |
2550 * ":lolder [count]": Up in the location list stack. | 2572 * ":lolder [count]": Up in the location list stack. |
2551 * ":lnewer [count]": Down in the location list stack. | 2573 * ":lnewer [count]": Down in the location list stack. |
2589 break; | 2611 break; |
2590 } | 2612 } |
2591 ++qi->qf_curlist; | 2613 ++qi->qf_curlist; |
2592 } | 2614 } |
2593 } | 2615 } |
2594 qf_msg(qi); | 2616 qf_msg(qi, qi->qf_curlist, ""); |
2595 } | |
2596 | |
2597 static void | |
2598 qf_msg(qf_info_T *qi) | |
2599 { | |
2600 smsg((char_u *)_("error list %d of %d; %d errors"), | |
2601 qi->qf_curlist + 1, qi->qf_listcount, | |
2602 qi->qf_lists[qi->qf_curlist].qf_count); | |
2603 #ifdef FEAT_WINDOWS | 2617 #ifdef FEAT_WINDOWS |
2604 qf_update_buffer(qi, NULL); | 2618 qf_update_buffer(qi, NULL); |
2605 #endif | 2619 #endif |
2620 } | |
2621 | |
2622 void | |
2623 qf_history(exarg_T *eap) | |
2624 { | |
2625 qf_info_T *qi = &ql_info; | |
2626 int i; | |
2627 | |
2628 if (eap->cmdidx == CMD_lhistory) | |
2629 qi = GET_LOC_LIST(curwin); | |
2630 if (qi == NULL || (qi->qf_listcount == 0 | |
2631 && qi->qf_lists[qi->qf_curlist].qf_count == 0)) | |
2632 MSG(_("No entries")); | |
2633 else | |
2634 for (i = 0; i < qi->qf_listcount; ++i) | |
2635 qf_msg(qi, i, i == qi->qf_curlist ? "> " : " "); | |
2606 } | 2636 } |
2607 | 2637 |
2608 /* | 2638 /* |
2609 * Free error list "idx". | 2639 * Free error list "idx". |
2610 */ | 2640 */ |