aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-27 19:25:42 -0500
committerCraig Jennings <c@cjennings.net>2026-05-27 19:25:42 -0500
commit822e7a3798d431910eeff677ae751eff8b48731a (patch)
tree17f96c5bf5b0566d5d651a3e57a7978ff878a539 /tests
parenta6157f471c9d64c00f0a2e33224e373864a7ae80 (diff)
downloaddotemacs-822e7a3798d431910eeff677ae751eff8b48731a.tar.gz
dotemacs-822e7a3798d431910eeff677ae751eff8b48731a.zip
fix(org): stop folded property-drawer headings wrapping their tag indicators
A folded heading that also has a property drawer renders two glyphs after its right-aligned tag: the org-tidy inline dot (" ·") and the fold ellipsis (" ▾"). The tag-align reserve was 5 columns, and that " · ▾" spilled onto a second screen row, leaving a stray indicator line under the heading. The trailing glyphs measure 4 columns nominally, so the old 5-column reserve looked like it should fit. It didn't: the fallback triangle renders wider than its reported width and the :align-to stretch rounds, so the real overflow exceeds the column count. I sized the new reserve (9) from a rendered measurement, not arithmetic, and the docstring now says so and tells the next reader to verify by screenshot. That mismatch between column math and what actually renders is what let the earlier reserve ship broken. I verified the fix by rendering the real config off-screen at full width and reading the result: before, the two folded property-drawer headings wrapped "· ▾" to a second row; after, every heading is a single line. tests/manual/headline-wrap/ holds the fixture and a README so the check can be repeated by opening the file and looking, which is the only honest way to test a redisplay bug like this.
Diffstat (limited to 'tests')
-rw-r--r--tests/manual/headline-wrap/README.org41
-rw-r--r--tests/manual/headline-wrap/fixture.org28
2 files changed, 69 insertions, 0 deletions
diff --git a/tests/manual/headline-wrap/README.org b/tests/manual/headline-wrap/README.org
new file mode 100644
index 00000000..dbd16a7e
--- /dev/null
+++ b/tests/manual/headline-wrap/README.org
@@ -0,0 +1,41 @@
+#+TITLE: Headline-indicator wrap — manual render check
+
+* What this guards
+
+Org headline tags are right-aligned to the window edge by a font-lock display
+property (see =cj/org-right-align-tags-keyword= in =modules/org-config.el=).
+After the tag, a folded heading that also has a property drawer renders two
+extra glyphs: the org-tidy inline symbol (" ·") and the fold ellipsis
+(=org-ellipsis=, " ▾"). =cj/org-tag-right-margin= reserves columns between the
+tag and the edge so those glyphs stay on the heading line.
+
+If the reserve is too small, the trailing " · ▾" wraps onto a second screen
+row, leaving a stray indicator line under the heading. This is a redisplay
+bug: the column arithmetic can say the glyphs fit while they visibly wrap (the
+fallback triangle renders wider than its reported width, and the =:align-to=
+stretch rounds). So it must be checked by rendering and looking, never by
+column math.
+
+* How to check
+
+1. Open =fixture.org= in this directory with the full config:
+
+ #+begin_src bash
+ emacs tests/manual/headline-wrap/fixture.org
+ #+end_src
+
+2. The =#+STARTUP: content= line folds every heading on open, so the folded
+ property-drawer headings show their " ·" and " ▾" indicators.
+
+3. Look at each =**= heading. Every one must sit on a single screen row, with
+ its tag and any trailing " ·" / " ▾" all on the heading line.
+
+ - Expected: four single-line headings, no stray indicator wrapped below any
+ of them.
+ - Regression: the first two headings (folded, with property drawers) show
+ "· ▾" wrapped onto the line beneath them.
+
+* If it regresses
+
+Raise =cj/org-tag-right-margin= in =modules/org-config.el=, reload, and re-check
+here. Confirm by the render above, not by recomputing column widths.
diff --git a/tests/manual/headline-wrap/fixture.org b/tests/manual/headline-wrap/fixture.org
new file mode 100644
index 00000000..9b4ae617
--- /dev/null
+++ b/tests/manual/headline-wrap/fixture.org
@@ -0,0 +1,28 @@
+#+TITLE: Headline-indicator wrap fixture
+#+STARTUP: content
+
+# Regression fixture for the right-aligned-tag wrap bug. A folded heading that
+# also has a property drawer renders two trailing indicators after its tag: the
+# org-tidy inline symbol (" ·") and the fold ellipsis (" ▾"). If the tag-align
+# reserve (cj/org-tag-right-margin in modules/org-config.el) is too small, those
+# indicators spill onto a second screen row. Open this file, confirm every
+# heading below stays on a single line. See README.org for steps.
+
+* Open Work
+** TODO [#B] Interactive sort/order changes for the agenda view :feature:
+:PROPERTIES:
+:ID: one
+:END:
+Body text under the first heading so the subtree folds with an ellipsis.
+** TODO [#C] Pager robustness: null customView and missing end-cursor :bug:discuss:
+:PROPERTIES:
+:ID: two
+:END:
+Body text under the second heading.
+** TODO [#B] GitHub Actions CI :chore:
+:PROPERTIES:
+:ID: three
+:END:
+Body text under the third heading.
+** TODO [#D] No property drawer here so org-tidy adds no dot :feature:
+Body under a heading that has no properties drawer.