Skip to content

Ensure repl scrolls on insert - #204

Merged
bbatsov merged 3 commits into
clojure-emacs:masterfrom
dpsutton:scroll-repl-on-insert
Aug 7, 2022
Merged

bbatsov merged 3 commits into
clojure-emacs:masterfrom
dpsutton:scroll-repl-on-insert

Conversation

@dpsutton

@dpsutton dpsutton commented Aug 6, 2022

Copy link
Copy Markdown
Contributor

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
Comment thread inf-clojure.el
;; 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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

@dpsutton dpsutton Aug 7, 2022

Copy link
Copy Markdown
Contributor Author

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
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.

2 participants