nojanath / SublimeKSP

Fork of Nils Liberg's SublimeKSP plugin. See README for details.
GNU General Public License v3.0
86 stars 18 forks source link

Allow combinable callbacks in macros #378

Closed teskdop closed 1 year ago

teskdop commented 1 year ago

Now that we can combine callbacks, would it be possible to allow those inside macros like we can with ui_control() callbacks? Example:

on init
    CREATE_PGS(key_name, element_count)
end on

macro CREATE_PGS(key_name, element_count)
    // create key with matching persistent array...

    on persistence_changed
        // check persistence, update key with array...
    end on

    on pgs_changed
        // update array...
    end on
end macro

I'm sure it's a lot of time/work and probably not very high on the list if at all, but I mention it anyway just in case. Close this if not likely to happen so it doesn't clog things up.

mkruselj commented 1 year ago

The above code wouldn't really work because macros inline in place, which means you would have created PCCB and PGSCB inside ICB, which is not allowed.

teskdop commented 1 year ago

Good point. I was going to close this but not sure if it's my place to do so. I'll leave it to you, thanks.