Neither worked for me, so I guess what I'm trying to do is a non-starter.

On Mon, Jun 12, 2023 at 2:18 PM Bram Moolenaar <[email protected]> wrote:

>
> > As the subject says, if I create a class that ultimately defines a
> mapping
> > when a new instance is created, unfortunately the mapping can't access
> the
> > "this" variable of the instance.
> >
> > Is there a way to do this I'm not seeing in the documentation?
>
> You probably need to use a closure.  That is the only way you can bind a
> variable and pass the reference around.  You can find hints around
> ":help E1271".
>
> Keep in mind that mappings work in the global namespace.  To access
> something local to the script you can use <SID> or <ScriptCmd>.
> You may first give <ScriptCmd> a try.
>
> --
> hundred-and-one symptoms of being an internet addict:
> 158. You get a tuner card so you can watch TV while surfing.
>
>  /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net
>  \\\
> ///
> \\\
> \\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/
> ///
>  \\\            help me help AIDS victims -- http://ICCF-Holland.org
> ///
>


-- 
Christian J. Robinson <[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 on the web visit 
https://groups.google.com/d/msgid/vim_dev/CAK14FZKtE-QwLGEqjjVyOguBBW_eZpeLxqFqQbROJLkWqTkxrQ%40mail.gmail.com.

Raspunde prin e-mail lui