[vim/vim] Can not change the value of an exported variable under an autoload directory (Issue #14591)

11 views
Skip to first unread message

errael

unread,
Apr 19, 2024, 12:03:07 AM4/19/24
to vim/vim, Subscribed

Steps to reproduce

Note: there is no import autoload or symbolic links.
Note: if the directory is not named autoload no error.

vim first.vim
:source
Error detected while processing :source buffer=1[3]../home/err/play/yyy/autoload/second.vim:
line    4:
E492: Not an editor command: val = 42

first.vim

vim9script

import './autoload/second.vim'

echo second.val

second.vim

vim9script

export var val = 11
val = 42

Expected behaviour

No error

I ran into this in a largish vim9script application while I was cleaning up; I don't think it was a change I made, but it might have been. I can't say for sure it was a recent change.

I haven't looked into the vim code. Plenty of time getting to the simple example;) I took out the symlink code I recently added, still happens.

Version of Vim

9.1.353

Environment

ubuntu/gtk

Logs and stack traces

No response


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/14591@github.com>

errael

unread,
Apr 19, 2024, 12:12:19 AM4/19/24
to vim/vim, Subscribed

Oops, forgot to mention: the tree looks like

$ tree
..
├── autoload
│   └── second.vim
└── first.vim


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/14591/2065718045@github.com>

errael

unread,
Apr 19, 2024, 10:25:57 AM4/19/24
to vim/vim, Subscribed

Turns out vim9.0 also behaves this way. I've looked through the :help again, but there's no indication that this behavior is intended.

I thought I had searched for autoload issues. But just did it again, and this might be another example, possibly even a duplicate.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/14591/2066698367@github.com>

errael

unread,
Apr 19, 2024, 11:22:03 AM4/19/24
to vim/vim, Subscribed

#13198 may be related


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/14591/2066799604@github.com>

Christian Brabandt

unread,
Apr 21, 2024, 8:48:33 AM4/21/24
to vim/vim, Subscribed

Closed #14591 as completed via 84f6dc7.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/14591/issue_event/12550813398@github.com>

Reply all
Reply to author
Forward
0 new messages