org-agenda-show-new-time: Fix when window is very narrow

* lisp/org-agenda.el (org-agenda-show-new-time): When window is
narrower than timestamp, do not try to display timestamps starting at
negative column.

Reported-by: Nick Römer <nick.romer@skynet.be>
Link: https://orgmode.org/list/4196e86e.19136.1891ceef131.Webtop.154@skynet.be
This commit is contained in:
Ihor Radchenko 2023-07-04 19:34:41 +03:00
parent 402f72ad4f
commit 7c6302e203
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 4 additions and 2 deletions

View File

@ -10100,8 +10100,10 @@ When called programmatically, FORCE-DIRECTION can be `set', `up',
(line-end-position)
'(display nil))
(org-move-to-column
(- (window-max-chars-per-line)
(length stamp))
(max
1 ;; narrow buffer and wide timestamp
(- (window-max-chars-per-line)
(length stamp)))
t)
(add-text-properties
(1- (point)) (line-end-position)