branch: externals/org-transclusion
commit 9b8198faeb8829ef804215c32268eeda62a97d42
Author: gggion <[email protected]>
Commit: gggion <[email protected]>
fix: correct fringe placement in emacs -nw
* org-transclusion.el (org-transclusion-append-fringe-to-prefix):
Prepend fringe indicator in terminal mode instead of appending.
In graphical mode, fringe bitmaps render in the actual fringe area
regardless of position in the prefix string, so appending works fine.
In terminal mode, the ASCII fringe "| " is visible text that should
appear at the left margin before indentation, not after it.
---
org-transclusion.el | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/org-transclusion.el b/org-transclusion.el
index 588d38e012..9eb9a7c06f 100644
--- a/org-transclusion.el
+++ b/org-transclusion.el
@@ -1396,10 +1396,17 @@ fringe (face property)."
"Append fringe indicator to EXISTING-PREFIX, preserving it.
FACE determines the fringe color (org-transclusion-source-fringe or
org-transclusion-fringe).
-Returns concatenated string suitable for `line-prefix' or `wrap-prefix'."
+Returns concatenated string suitable for `line-prefix' or `wrap-prefix'.
+
+In terminal mode, prepends fringe to place it at the left margin.
+In graphical mode, appends fringe to preserve indentation alignment."
(let ((fringe-indicator (org-transclusion--make-fringe-indicator face)))
(if existing-prefix
- (concat existing-prefix fringe-indicator)
+ (if (display-graphic-p)
+ ;; Graphical: append fringe (invisible in fringe area)
+ (concat existing-prefix fringe-indicator)
+ ;; Terminal: prepend fringe to show at left margin
+ (concat fringe-indicator existing-prefix))
fringe-indicator)))
(defun org-transclusion-add-fringe-to-region (buffer beg end face)