lisp/org-colview.el: Update org-columns to respect global-visual-line-mode

* lisp/org-colview.el (org-columns): Prevent enabling `truncate-lines'
when `global-visual-line-mode' is enabled.

This fixes a bug where `org-columns' overlays were disabling wrapping
of lines when `global-visual-line-mode` was already activated, and so
therefore expectation was that the lines would continue wrapping.
This is because `org-columns' was setting truncate-lines to t, when
global-visual-line-mode requires it to be set to nil. The interaction
between the two caused the wrapping not to occur.
This commit is contained in:
Nicholas Savage 2021-05-01 20:05:09 -04:00 committed by Bastien
parent 3e497bec35
commit 562e325c75
1 changed files with 2 additions and 1 deletions

View File

@ -879,7 +879,8 @@ When COLUMNS-FMT-STRING is non-nil, use it as the column format."
(unless (local-variable-p 'org-colview-initial-truncate-line-value)
(setq-local org-colview-initial-truncate-line-value
truncate-lines))
(setq truncate-lines t)
(if (not global-visual-line-mode)
(setq truncate-lines t))
(dolist (entry cache)
(goto-char (car entry))
(org-columns--display-here (cdr entry)))))))))