Hello,
This is attempt #2 at getting this feature/patch into vim. It was
originally submitted almost one year back. There was some feedback
from Gary Johnson and Yegappan Lakshmanan and I reworked the patch
based on that; and then the discussion petered out. The original
thread can be found here:
http://tech.groups.yahoo.com/group/vimdev/message/46634
The proposed patch is attached to this mail. I believe it addresses
all the issues that were raised the last time. Feedback is welcome.
I have been using it for the last year without any problems at all
and would like to see it integrated into the official vim.
Recap: This patch implements a new ex mode command "lscscope",
which is the same as scscope but uses the location list instead of
the quickfix list.
Regards,
Navdeep
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---
Index: runtime/doc/if_cscop.txt
===================================================================
--- runtime/doc/if_cscop.txt (revision 997)
+++ 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 997)
+++ runtime/doc/index.txt (working copy)
@@ -1280,6 +1280,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 997)
+++ 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 997)
+++ src/if_cscope.c (working copy)
@@ -971,7 +971,7 @@
}
return cs_find_common(opt, pat, eap->forceit, TRUE,
- eap->cmdidx == CMD_lcscope);
+ eap->cmdidx == CMD_lcscope || eap->cmdidx == CMD_lscscope);
} /* cs_find */
@@ -1113,23 +1113,23 @@
{
cs_file_results(f, nummatches);
fclose(f);
+# ifdef FEAT_WINDOWS
+ if (postponed_split != 0)
+ {
+ win_split(postponed_split > 0 ? postponed_split : 0,
+ postponed_split_flags);
+# ifdef FEAT_SCROLLBIND
+ curwin->w_p_scb = FALSE;
+# endif
+ postponed_split = 0;
+ }
+# endif
if (use_ll) /* Use location list */
wp = curwin;
/* '-' starts a new error list */
if (qf_init(wp, tmp, (char_u *)"%f%*\\t%l%*\\t%m",
*qfpos == '-') > 0)
{
-# ifdef FEAT_WINDOWS
- if (postponed_split != 0)
- {
- win_split(postponed_split > 0 ? postponed_split : 0,
- postponed_split_flags);
-# ifdef FEAT_SCROLLBIND
- curwin->w_p_scb = FALSE;
-# endif
- postponed_split = 0;
- }
-# endif
if (use_ll)
/*
* In the location list window, use the displayed location