Fix cider-eval-defun-up-to-point
incorrectly matching brackets
#3031
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Consider:
If
|
represents the cursor, and then I runcider-eval-defun-up-to-point
, CIDER attempts to evaluate(prn 1 [2 {3 4|)]}
resulting in an exception.I also get the issue in a comment block:
...which results in the evaluation of
(prn 5))
— there is an extra closing delimiter ascider--calculate-closing-delimiters
looks beyond theprn
form and matches the(
of the comment form. I would expect the evaluation of(prn 5)
.In this patch I have integrated modified functions that appear to have solved this problem for me.
The code for the new
cider--insert-closing-delimiters
is an adaptation of thecider-repl-closing-return
function. Perhapscider-repl-closing-return
should depend on the more generalcider--insert-closing-delimiters
?In one commit I have removed functions that seem to have been made redundant.
eldev test
)eldev lint
) which is based onelisp-lint
and includescheckdoc
, check-declare, packaging metadata, indentation, and trailing whitespace checks.You've updated the user manual (if adding/changing user-visible functionality)