To: vim_dev@googlegroups.com Subject: Patch 8.2.1398 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1398 Problem: Autoload script sourced twice if sourced directly. Solution: Do not source an autoload script again. (issue #6644) Files: src/scriptfile.c, src/testdir/sautest/autoload/sourced.vim *** ../vim-8.2.1397/src/scriptfile.c 2020-07-26 15:55:21.614845244 +0200 --- src/scriptfile.c 2020-08-08 21:26:53.013883237 +0200 *************** *** 2012,2017 **** --- 2012,2018 ---- char_u *scriptname, *tofree; int ret = FALSE; int i; + int ret_sid; // If there is no '#' after name[0] there is no package name. p = vim_strchr(name, AUTOLOAD_CHAR); *************** *** 2039,2045 **** } // Try loading the package from $VIMRUNTIME/autoload/.vim ! if (source_runtime(scriptname, 0) == OK) ret = TRUE; } --- 2040,2047 ---- } // Try loading the package from $VIMRUNTIME/autoload/.vim ! // Use "ret_sid" to avoid loading the same script again. ! if (source_in_path(p_rtp, scriptname, 0, &ret_sid) == OK) ret = TRUE; } *** ../vim-8.2.1397/src/testdir/sautest/autoload/sourced.vim 2017-12-07 22:19:22.000000000 +0100 --- src/testdir/sautest/autoload/sourced.vim 2020-08-08 21:26:22.125973006 +0200 *************** *** 1,3 **** let g:loaded_sourced_vim += 1 ! func! sourced#something() endfunc --- 1,4 ---- let g:loaded_sourced_vim += 1 ! func sourced#something() endfunc + call sourced#something() *** ../vim-8.2.1397/src/version.c 2020-08-08 17:55:46.246417672 +0200 --- src/version.c 2020-08-08 19:03:03.046638129 +0200 *************** *** 756,757 **** --- 756,759 ---- { /* Add new patch number below this line */ + /**/ + 1398, /**/ -- hundred-and-one symptoms of being an internet addict: 156. You forget your friend's name but not her e-mail address. /// Bram Moolenaar -- Bram@Moolenaar.net -- 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 ///