To: vim_dev@googlegroups.com Subject: Patch 7.4.1952 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.1952 Problem: Cscope interface does not support finding assignments. Solution: Add the "a" command. (ppettina, closes #882) Files: runtime/doc/if_cscop.txt, src/if_cscope.c *** ../vim-7.4.1951/runtime/doc/if_cscop.txt 2013-08-10 13:24:55.000000000 +0200 --- runtime/doc/if_cscop.txt 2016-06-21 23:31:13.115400391 +0200 *************** *** 97,104 **** The available subcommands are: ! *E563* *E564* *E566* *E568* *E569* *E622* *E623* ! *E625* *E626* *E609* add : Add a new cscope database/connection. USAGE :cs add {file|dir} [pre-path] [flags] --- 97,104 ---- The available subcommands are: ! *E563* *E564* *E566* *E568* *E622* *E623* *E625* ! *E626* *E609* add : Add a new cscope database/connection. USAGE :cs add {file|dir} [pre-path] [flags] *************** *** 129,134 **** --- 129,135 ---- 6 or e: Find this egrep pattern 7 or f: Find this file 8 or i: Find files #including this file + 9 or a: Find places where this symbol is assigned a value For all types, except 4 and 6, leading white space for {name} is removed. For 4 and 6 there is exactly one space between {querytype} *************** *** 255,267 **** {not available when compiled without the |+quickfix| feature} 'cscopequickfix' specifies whether to use quickfix window to show cscope results. This is a list of comma-separated values. Each item consists of ! |cscope-find| command (s, g, d, c, t, e, f or i) and flag (+, - or 0). '+' indicates that results must be appended to quickfix window, '-' implies previous results clearance, '0' or command absence - don't use quickfix. Search is performed from start until first command occurrence. The default value is "" (don't use quickfix anyway). The following value seems to be useful: > ! :set cscopequickfix=s-,c-,d-,i-,t-,e- < *cscopetag* *cst* If 'cscopetag' is set, the commands ":tag" and CTRL-] as well as "vim -t" --- 256,268 ---- {not available when compiled without the |+quickfix| feature} 'cscopequickfix' specifies whether to use quickfix window to show cscope results. This is a list of comma-separated values. Each item consists of ! |cscope-find| command (s, g, d, c, t, e, f, i or a) and flag (+, - or 0). '+' indicates that results must be appended to quickfix window, '-' implies previous results clearance, '0' or command absence - don't use quickfix. Search is performed from start until first command occurrence. The default value is "" (don't use quickfix anyway). The following value seems to be useful: > ! :set cscopequickfix=s-,c-,d-,i-,t-,e-,a- < *cscopetag* *cst* If 'cscopetag' is set, the commands ":tag" and CTRL-] as well as "vim -t" *************** *** 422,427 **** --- 423,429 ---- nmap f :cs find f =expand("") nmap i :cs find i ^=expand("")$ nmap d :cs find d =expand("") + nmap a :cs find a =expand("") " Using 'CTRL-spacebar' then a search type makes the vim window " split horizontally, with search result displayed in *************** *** 435,440 **** --- 437,443 ---- nmap f :scs find f =expand("") nmap i :scs find i ^=expand("")$ nmap d :scs find d =expand("") + nmap a :scs find a =expand("") " Hitting CTRL-space *twice* before the search type does a vertical " split instead of a horizontal one *************** *** 453,458 **** --- 456,463 ---- \:vert scs find i ^=expand("")$ nmap d \:vert scs find d =expand("") + nmap a + \:vert scs find a =expand("") ============================================================================== 7. Cscope availability and information *cscope-info* *** ../vim-7.4.1951/src/if_cscope.c 2016-02-23 22:50:07.850007219 +0100 --- src/if_cscope.c 2016-06-21 23:31:13.119400348 +0200 *************** *** 70,76 **** { "add", cs_add, N_("Add a new database"), "add file|dir [pre-path] [flags]", 0 }, { "find", cs_find, ! N_("Query for a pattern"), "find c|d|e|f|g|i|s|t name", 1 }, { "help", cs_help, N_("Show this message"), "help", 0 }, { "kill", cs_kill, --- 70,76 ---- { "add", cs_add, N_("Add a new database"), "add file|dir [pre-path] [flags]", 0 }, { "find", cs_find, ! N_("Query for a pattern"), "find c|d|e|f|g|i|s|t|a name", 1 }, { "help", cs_help, N_("Show this message"), "help", 0 }, { "kill", cs_kill, *************** *** 126,137 **** { const char *query_type[] = { ! "c", "d", "e", "f", "g", "i", "s", "t", NULL }; /* Complete with query type of ":cscope find {query_type}". ! * {query_type} can be letters (c, d, ... t) or numbers (0, 1, ! * ..., 8) but only complete with letters, since numbers are * redundant. */ return (char_u *)query_type[idx]; } --- 126,137 ---- { const char *query_type[] = { ! "c", "d", "e", "f", "g", "i", "s", "t", "a", NULL }; /* Complete with query type of ":cscope find {query_type}". ! * {query_type} can be letters (c, d, ... a) or numbers (0, 1, ! * ..., 9) but only complete with letters, since numbers are * redundant. */ return (char_u *)query_type[idx]; } *************** *** 791,796 **** --- 791,799 ---- case '8' : case 'i' : search = 8; break; + case '9' : case 'a' : + search = 9; + break; default : (void)EMSG(_("E561: unknown cscope search type")); cs_usage_msg(Find); *************** *** 1151,1156 **** --- 1154,1162 ---- case '8' : cmdletter = 'i'; break; + case '9' : + cmdletter = 'a'; + break; default : cmdletter = opt[0]; } *************** *** 1352,1358 **** " g: Find this definition\n" " i: Find files #including this file\n" " s: Find this C symbol\n" ! " t: Find this text string\n")); cmdp++; } --- 1358,1365 ---- " g: Find this definition\n" " i: Find files #including this file\n" " s: Find this C symbol\n" ! " t: Find this text string\n" ! " a: Find assignments to this symbol\n")); cmdp++; } *** ../vim-7.4.1951/src/version.c 2016-06-21 22:58:59.436069894 +0200 --- src/version.c 2016-06-21 23:32:57.862279125 +0200 *************** *** 755,756 **** --- 755,758 ---- { /* Add new patch number below this line */ + /**/ + 1952, /**/ -- I have a watch cat! Just break in and she'll watch. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///