Skip to content

Eval and replaced evaluated form with result #110

@poga

Description

@poga

For example, I have a form

(+ 1 2)

After evaluation, I want it to become:

3

How do I achieve it with slimv?

I have a working prototype at https://github.com/poga/slimv. It exposes two new function SlimvEvalDefunAndReplace and SlimvEvalDefunAndReplace.

It kinda worked. However there's some limit to it (mostly because I'm completely new to vimscript):

  1. It has a delay between evaluation complete and replacing the form
  2. If I do anything while waiting for the replacement, it usually breaks.
  3. It pollutes register r. I'm not using the register anyway but it's definitely not ideal.

My question is: Is there a better way to do this? I'm willing to contribute if you're fine with this feature. Any guidance is appreciated 😄

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions