forked from mirrors/org-mode
org-table: Fix empty field narrowing
* lisp/org-table.el (org-table--shrink-field): Fix empty field narrowing. Reported-by: Nick Helm <nick@tenpoint.co.nz> <http://lists.gnu.org/r/emacs-orgmode/2019-02/msg00214.html>
This commit is contained in:
parent
6b8fb446b6
commit
6a9e847dec
|
@ -3946,11 +3946,14 @@ already hidden."
|
||||||
start end (make-string (1+ width) ?-) "")))
|
start end (make-string (1+ width) ?-) "")))
|
||||||
((equal contents "") ;no contents to hide
|
((equal contents "") ;no contents to hide
|
||||||
(list
|
(list
|
||||||
(let ((w (org-string-width (buffer-substring start end))))
|
(let ((w (org-string-width (buffer-substring start end)))
|
||||||
(if (> width w)
|
;; We really want WIDTH + 2 whitespace, to include blanks
|
||||||
|
;; around fields.
|
||||||
|
(full (+ 2 width)))
|
||||||
|
(if (<= w full)
|
||||||
(org-table--make-shrinking-overlay
|
(org-table--make-shrinking-overlay
|
||||||
(1- end) end (make-string (- (+ width 2) w) ?\s) "")
|
(1- end) end (make-string (- full w) ?\s) "")
|
||||||
(org-table--make-shrinking-overlay (- end (- w width 1)) end "" "")))))
|
(org-table--make-shrinking-overlay (- end (- w full) 1) end "" "")))))
|
||||||
(t
|
(t
|
||||||
;; If the field is not empty, display exactly WIDTH characters.
|
;; If the field is not empty, display exactly WIDTH characters.
|
||||||
;; It can mean to partly hide the field, or extend it with virtual
|
;; It can mean to partly hide the field, or extend it with virtual
|
||||||
|
|
Loading…
Reference in New Issue