Andy Wokula wrote:
> Am 08.12.2018 um 16:03 schrieb Bram Moolenaar: > > Yasuhiro Matsumoto wrote: > > > >> On Saturday, December 8, 2018 at 10:53:07 PM UTC+9, Bram Moolenaar > >> wrote: > >>> I have recently changed the behavior of :function to allow for > >>> redefining (overwriting) a function when that should normally be > >>> fine. Therefore, using function! is hardly ever needed. > >>> > >>> Previously, when sourcing a script a second time, one had to use > >>> function! to redefine the functions. This was very common, since > >>> when developing a plugin once has to try several times before > >>> getting it right. A big problem with this is that when another > >>> script uses the same function, or you had copy-pasted the > >>> function and forgot to change the name, the function would be > >>> errornously overwritten. > >>> > >>> Vim now checks the script ID of where the function was defined, > >>> and whether that same script is being sourced again. This allows > >>> for silently overwriting the function from the same script file, > >>> once. > >>> > >>> So, please stop using function! > >>> > >>> > >>> Now wondering if the same should be done for user commands... > >> > >> This seems to be good improvement but some plugin manager reload > >> plugins when update install plugins. ex: vim-plug So older version > >> of vim will occur errors if some plugins remove ! from their > >> codes. > > > > Yeah, it may take a couple of years until this change gets to most > > places. I have been wondering about auto-updating Vim (like Chrome > > does), but don't think that is feasible. > > > > Anyway, I think I'll go ahead and also do this for :command. > > So the next step is to add another 'cpoptions' flag which disables > the effect of `!' in `:function!' when used inside a script. > > Ie you can continue writing `:function!' in a script, but the bang > will have no effect if the flag is set. > > And the flag will be set by default in newer Vims. > > Just a thought. Hmm, I don't see a good reason for that. -- BEDEVERE: Wait. Wait ... tell me, what also floats on water? ALL: Bread? No, no, no. Apples .... gravy ... very small rocks ... ARTHUR: A duck. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- b...@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 /// -- -- 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 vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.