mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 14:08:32 +00:00
Merge #5254 from KillTheMule/vim-7.4.1952
vim-patch:7.4.{1952, 1990, 2033, 2284}
This commit is contained in:
@@ -128,6 +128,7 @@ The available subcommands are:
|
||||
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}
|
||||
@@ -254,13 +255,13 @@ started will have no effect!
|
||||
{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).
|
||||
|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-
|
||||
: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"
|
||||
@@ -418,6 +419,7 @@ Cscope Home Page (http://cscope.sourceforge.net/): >
|
||||
nmap <C-_>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
|
||||
nmap <C-_>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
|
||||
nmap <C-_>d :cs find d <C-R>=expand("<cword>")<CR><CR>
|
||||
nmap <C-_>a :cs find a <C-R>=expand("<cword>")<CR><CR>
|
||||
|
||||
" Using 'CTRL-spacebar' then a search type makes the vim window
|
||||
" split horizontally, with search result displayed in
|
||||
@@ -431,6 +433,7 @@ Cscope Home Page (http://cscope.sourceforge.net/): >
|
||||
nmap <C-Space>f :scs find f <C-R>=expand("<cfile>")<CR><CR>
|
||||
nmap <C-Space>i :scs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
|
||||
nmap <C-Space>d :scs find d <C-R>=expand("<cword>")<CR><CR>
|
||||
nmap <C-Space>a :scs find a <C-R>=expand("<cword>")<CR><CR>
|
||||
|
||||
" Hitting CTRL-space *twice* before the search type does a vertical
|
||||
" split instead of a horizontal one
|
||||
@@ -449,6 +452,8 @@ Cscope Home Page (http://cscope.sourceforge.net/): >
|
||||
\:vert scs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
|
||||
nmap <C-Space><C-Space>d
|
||||
\:vert scs find d <C-R>=expand("<cword>")<CR><CR>
|
||||
nmap <C-Space><C-Space>a
|
||||
\:vert scs find a <C-R>=expand("<cword>")<CR><CR>
|
||||
|
||||
==============================================================================
|
||||
7. Cscope availability and information *cscope-info*
|
||||
|
@@ -51,7 +51,7 @@ static cscmd_T cs_cmds[] =
|
||||
{ "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 },
|
||||
N_("Query for a pattern"), "find a|c|d|e|f|g|i|s|t name", 1 },
|
||||
{ "help", cs_help,
|
||||
N_("Show this message"), "help", 0 },
|
||||
{ "kill", cs_kill,
|
||||
@@ -104,13 +104,13 @@ char_u *get_cscope_name(expand_T *xp, int idx)
|
||||
{
|
||||
const char *query_type[] =
|
||||
{
|
||||
"c", "d", "e", "f", "g", "i", "s", "t", NULL
|
||||
"a", "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. */
|
||||
// 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];
|
||||
}
|
||||
case EXP_CSCOPE_KILL:
|
||||
@@ -673,6 +673,9 @@ static char *cs_create_cmd(char *csoption, char *pattern)
|
||||
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);
|
||||
@@ -969,6 +972,9 @@ static int cs_find_common(char *opt, char *pat, int forceit, int verbose,
|
||||
case '8':
|
||||
cmdletter = 'i';
|
||||
break;
|
||||
case '9':
|
||||
cmdletter = 'a';
|
||||
break;
|
||||
default:
|
||||
cmdletter = opt[0];
|
||||
}
|
||||
@@ -1125,6 +1131,7 @@ static int cs_help(exarg_T *eap)
|
||||
cmdp->usage);
|
||||
if (strcmp(cmdp->name, "find") == 0)
|
||||
MSG_PUTS(_("\n"
|
||||
" a: Find assignments to this symbol\n"
|
||||
" c: Find functions calling this function\n"
|
||||
" d: Find functions called by this function\n"
|
||||
" e: Find this egrep pattern\n"
|
||||
|
@@ -25,18 +25,7 @@
|
||||
#define CSCOPE_DBFILE "cscope.out"
|
||||
#define CSCOPE_PROMPT ">> "
|
||||
|
||||
/*
|
||||
* s 0name Find this C symbol
|
||||
* g 1name Find this definition
|
||||
* d 2name Find functions called by this function
|
||||
* c 3name Find functions calling this function
|
||||
* t 4string find text string (cscope 12.9)
|
||||
* t 4name Find assignments to (cscope 13.3)
|
||||
* 5pattern change pattern -- NOT USED
|
||||
* e 6pattern Find this egrep pattern
|
||||
* f 7name Find this file
|
||||
* i 8name Find files #including this file
|
||||
*/
|
||||
// See ":help cscope-find" for the possible queries.
|
||||
|
||||
typedef struct {
|
||||
char * name;
|
||||
|
@@ -370,17 +370,17 @@ static char *(p_cb_values[]) = {"unnamed", "unnamedplus", NULL};
|
||||
# define CB_UNNAMED 0x001
|
||||
# define CB_UNNAMEDPLUS 0x002
|
||||
# define CB_UNNAMEDMASK (CB_UNNAMED | CB_UNNAMEDPLUS)
|
||||
EXTERN long p_cwh; /* 'cmdwinheight' */
|
||||
EXTERN long p_ch; /* 'cmdheight' */
|
||||
EXTERN int p_confirm; /* 'confirm' */
|
||||
EXTERN int p_cp; /* 'compatible' */
|
||||
EXTERN char_u *p_cot; /* 'completeopt' */
|
||||
EXTERN long p_ph; /* 'pumheight' */
|
||||
EXTERN char_u *p_cpo; /* 'cpoptions' */
|
||||
EXTERN char_u *p_csprg; /* 'cscopeprg' */
|
||||
EXTERN int p_csre; /* 'cscoperelative' */
|
||||
EXTERN char_u *p_csqf; /* 'cscopequickfix' */
|
||||
# define CSQF_CMDS "sgdctefi"
|
||||
EXTERN long p_cwh; // 'cmdwinheight'
|
||||
EXTERN long p_ch; // 'cmdheight'
|
||||
EXTERN int p_confirm; // 'confirm'
|
||||
EXTERN int p_cp; // 'compatible'
|
||||
EXTERN char_u *p_cot; // 'completeopt'
|
||||
EXTERN long p_ph; // 'pumheight'
|
||||
EXTERN char_u *p_cpo; // 'cpoptions'
|
||||
EXTERN char_u *p_csprg; // 'cscopeprg'
|
||||
EXTERN int p_csre; // 'cscoperelative'
|
||||
EXTERN char_u *p_csqf; // 'cscopequickfix'
|
||||
# define CSQF_CMDS "sgdctefia"
|
||||
# define CSQF_FLAGS "+-0"
|
||||
EXTERN int p_cst; /* 'cscopetag' */
|
||||
EXTERN long p_csto; /* 'cscopetagorder' */
|
||||
|
@@ -32,6 +32,7 @@ SCRIPTS := \
|
||||
# Tests using runtest.vim.vim.
|
||||
# Keep test_alot*.res as the last one, sort the others.
|
||||
NEW_TESTS = \
|
||||
test_cscope.res \
|
||||
test_hardcopy.res \
|
||||
test_help_tagjump.res \
|
||||
test_langmap.res \
|
||||
|
15
src/nvim/testdir/test_cscope.vim
Normal file
15
src/nvim/testdir/test_cscope.vim
Normal file
@@ -0,0 +1,15 @@
|
||||
" Test for cscope commands.
|
||||
|
||||
if !has('cscope')
|
||||
finish
|
||||
endif
|
||||
|
||||
func Test_cscopequickfix()
|
||||
set cscopequickfix=s-,g-,d+,c-,t+,e-,f0,i-,a-
|
||||
call assert_equal('s-,g-,d+,c-,t+,e-,f0,i-,a-', &cscopequickfix)
|
||||
|
||||
call assert_fails('set cscopequickfix=x-', 'E474:')
|
||||
call assert_fails('set cscopequickfix=s', 'E474:')
|
||||
call assert_fails('set cscopequickfix=s7', 'E474:')
|
||||
call assert_fails('set cscopequickfix=s-a', 'E474:')
|
||||
endfunc
|
@@ -74,6 +74,7 @@ static char *features[] = {
|
||||
|
||||
// clang-format off
|
||||
static int included_patches[] = {
|
||||
2284,
|
||||
2219,
|
||||
// 2200,
|
||||
// 2199,
|
||||
@@ -242,7 +243,7 @@ static int included_patches[] = {
|
||||
// 2036,
|
||||
// 2035 NA
|
||||
// 2034 NA
|
||||
// 2033,
|
||||
2033,
|
||||
// 2032 NA
|
||||
// 2031,
|
||||
// 2030 NA
|
||||
@@ -285,7 +286,7 @@ static int included_patches[] = {
|
||||
// 1993,
|
||||
// 1992,
|
||||
// 1991,
|
||||
// 1990,
|
||||
1990,
|
||||
// 1989,
|
||||
// 1988 NA
|
||||
// 1987 NA
|
||||
@@ -323,7 +324,7 @@ static int included_patches[] = {
|
||||
// 1955,
|
||||
// 1954,
|
||||
// 1953,
|
||||
// 1952,
|
||||
1952,
|
||||
// 1951 NA
|
||||
// 1950,
|
||||
// 1949,
|
||||
|
Reference in New Issue
Block a user