Hello,
Currently :cscope has a variant :lcscope that allows the use of the location
list instead of the quickfix list. However, :scscope has no equivalent that
uses the location list. Please note that :scs splits only if cscope returns
some results, so :scs is not the same as ":split cs". Due to this reason
":split lcscope" can not be used to get the same behaviour as the proposed
:lscscope.
I was looking for a way to open the results of a cscope query in a new tab, and
use the location list at the same time. That's when I realized the need for
:lscsope. ":tab lsc ..." does what I need.
Here is a patch to add :lscscope to vim. I have tested it on Solaris and Linux
and it works for me. Feedback is welcome.
Regards,
Navdeep
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Index: runtime/doc/if_cscop.txt
===================================================================
--- runtime/doc/if_cscop.txt (revision 251)
+++ runtime/doc/if_cscop.txt (working copy)
@@ -213,6 +213,11 @@
'cscopequickfix' option is set, the location list for the current window is
used instead of the quickfix list to show the cscope results.
+ *:lscscope* *:lsc*
+This command is same as the ":scscope" command, except when the
+'cscopequickfix' option is set, the location list for the current window is
+used instead of the quickfix list to show the cscope results.
+
*:cstag* *E257* *E562*
If you use cscope as well as ctags, |:cstag| allows you to search one or
the other before making a jump. For example, you can choose to first
Index: runtime/doc/index.txt
===================================================================
--- runtime/doc/index.txt (revision 251)
+++ runtime/doc/index.txt (working copy)
@@ -1276,6 +1276,7 @@
|:lpfile| :lpf[ile] go to last location in previous file
|:lrewind| :lr[ewind] go to the specified location, default first one
|:ls| :ls list all buffers
+|:lscscope| :lsc[scope] like ":scscope" but uses location list
|:ltag| :lt[ag] jump to tag and add matching tags to the
location list
|:lunmap| :lu[nmap] like ":unmap!" but includes Lang-Arg mode
Index: src/ex_cmds.h
===================================================================
--- src/ex_cmds.h (revision 251)
+++ src/ex_cmds.h (working copy)
@@ -581,6 +581,8 @@
RANGE|NOTADR|COUNT|TRLBAR),
EX(CMD_ls, "ls", buflist_list,
BANG|TRLBAR|CMDWIN),
+EX(CMD_lscscope, "lscscope", do_scscope,
+ EXTRA|NOTRLCOM|SBOXOK),
EX(CMD_move, "move", ex_copymove,
RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN|MODIFY),
EX(CMD_mark, "mark", ex_mark,
Index: src/if_cscope.c
===================================================================
--- src/if_cscope.c (revision 251)
+++ src/if_cscope.c (working copy)
@@ -973,7 +973,7 @@
}
return cs_find_common(opt, pat, eap->forceit, TRUE,
- eap->cmdidx == CMD_lcscope);
+ eap->cmdidx == CMD_lcscope || eap->cmdidx == CMD_lscscope);
} /* cs_find */