-
-
Notifications
You must be signed in to change notification settings - Fork 648
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
Don't move point when clearing or highlighting test results #717
Conversation
Seems to me that your change will affect the behavior of |
|
@@ -2,6 +2,11 @@ | |||
|
|||
## master (unreleased) | |||
|
|||
### Bugs fixed |
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.
There's already a Bugs fixed
section beneath Changes
.
Fixed the duplicate "Bugs fixed" section and rebased. |
Ah, the name 👍 from me, but let's wait to hear from @jeffvalk as well because he recently refactored this code. |
@jeffvalk Ping :-) |
Pardon my tardiness on this! Yes, this change makes sense to me. @r0man Would you update this PR to apply against I also agree with @bbatsov that the name |
When running tests with cider-test failing tests are highlighted in the source files, or if tests are passing again previous highlights are cleared. The code that does this is using the `cider-find-var` function to find the buffer for a vars under test and then does it's job. `cider-find-var` used to move point to the line at which the var was found. This is a problematic side effect, because code using `cider-find-var` to find the buffer can't use save-excursion because it doesn't know which buffer to safe beforehand. This PR removes the `goto-line` in `cider-find-var` and returns just the buffer without any side effect. The `cider-company-location` uses similar code as `cider-find-var` but with `save-excursion` wrapped around it.
Don't move point when clearing or highlighting test results
👍 |
When running tests with cider-test failing tests are highlighted in the source
files, or if tests are passing again previous highlights are cleared. The code
that does this is using the
cider-find-var
function to find the buffer for avars under test and then does it's job.
cider-find-var
used to move point to the line at which the var was found. Thisis a problematic side effect, because code using
cider-find-var
to find thebuffer can't use save-excursion because it doesn't know which buffer to safe
beforehand.
This PR removes the
goto-line
incider-find-var
and returns just the bufferwithout any side effect. The
cider-company-location
uses similar code ascider-find-var
but withsave-excursion
wrapped around it.