-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Add support for evaluation in context like CIDER #434
Comments
@sheluchin I tried to add For example, you can define mappings as follows. nmap <Leader>ece <Plug>(iced_eval_in_context)<Plug>(sexp_outer_list) Could you try? |
@liquidz Thank you for trying this. It looks like it doesn't quite work in this version. In the simplest form:
produces this error:
It looks like the It should also be able to handle multiple bindings somehow. |
@sheluchin Thanks for your confirmation! You should input
I think the approach to figure out bindings automatically is not appropriate because of the order of bindings. For example, if we pass In comparison, it would be better to simply input
As described above, we can handle multiple bindings like |
Ah, my mistake! Yes, as you describe - providing the full binding form - it does work as expected and is a nice workflow tool. I like the idea of not having to make edits to the file when testing stuff quickly in the REPL. It's nice that you can scroll through the history with up and down arrows too :) Do you think it would be difficult to add an FZF interface for the history? Thanks again, @liquidz. It's good stuff. |
Cool. |
I think I found a small bug in the current version. It looks like if you start entering bindings and then press escape, it still tries to evaluate it, rather than canceling. |
@sheluchin Nice catch! Thanks. |
I've added E.g. nmap <Leader>esce <Plug>(iced_eval_in_selected_context)<Plug>(sexp_outer_list) With this mapping, we can evaluate codes with the context selected by But we cannot switch between Thus, the approach providing different mappings does not seems to be a good, as it is tired to use different mappings for inputting and selecting. How do you think? |
Thanks! Works.
I see what you mean. It is awkward to make a selection and then modify it in some way. I don't think it's very important as However, just so you're aware, FZF does have an option for dealing with this kind of situation. You can see it with the
In any case, this is a nice new feature :) Thanks again, @liquidz. |
@sheluchin Thanks for your confirmation!
Ah I see, it is editable after selection.
OK. I'll delete |
Just released v3.11.3086 |
cf. clojure-emacs/cider#2113
cc @sheluchin
The text was updated successfully, but these errors were encountered: