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
|
6 or e: Find this egrep pattern
|
||||||
7 or f: Find this file
|
7 or f: Find this file
|
||||||
8 or i: Find files #including 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
|
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}
|
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}
|
{not available when compiled without the |+quickfix| feature}
|
||||||
'cscopequickfix' specifies whether to use quickfix window to show cscope
|
'cscopequickfix' specifies whether to use quickfix window to show cscope
|
||||||
results. This is a list of comma-separated values. Each item consists of
|
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,
|
'+' indicates that results must be appended to quickfix window,
|
||||||
'-' implies previous results clearance, '0' or command absence - don't use
|
'-' implies previous results clearance, '0' or command absence - don't use
|
||||||
quickfix. Search is performed from start until first command occurrence.
|
quickfix. Search is performed from start until first command occurrence.
|
||||||
The default value is "" (don't use quickfix anyway). The following value
|
The default value is "" (don't use quickfix anyway). The following value
|
||||||
seems to be useful: >
|
seems to be useful: >
|
||||||
:set cscopequickfix=s-,c-,d-,i-,t-,e-
|
:set cscopequickfix=s-,c-,d-,i-,t-,e-,a-
|
||||||
<
|
<
|
||||||
*cscopetag* *cst*
|
*cscopetag* *cst*
|
||||||
If 'cscopetag' is set, the commands ":tag" and CTRL-] as well as "vim -t"
|
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-_>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
|
||||||
nmap <C-_>i :cs find i ^<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-_>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
|
" Using 'CTRL-spacebar' then a search type makes the vim window
|
||||||
" split horizontally, with search result displayed in
|
" 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>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>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>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
|
" Hitting CTRL-space *twice* before the search type does a vertical
|
||||||
" split instead of a horizontal one
|
" 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>
|
\:vert scs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
|
||||||
nmap <C-Space><C-Space>d
|
nmap <C-Space><C-Space>d
|
||||||
\:vert scs find d <C-R>=expand("<cword>")<CR><CR>
|
\: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*
|
7. Cscope availability and information *cscope-info*
|
||||||
|
@@ -51,7 +51,7 @@ static cscmd_T cs_cmds[] =
|
|||||||
{ "add", cs_add,
|
{ "add", cs_add,
|
||||||
N_("Add a new database"), "add file|dir [pre-path] [flags]", 0 },
|
N_("Add a new database"), "add file|dir [pre-path] [flags]", 0 },
|
||||||
{ "find", cs_find,
|
{ "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,
|
{ "help", cs_help,
|
||||||
N_("Show this message"), "help", 0 },
|
N_("Show this message"), "help", 0 },
|
||||||
{ "kill", cs_kill,
|
{ "kill", cs_kill,
|
||||||
@@ -104,13 +104,13 @@ char_u *get_cscope_name(expand_T *xp, int idx)
|
|||||||
{
|
{
|
||||||
const char *query_type[] =
|
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}".
|
// Complete with query type of ":cscope find {query_type}".
|
||||||
* {query_type} can be letters (c, d, ... t) or numbers (0, 1,
|
// {query_type} can be letters (c, d, ... a) or numbers (0, 1,
|
||||||
* ..., 8) but only complete with letters, since numbers are
|
// ..., 9) but only complete with letters, since numbers are
|
||||||
* redundant. */
|
// redundant.
|
||||||
return (char_u *)query_type[idx];
|
return (char_u *)query_type[idx];
|
||||||
}
|
}
|
||||||
case EXP_CSCOPE_KILL:
|
case EXP_CSCOPE_KILL:
|
||||||
@@ -673,6 +673,9 @@ static char *cs_create_cmd(char *csoption, char *pattern)
|
|||||||
case '8': case 'i':
|
case '8': case 'i':
|
||||||
search = 8;
|
search = 8;
|
||||||
break;
|
break;
|
||||||
|
case '9': case 'a':
|
||||||
|
search = 9;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
(void)EMSG(_("E561: unknown cscope search type"));
|
(void)EMSG(_("E561: unknown cscope search type"));
|
||||||
cs_usage_msg(Find);
|
cs_usage_msg(Find);
|
||||||
@@ -969,6 +972,9 @@ static int cs_find_common(char *opt, char *pat, int forceit, int verbose,
|
|||||||
case '8':
|
case '8':
|
||||||
cmdletter = 'i';
|
cmdletter = 'i';
|
||||||
break;
|
break;
|
||||||
|
case '9':
|
||||||
|
cmdletter = 'a';
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
cmdletter = opt[0];
|
cmdletter = opt[0];
|
||||||
}
|
}
|
||||||
@@ -1125,14 +1131,15 @@ static int cs_help(exarg_T *eap)
|
|||||||
cmdp->usage);
|
cmdp->usage);
|
||||||
if (strcmp(cmdp->name, "find") == 0)
|
if (strcmp(cmdp->name, "find") == 0)
|
||||||
MSG_PUTS(_("\n"
|
MSG_PUTS(_("\n"
|
||||||
" c: Find functions calling this function\n"
|
" a: Find assignments to this symbol\n"
|
||||||
" d: Find functions called by this function\n"
|
" c: Find functions calling this function\n"
|
||||||
" e: Find this egrep pattern\n"
|
" d: Find functions called by this function\n"
|
||||||
" f: Find this file\n"
|
" e: Find this egrep pattern\n"
|
||||||
" g: Find this definition\n"
|
" f: Find this file\n"
|
||||||
" i: Find files #including this file\n"
|
" g: Find this definition\n"
|
||||||
" s: Find this C symbol\n"
|
" i: Find files #including this file\n"
|
||||||
" t: Find this text string\n"));
|
" s: Find this C symbol\n"
|
||||||
|
" t: Find this text string\n"));
|
||||||
|
|
||||||
cmdp++;
|
cmdp++;
|
||||||
}
|
}
|
||||||
|
@@ -25,18 +25,7 @@
|
|||||||
#define CSCOPE_DBFILE "cscope.out"
|
#define CSCOPE_DBFILE "cscope.out"
|
||||||
#define CSCOPE_PROMPT ">> "
|
#define CSCOPE_PROMPT ">> "
|
||||||
|
|
||||||
/*
|
// See ":help cscope-find" for the possible queries.
|
||||||
* 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
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char * name;
|
char * name;
|
||||||
|
@@ -370,17 +370,17 @@ static char *(p_cb_values[]) = {"unnamed", "unnamedplus", NULL};
|
|||||||
# define CB_UNNAMED 0x001
|
# define CB_UNNAMED 0x001
|
||||||
# define CB_UNNAMEDPLUS 0x002
|
# define CB_UNNAMEDPLUS 0x002
|
||||||
# define CB_UNNAMEDMASK (CB_UNNAMED | CB_UNNAMEDPLUS)
|
# define CB_UNNAMEDMASK (CB_UNNAMED | CB_UNNAMEDPLUS)
|
||||||
EXTERN long p_cwh; /* 'cmdwinheight' */
|
EXTERN long p_cwh; // 'cmdwinheight'
|
||||||
EXTERN long p_ch; /* 'cmdheight' */
|
EXTERN long p_ch; // 'cmdheight'
|
||||||
EXTERN int p_confirm; /* 'confirm' */
|
EXTERN int p_confirm; // 'confirm'
|
||||||
EXTERN int p_cp; /* 'compatible' */
|
EXTERN int p_cp; // 'compatible'
|
||||||
EXTERN char_u *p_cot; /* 'completeopt' */
|
EXTERN char_u *p_cot; // 'completeopt'
|
||||||
EXTERN long p_ph; /* 'pumheight' */
|
EXTERN long p_ph; // 'pumheight'
|
||||||
EXTERN char_u *p_cpo; /* 'cpoptions' */
|
EXTERN char_u *p_cpo; // 'cpoptions'
|
||||||
EXTERN char_u *p_csprg; /* 'cscopeprg' */
|
EXTERN char_u *p_csprg; // 'cscopeprg'
|
||||||
EXTERN int p_csre; /* 'cscoperelative' */
|
EXTERN int p_csre; // 'cscoperelative'
|
||||||
EXTERN char_u *p_csqf; /* 'cscopequickfix' */
|
EXTERN char_u *p_csqf; // 'cscopequickfix'
|
||||||
# define CSQF_CMDS "sgdctefi"
|
# define CSQF_CMDS "sgdctefia"
|
||||||
# define CSQF_FLAGS "+-0"
|
# define CSQF_FLAGS "+-0"
|
||||||
EXTERN int p_cst; /* 'cscopetag' */
|
EXTERN int p_cst; /* 'cscopetag' */
|
||||||
EXTERN long p_csto; /* 'cscopetagorder' */
|
EXTERN long p_csto; /* 'cscopetagorder' */
|
||||||
|
@@ -32,6 +32,7 @@ SCRIPTS := \
|
|||||||
# Tests using runtest.vim.vim.
|
# Tests using runtest.vim.vim.
|
||||||
# Keep test_alot*.res as the last one, sort the others.
|
# Keep test_alot*.res as the last one, sort the others.
|
||||||
NEW_TESTS = \
|
NEW_TESTS = \
|
||||||
|
test_cscope.res \
|
||||||
test_hardcopy.res \
|
test_hardcopy.res \
|
||||||
test_help_tagjump.res \
|
test_help_tagjump.res \
|
||||||
test_langmap.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
|
// clang-format off
|
||||||
static int included_patches[] = {
|
static int included_patches[] = {
|
||||||
|
2284,
|
||||||
2219,
|
2219,
|
||||||
// 2200,
|
// 2200,
|
||||||
// 2199,
|
// 2199,
|
||||||
@@ -242,7 +243,7 @@ static int included_patches[] = {
|
|||||||
// 2036,
|
// 2036,
|
||||||
// 2035 NA
|
// 2035 NA
|
||||||
// 2034 NA
|
// 2034 NA
|
||||||
// 2033,
|
2033,
|
||||||
// 2032 NA
|
// 2032 NA
|
||||||
// 2031,
|
// 2031,
|
||||||
// 2030 NA
|
// 2030 NA
|
||||||
@@ -285,7 +286,7 @@ static int included_patches[] = {
|
|||||||
// 1993,
|
// 1993,
|
||||||
// 1992,
|
// 1992,
|
||||||
// 1991,
|
// 1991,
|
||||||
// 1990,
|
1990,
|
||||||
// 1989,
|
// 1989,
|
||||||
// 1988 NA
|
// 1988 NA
|
||||||
// 1987 NA
|
// 1987 NA
|
||||||
@@ -323,7 +324,7 @@ static int included_patches[] = {
|
|||||||
// 1955,
|
// 1955,
|
||||||
// 1954,
|
// 1954,
|
||||||
// 1953,
|
// 1953,
|
||||||
// 1952,
|
1952,
|
||||||
// 1951 NA
|
// 1951 NA
|
||||||
// 1950,
|
// 1950,
|
||||||
// 1949,
|
// 1949,
|
||||||
|
Reference in New Issue
Block a user