Search code examples
emacsclojurecider

Superfluous scrolling in CIDER REPL when showing result


How can CIDER REPL be configured so that it only scrolls when that's necessary to show a result?

By default, CIDER REPL (0.18.0) always scrolls the point to the bottom of a window when showing a result, even when there's enough space for it.

REPL-demo

I find this jarring. I'm forced to type at the bottom of the window just to prevent "jumps." Ideally, no scrolling should occur in this example. (The point should only scroll to the bottom when a result is longer than the space below the point.)


Solution

  • It looks like this is controlled by the customization variable cider-repl-scroll-on-output:

    (defcustom cider-repl-scroll-on-output t
      "Controls whether the REPL buffer auto-scrolls on new output.
    
    When set to t (the default), if the REPL buffer contains more lines than the
    size of the window, the buffer is automatically re-centered upon completion
    of evaluating an expression, so that the bottom line of output is on the
    bottom line of the window.
    
    If this is set to nil, no re-centering takes place."
      :type 'boolean
      :group 'cider-repl
      :package-version '(cider . "0.11.0"))
    

    Try changing its value from the default t to nil.