sponsor Vim development Vim logo Vim Book Ad

basic Tip #1362: mlcscope

 tip karma   Rating 164/41, Viewed by 995 

Read and edit this tip on the Vim tip wiki. The wiki may have a more recent version of this tip.

created:   October 19, 2006 10:15      complexity:   basic
author:   Frodak      as of Vim:  

Hi,

To get vim to work with mlcscope I had to apply the following patch:

--- vim-7.0.122-1/src/if_cscope.c       2006-08-30 15:40:59.001000000 -0400
+++ if_cscope.c 2006-10-19 12:07:19.921445600 -0400
@@ -630,7 +630,7 @@
         */
        if ((stok = strtok(buf, (const char *)" ")) == NULL)
            continue;
-       if (strcmp((const char *)stok, "cscope:"))
+       if (strstr((const char *)stok, "cscope:")== NULL)
            continue;

        if ((stok = strtok(NULL, (const char *)" ")) == NULL)

This should allow cscope or mlcscope to work properly.  Don't forget to compile the cscope interface: via the --enable-cscope or --with-features=huge.

The following needs to be added to your .vimrc file:
set csprg=/usr/bin/mlcscope

 rate this tip  Life Changing Helpful Unfulfilling 

<< Disable auto-comment when editting c/cpp files | getchar() trick using recursive <expr> map >>

Additional Notes

Anonymous, January 12, 2007 7:07
As some have pointed out you can rename the mlcscope program to cscope and its output will be compatible with vim.
Anonymous, January 19, 2007 7:33
This patch is now official.  It is patch Patch 7.0.184.
If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to vim@vim.org after searching the archive. Help Bram help Uganda.
   
Sponsored by Web Concept Group Inc. SourceForge.net Logo