Hello!

I've attached a patch which allows subdirectories with help. Actually, the tags system already permitted subdirectories; what this patch does is extend helptags to search through subdirectories, creating appropriate tags.

The patch is experimental, and I've only tested it under Linux (I hope to test it under Windows later). Needs testing under other o/s'es! I don't have access to macos or vms, for example.

Regards,
Chip Campbell

--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
*** src/ORIG_ex_cmds.c  2012-11-16 15:38:32.156206398 -0500
--- src/ex_cmds.c       2012-11-19 12:19:02.021748489 -0500
***************
*** 6344,6353 ****
      }
  
  #ifdef FEAT_MULTI_LANG
!     /* Get a list of all files in the directory. */
      STRCPY(NameBuff, dirname);
      add_pathsep(NameBuff);
!     STRCAT(NameBuff, "*");
      if (gen_expand_wildcards(1, &NameBuff, &filecount, &files,
                                                    EW_FILE|EW_SILENT) == FAIL
            || filecount == 0)
--- 6344,6353 ----
      }
  
  #ifdef FEAT_MULTI_LANG
!     /* Get a list of all files in the help directory and in subdirectories. */
      STRCPY(NameBuff, dirname);
      add_pathsep(NameBuff);
!     STRCAT(NameBuff, "**");
      if (gen_expand_wildcards(1, &NameBuff, &filecount, &files,
                                                    EW_FILE|EW_SILENT) == FAIL
            || filecount == 0)
***************
*** 6449,6454 ****
--- 6449,6456 ----
      char_u    *s;
      int               i;
      char_u    *fname;
+     int         filelen;
+     int         dirlen;
  # ifdef FEAT_MBYTE
      int               utf8 = MAYBE;
      int               this_utf8;
***************
*** 6459,6468 ****
      /*
       * Find all *.txt files.
       */
      STRCPY(NameBuff, dir);
      add_pathsep(NameBuff);
!     STRCAT(NameBuff, "*");
!     STRCAT(NameBuff, ext);
      if (gen_expand_wildcards(1, &NameBuff, &filecount, &files,
                                                    EW_FILE|EW_SILENT) == FAIL
            || filecount == 0)
--- 6461,6470 ----
      /*
       * Find all *.txt files.
       */
+     dirlen= strlen(dir);
      STRCPY(NameBuff, dir);
      add_pathsep(NameBuff);
!     STRCAT(NameBuff, "**");
      if (gen_expand_wildcards(1, &NameBuff, &filecount, &files,
                                                    EW_FILE|EW_SILENT) == FAIL
            || filecount == 0)
***************
*** 6516,6528 ****
       */
      for (fi = 0; fi < filecount && !got_int; ++fi)
      {
        fd = mch_fopen((char *)files[fi], "r");
        if (fd == NULL)
        {
            EMSG2(_("E153: Unable to open %s for reading"), files[fi]);
            continue;
        }
!       fname = gettail(files[fi]);
  
  # ifdef FEAT_MBYTE
        firstline = TRUE;
--- 6518,6532 ----
       */
      for (fi = 0; fi < filecount && !got_int; ++fi)
      {
+       filelen= strlen(files[fi]);
+       if(filelen < 4 || STRCMP(files[fi]+filelen-4,".txt")) continue;
        fd = mch_fopen((char *)files[fi], "r");
        if (fd == NULL)
        {
            EMSG2(_("E153: Unable to open %s for reading"), files[fi]);
            continue;
        }
!       fname = files[fi] + dirlen + 1;
  
  # ifdef FEAT_MBYTE
        firstline = TRUE;

Raspunde prin e-mail lui