Re: [vim/vim] E1041 is thrown when a variable is exported from a script contained in the autoload/ folder and the script is sourced more than once (Issue #19205)
Mao-Yining (Vim Github Repository) <[email protected]> Sat, 01 Aug 2026 06:47:31 -0700
| Newsgroups | gmane.editors.vim.devel |
|---|---|
| Message-ID | <vim/vim/issues/19205/[email protected]> |
mao-yining left a comment (vim/vim#19205) @h-east > Normal def functions can be redefined, but since enum/class are part of the type system, I believe redefining them is prohibited due to compatibility issues with existing instances. Actually, under the current implementation, if a type is modified, existing instances do not get refreshed—they retain their previous behavior, while only new instances will apply the changes. So my current approach is to store all instances in a table within the script. Instead of using `.new()` directly, external callers use a `GetInstance()` function to get instances. This way, when a class is live-reloaded, all existing instances are cleared as well. In summary, I believe that supporting dynamic reloading for exported enums/classes under autoload is still worth considering. -- Reply to this email directly or view it on GitHub: https://github.com/vim/vim/issues/19205#issuecomment-5151693953 You are receiving this because you are subscribed to this thread. Message ID: <vim/vim/issues/19205/[email protected]> -- -- 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 visit https://groups.google.com/d/msgid/vim_dev/vim/vim/issues/19205/5151693953%40github.com.