Re: Access class member from command line

2024-05-10 Thread Lifepillar
On 2024-05-10, Yegappan Lakshmanan wrote: >> Right now, the only issue I have is with autoload scripts in my vimrc, >> but I see that it's being tracked as #13313 in GitHub. Other than that, >> I must say that Vim 9 script has been rock solid for me (no more >> crashes), and very pleasant to use!

Re: Access class member from command line

2024-05-09 Thread Yegappan Lakshmanan
Hi, On Thu, May 9, 2024 at 1:16 AM Lifepillar wrote: > > On 2024-05-09, Yegappan Lakshmanan wrote: > > Hi, > > > > On Wed, May 8, 2024 at 2:11 PM Lifepillar wrote: > >> > Looks like a bug. Should be able to do `foo.Config.option = true` > >> > >> Indeed. And fixed. That works with the latest Vi

Re: Access class member from command line

2024-05-09 Thread Lifepillar
On 2024-05-09, Yegappan Lakshmanan wrote: > Hi, > > On Wed, May 8, 2024 at 2:11 PM Lifepillar wrote: >> > Looks like a bug. Should be able to do `foo.Config.option = true` >> >> Indeed. And fixed. That works with the latest Vim (9.1.399). >> > > Yes. This should be addressed by patch 9.1.0398. I

Re: Access class member from command line

2024-05-08 Thread Yegappan Lakshmanan
Hi, On Wed, May 8, 2024 at 2:11 PM Lifepillar wrote: > > On 2024-05-07, Girish wrote: > > On Sunday 5 May 2024 at 15:39:53 UTC+2 Lifepillar wrote: > > >> Let's say I have this class in some `foo.vim` file: > >> > >> export class Config > >> public static var option = false > >> endclass > >> >

Re: Access class member from command line

2024-05-08 Thread Lifepillar
On 2024-05-07, Girish wrote: > On Sunday 5 May 2024 at 15:39:53 UTC+2 Lifepillar wrote: >> Let's say I have this class in some `foo.vim` file: >> >> export class Config >> public static var option = false >> endclass >> >> Now, I'd like to set `Config.option` to `true` from a script and from >>

Re: Access class member from command line

2024-05-07 Thread Girish
Looks like a bug. Should be able to do `foo.Config.option = true` ``` Items in a class ~ *E1318* *E1325* *E1388* Inside a class, in between `:class` and `:endclass`, these items can appear: - An object variable declaration: > var _protectedVariableName: memberType var readonlyVariableName: memberT

Re: Access class member from command line

2024-05-06 Thread Igbanam Ogbuluijah
Yeah, all variables within vim9script seem script-local. If you want to access them in the command line, you'd have to prefix them with the scopes in :h eval.txt — global, window, and buffer all work. Best, Igbanam On Sun, May 5, 2024 at 2:39 PM Lifepillar wrote: > Let's say I have this class i

Access class member from command line

2024-05-05 Thread Lifepillar
Let's say I have this class in some `foo.vim` file: export class Config public static var option = false endclass Now, I'd like to set `Config.option` to `true` from a script and from the command line. From a script, I can do this: import `foo.vim` type FooConfig = foo