Function: magit-make-margin-overlay

magit-make-margin-overlay is a byte-compiled function defined in magit-margin.el.

Signature

(magit-make-margin-overlay &optional STRING (PREVIOUS-LINE nil SLINE))

Documentation

Display STRING in the margin of the previous (or current) line.

If point is at the beginning of a line, set the margin string for the previous line, otherwise for the current line. Semi-obsolete optional PREVIOUS-LINE can be used to explicitly specify which line is affected.

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-margin.el
(cl-defun magit-make-margin-overlay (&optional string (previous-line nil sline))
  "Display STRING in the margin of the previous (or current) line.
If point is at the beginning of a line, set the margin string for
the previous line, otherwise for the current line.  Semi-obsolete
optional PREVIOUS-LINE can be used to explicitly specify which
line is affected."
  (save-excursion
    (forward-line (if (if sline previous-line (bolp)) -1 0))
    ;; Don't put the overlay on the complete line to work around #1880.
    (let ((o (make-overlay (1+ (point)) (line-end-position) nil t)))
      (overlay-put o 'evaporate t)
      (overlay-put o 'before-string
                   (propertize "o" 'display
                               (list (list 'margin 'right-margin)
                                     (or string " ")))))))