Skip to content

Delete overlays when clearing REPL buffer #1488

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
merged 1 commit into from
Dec 27, 2015

Conversation

rfkm
Copy link
Contributor

@rfkm rfkm commented Dec 27, 2015

I've noticed that zombie overlays for ANSI coloring in the REPL buffer seem to impact its performance.

For example, evaluate the following code:

(dotimes [_ 100]
  (println "\u001b[31mfoo\u001b[0m"))

Then, type C-u C-c C-o to clear the repl buffer.

Finally, you can confirm empty overlays are still there by evaluating the following elisp code in the REPL buffer:

(length (overlays-in (point-min) (point-max))) ; => 100

In my case, the number of zombie overlays reached more than 20000 after long working and REPL buffer's response was very slow.
In this PR, I tweaked cider-repl-clear-output and cider-repl-clear-buffer to remove overlays.

@rfkm rfkm force-pushed the delete-zombie-overlays branch from c10388f to 5c6003d Compare December 27, 2015 07:10
bbatsov added a commit that referenced this pull request Dec 27, 2015
Delete overlays when clearing REPL buffer
@bbatsov bbatsov merged commit 2bff050 into clojure-emacs:master Dec 27, 2015
@bbatsov
Copy link
Member

bbatsov commented Dec 27, 2015

👍 Nice catch!

@cichli
Copy link
Member

cichli commented Dec 27, 2015

Very nice catch indeed, thanks for your recent contributions @rfkm!

@rfkm
Copy link
Contributor Author

rfkm commented Dec 27, 2015

Glad to hear that! CIDER is one of the most important OSS for me, so I'm very happy to help.
Thanks for the great project! :-)

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