Variable: treemacs-recenter-distance

treemacs-recenter-distance is a customizable variable defined in treemacs-customization.el.

Value

0.1

Documentation

Minimum distance from a window's top/bottom for treemacs to call recenter.

This value will apply when any one of the following options is set to on-distance:

 * treemacs-recenter-after-tag-follow
 * treemacs-recenter-after-file-follow
 * treemacs-recenter-after-project-jump
 * treemacs-recenter-after-project-expand

In that case a call to recenter will be made when the distance between point and the top/bottom of the treemacs window is less then this many lines. The value is not an absolute line count, but a relative floating-point percentage, with 0.0 being 0% and 1.0 being 100%. This means that, for example, when this variable is set to 0.1 recenter will be called within a 10% distance of the treemacs window's top/bottom. For a window height of 40 lines that means point being within the first or last 4 lines of the treemacs window.

Note that this does *not* take scroll-margin into account.

Source Code

;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs-customization.el
(defcustom treemacs-recenter-distance 0.1
  "Minimum distance from a window's top/bottom for treemacs to call `recenter'.
This value will apply when any one of the following options is set to
`on-distance':

 * treemacs-recenter-after-tag-follow
 * treemacs-recenter-after-file-follow
 * treemacs-recenter-after-project-jump
 * treemacs-recenter-after-project-expand

In that case a call to `recenter' will be made when the distance between point
and the top/bottom of the treemacs window is less then this many lines.  The
value is not an absolute line count, but a relative floating-point percentage,
with 0.0 being 0% and 1.0 being 100%.
This means that, for example, when this variable is set to 0.1 `recenter' will
be called within a 10% distance of the treemacs window's top/bottom.  For a
window height of 40 lines that means point being within the first or last 4
lines of the treemacs window.

Note that this does *not* take `scroll-margin' into account."
  :type 'float
  :group 'treemacs)