mirror of
https://github.com/neovim/neovim.git
synced 2025-10-03 00:18:33 +00:00
Merge #5254 from KillTheMule/vim-7.4.1952
vim-patch:7.4.{1952, 1990, 2033, 2284}
This commit is contained in:
@@ -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,14 +1131,15 @@ static int cs_help(exarg_T *eap)
|
||||
cmdp->usage);
|
||||
if (strcmp(cmdp->name, "find") == 0)
|
||||
MSG_PUTS(_("\n"
|
||||
" c: Find functions calling this function\n"
|
||||
" d: Find functions called by this function\n"
|
||||
" e: Find this egrep pattern\n"
|
||||
" f: Find this file\n"
|
||||
" 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"
|
||||
" c: Find functions calling this function\n"
|
||||
" d: Find functions called by this function\n"
|
||||
" e: Find this egrep pattern\n"
|
||||
" f: Find this file\n"
|
||||
" 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++;
|
||||
}
|
||||
|
@@ -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