Make use of rectangle-preview custom variable.

lisp/rect.el (rectangle--string-preview): Only create a preview if
rectangle-preview is non-nil (Bug#23248).
This commit is contained in:
Mark Oteiza 2016-04-16 12:02:49 -04:00
parent aa0d83a727
commit 0f332848cd

View file

@ -408,6 +408,7 @@ With a prefix (or a FILL) argument, also fill too short lines."
:type 'boolean)
(defun rectangle--string-preview ()
(when rectangle-preview
(let ((str (minibuffer-contents)))
(when (equal str "")
(setq str (or (car-safe minibuffer-default)
@ -441,7 +442,7 @@ With a prefix (or a FILL) argument, also fill too short lines."
(overlay-put ol 'display str)
(if as (overlay-put ol 'after-string as))))))
(nth 1 rectangle--string-preview-state)
(nth 2 rectangle--string-preview-state))))))
(nth 2 rectangle--string-preview-state)))))))
;; FIXME: Should this be turned into inhibit-region-highlight and made to apply
;; to non-rectangular regions as well?