Patch 8.1.1639
Problem:    Changing an autoload name into a script file name is inefficient.
Solution:   Remember the last replaced #. (Ozaki Kiichi, closes #4618)
Files:      src/eval.c


*** ../vim-8.1.1638/src/eval.c  2019-06-25 04:12:12.304665282 +0200
--- src/eval.c  2019-07-05 22:09:08.084680393 +0200
***************
*** 9219,9241 ****
  /*
   * Return the autoload script name for a function or variable name.
   * Returns NULL when out of memory.
   */
      char_u *
  autoload_name(char_u *name)
  {
!     char_u    *p;
      char_u    *scriptname;
  
!     /* Get the script file name: replace '#' with '/', append ".vim". */
      scriptname = alloc(STRLEN(name) + 14);
      if (scriptname == NULL)
        return FALSE;
      STRCPY(scriptname, "autoload/");
      STRCAT(scriptname, name);
!     *vim_strrchr(scriptname, AUTOLOAD_CHAR) = NUL;
!     STRCAT(scriptname, ".vim");
!     while ((p = vim_strchr(scriptname, AUTOLOAD_CHAR)) != NULL)
        *p = '/';
      return scriptname;
  }
  
--- 9219,9242 ----
  /*
   * Return the autoload script name for a function or variable name.
   * Returns NULL when out of memory.
+  * Caller must make sure that "name" contains AUTOLOAD_CHAR.
   */
      char_u *
  autoload_name(char_u *name)
  {
!     char_u    *p, *q = NULL;
      char_u    *scriptname;
  
!     // Get the script file name: replace '#' with '/', append ".vim".
      scriptname = alloc(STRLEN(name) + 14);
      if (scriptname == NULL)
        return FALSE;
      STRCPY(scriptname, "autoload/");
      STRCAT(scriptname, name);
!     for (p = scriptname + 9; (p = vim_strchr(p, AUTOLOAD_CHAR)) != NULL;
!                                                                   q = p, ++p)
        *p = '/';
+     STRCPY(q, ".vim");
      return scriptname;
  }
  
*** ../vim-8.1.1638/src/version.c       2019-07-05 21:53:14.939268472 +0200
--- src/version.c       2019-07-05 22:10:40.431858564 +0200
***************
*** 779,780 ****
--- 779,782 ----
  {   /* Add new patch number below this line */
+ /**/
+     1639,
  /**/

-- 
I still remember when I gave up Smoking, Drinking and Sex.  It was the
most *horrifying* hour of my life!

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/201907052014.x65KEVZ0002156%40masaka.moolenaar.net.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui