Skip to content

Ensure repl scrolls on insert #204

New issue

Have a question about this project? No Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “No 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? No Sign in to your account

Merged
merged 3 commits into from
Aug 7, 2022

Conversation

dpsutton
Copy link
Contributor

@dpsutton dpsutton commented Aug 6, 2022

When inserting forms into the repl, the buffer doesn't always scroll to
show the new input and result. This has been fixed in CIDER in a similar
way so bringing the same trick here.

clojure-emacs/cider#2590

When inserting forms into the repl, the buffer doesn't always scroll to
show the new input and result. This has been fixed in CIDER in a similar
way so bringing the same trick here.

clojure-emacs/cider#2590
;; font-lock the inserted code
(font-lock-ensure beginning end)))
(comint-send-input t t))))
(with-selected-window (or (get-buffer-window inf-clojure-buffer)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I linked the CIDER PR that does the same thing. That points to https://stackoverflow.com/questions/13530025/emacs-scroll-automatically-when-inserting-text . If the point is not visible the (goto (point-max)) code won't actually scroll the buffer.

This change ensures that inserting into the repl will scroll the repl so you can see what you inserted and the result. Before this it only worked if the point was at the end and visible.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it - admittedly I didn't read the PRs description, only the title. :D Might be good to mention this in some comment as well.

Copy link
Contributor Author

@dpsutton dpsutton Aug 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on it! thanks! EDIT: done

@bbatsov bbatsov merged commit 59a9f06 into clojure-emacs:master Aug 7, 2022
No Sign up for free to join this conversation on GitHub. Already have an account? No Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants