-
Notifications
You must be signed in to change notification settings - Fork 1
fix refactor-nrepl option passthrough #5
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
Conversation
The method of passing through refactor-nrepl options does not work. Instead of attempting to configure via a stringified Clojure map to send to nrepl, allow the user to set each option explicitly in a way that is more integrated into the vim ecosystem.
This appears to include some unrelated changes to keybindings? |
clojure-emacs/refactor-nrepl@3a2fa38#diff-9d54d18d9837001d8284bccf5d4c50b0 looks like this commit changed the behavior. Is it worth just making this option a map which will be merged into? Then it will support all of the available options. |
That's to get the vim docs inline with what the actual keybindings are. The keybindings were altered some time in the past.
Good idea! I'll check out how to do that. Vimscript isn't my strongpoint :) |
Rather than having a global per option, have a single global dictionary for refactor-nrepl options. This is more versatile and resilient to any future additions or removals to these options from the refactor-nrepl project.
I've made the options a map. I think that's more versatile now. |
plugin/cider.vim
Outdated
let opts = { 'op': 'clean-ns', 'path': p } | ||
|
||
if exists('g:refactor_nrepl_options') | ||
for [opt_k, opt_v] in items(g:refactor_nrepl_options) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can use extend
function here. Might not even need the if
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can probably do something like extend(get(g:,'refactor_nrepl_options', {}), opts)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extend
modifies the first given dict so you should create local opts dict so the global options dict is not accidentally modified.
let opts = {'op': 'clean-ns', 'path': p}
extend(opts, get(g:,'refactor_nrepl_options', {}))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thank you. Of course there's an extend function! Much better :)
Manually iterating through the items and adding them to the dictionary is unnecessary as the extend() functions exists to extend a dictionary with the items of another dictionary.
Tested & merged, thanks. |
The method of passing through refactor-nrepl options does not work. Instead of attempting to configure via a stringified Clojure map to send to nrepl, allow the user to set options explicitly in a way that is more integrated into the vim ecosystem.
Only supports the
prune-ns-form
andprefix-rewriting
so far.This should address #3