Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: log buffer like in conjure #462

Open
glyh opened this issue Jun 18, 2023 · 2 comments
Open

FR: log buffer like in conjure #462

glyh opened this issue Jun 18, 2023 · 2 comments

Comments

@glyh
Copy link

glyh commented Jun 18, 2023

In conjure, all your evaluation goes to a log buffer, it contains the evaluated code, the output, along with stdout. User is free to modify anything in that buffer and it won't be stored as it's a temporary buffer.

This will be really helpful for users to tinker around with their code without being afraid that their codebase is broken.

@glyh
Copy link
Author

glyh commented Jun 21, 2023

Hello, if I implement this feature would you like to accept it @liquidz ? :)

@liquidz
Copy link
Owner

liquidz commented Jun 21, 2023

@glyh Sorry for late reply 🙇

Hello, if I implement this feature would you like to accept it @liquidz ? :)

It depends on the policy of implementation.

vim-iced already has a Stdout buffer, and I want to avoid a situation where multiple similar features exist.
So, the policy should either completely replace the Stdout buffer, or extend the Stdout buffer.

But, it is currently possible to output evaluation code and evaluation results to the Stdout buffer using the Hook feature,
so if the policy is to extend the Stdout buffer, we also need to consider conflicts with the Hook feature.

call iced#hook#add('eval_prepared', {
    \ 'type': 'function',
    \ 'exec': {v -> iced#buffer#stdout#append(printf(";; Eval:\n%s", v['code']))},
    \ })
call iced#hook#add('evaluated', {
   \ 'type': 'function',
   \ 'exec': {v -> iced#buffer#stdout#append(printf(";; Ret:\n%s", v['result']['value']))},
   \ })

How did you plan to implement this feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants