Yegappan wrote:
> On Mon, Mar 21, 2022 at 4:11 AM Bram Moolenaar <
Br...@moolenaar.net> wrote:
> >
> > It's actually nice that the new :source functionality makes this easy to
> > try out.
> >
>
> It involves a little bit more typing to try out the Vim9 sample code
> in the help text compared to the legacy code.
>
> For the legacy script examples in the help text, you can visually select
> the code and run the ":'<,'>source" command.
>
> For the Vim9 script examples in the help text, you need to visually select
> the code and run the ":vim9cmd :'<,'>source" command. The visual
> selection range needs to be prefixed with "vim9cmd :".
Yes, I was wondering whether we can allow using ":'<,'>vim9cmd source".
Or in general, ":'<,'>cmdmod command". Since the "'<,'>" is
automatically added. We probably can't do this for ranges in general.
> > However, it might be that two examples overlap, since this
> > file is a help file with unrelated examples. Perhaps we need a way to
> > clear what the script contains? We can't use "!", it already has a
> > meaning for :source. Perhaps "[range]source ++clear" ?
>
> I can add support for this. But this involves more typing though.
Well, otherwise you might get an error.
--
Luxury. We used to have to get out of the lake at three o'clock in the
morning, clean the lake, eat a handful of hot gravel, go to work at the
mill every day for tuppence a month, come home, and Dad would beat us
around the head and neck with a broken bottle, if we were LUCKY!