Variable: display-line-numbers-width-start

display-line-numbers-width-start is a customizable variable defined in display-line-numbers.el.gz.

Value

nil

Documentation

If non-nil, count number of lines to use for line number width.

When display-line-numbers-mode(var)/display-line-numbers-mode(fun) is turned on, if this option is non-nil, display-line-numbers-width is set up front to a width necessary to display all line numbers in the buffer. If the value is a positive number, it is interpreted as extra lines to account for when computing the required width; this should be set to the number of lines in the tallest window in which you want to prevent the line-number width from changing.

This variable was added, or its default value changed, in Emacs 28.1.

Source Code

;; Defined in /usr/src/emacs/lisp/display-line-numbers.el.gz
(defcustom display-line-numbers-width-start nil
  "If non-nil, count number of lines to use for line number width.
When `display-line-numbers-mode' is turned on, if this option is
non-nil, `display-line-numbers-width' is set up front to a width
necessary to display all line numbers in the buffer.  If the value
is a positive number, it is interpreted as extra lines to account
for when computing the required width; this should be set to the
number of lines in the tallest window in which you want to prevent
the line-number width from changing."
  :group 'display-line-numbers
  :type '(choice (boolean :tag "Minimum width for buffer's line count")
                 (integer :tag "Number of extra lines to account for"))
  :version "28.1")