Skip to content

Stop cursor moving when initialising the CIDER REPL #2599

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

Merged

Conversation

simon-katz
Copy link
Contributor

Fixes this bug: When cider-repl-pop-to-buffer-on-connect is nil the cursor jumps
when initialising the CIDER REPL. The cursor jumps in whatever buffer is
current.

This commit fixes commit e0aca78b, whose commit message says:

Make sure REPL window point is at point-max at startup
Needed when cider-repl-pop-to-buffer-on-connect is 'display-only

This commit applies the new functionality only when
cider-repl-pop-to-buffer-on-connect is display-only.

The following are not done, but I think they're not applicable.

  • You've added tests (if possible) to cover your change(s)
  • You've updated the user manual (if adding/changing user-visible functionality)

@simon-katz simon-katz marked this pull request as ready for review February 24, 2019 14:19
@simon-katz simon-katz force-pushed the stop-cursor-moving-when-initialising branch from 4a2007f to 7d03d45 Compare February 24, 2019 16:06
@manuel-uberti
Copy link
Contributor

Thanks for this, it's a rather annoying thing. 👍

@cichli
Copy link
Member

cichli commented Feb 25, 2019

Thanks for the PR 😄!

What do you think about using get-buffer-window rather than checking the value of the option? Maybe we shouldn't ever assume that the selected window is the correct one.

    (when-let ((window (get-buffer-window)))
      (set-window-point window (point-max)))

@simon-katz
Copy link
Contributor Author

simon-katz commented Feb 25, 2019

@cichli

What do you think about using get-buffer-window rather than checking the value of the option? Maybe we shouldn't ever assume that the selected window is the correct one.

I'm not sure — I don't understand the initialisation code very well.

If someone tells me it's the right thing to do, I'm happy to make the change.

EDIT 1: Oh, the buffer will always be the REPL buffer, right? So, yes, I will make this change.
EDIT 2: Done.

Fixes this bug: When cider-repl-pop-to-buffer-on-connect is nil the
cursor jumps when initialising the CIDER REPL. The cursor jumps in
whatever buffer is current.

This commit fixes commit e0aca78, whose commit message says:

    Make sure REPL window point is at point-max at startup
    Needed when cider-repl-pop-to-buffer-on-connect is 'display-only

This commit applies the new functionality only when the REPL buffer is
being displayed in a window.
@simon-katz simon-katz force-pushed the stop-cursor-moving-when-initialising branch from 7d03d45 to 5915c65 Compare February 25, 2019 12:41
@cichli cichli merged commit 53d7fc7 into clojure-emacs:master Feb 25, 2019
@cichli
Copy link
Member

cichli commented Feb 25, 2019

Thanks for this! 🙌

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

Successfully merging this pull request may close these issues.

3 participants