branch: externals/org-transclusion
commit 4f47a15c50f6c10fe7f77e162317d2093918b04e
Author: Noboru Ota <[email protected]>
Commit: Noboru Ota <[email protected]>

    fix(fringe): removing fringe does not work #283
    
    Fixing Org buffers
---
 org-transclusion.el | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/org-transclusion.el b/org-transclusion.el
index b9bee18762..040de45a41 100644
--- a/org-transclusion.el
+++ b/org-transclusion.el
@@ -1600,19 +1600,19 @@ adds fringe-only prefix."
   "Remove fringe indicator from PREFIX string.
 Returns the cleaned prefix, or nil if prefix was only the fringe indicator."
   (when (stringp prefix)
-    (let ((cleaned prefix)
-          (pos 0))
+    (let* ((cleaned prefix)
+           (pos (length cleaned)))
       ;; Remove all fringe indicators (both graphical and terminal)
-      (while (setq pos (next-single-property-change pos nil cleaned))
+      (while (>= pos 0)
         (let ((display-prop (get-text-property pos 'display cleaned))
               (face-prop (get-text-property pos 'face cleaned)))
           (when (or (org-transclusion--fringe-spec-p display-prop)
                     (org-transclusion--fringe-spec-p face-prop))
             ;; Found a fringe indicator, remove it
             (setq cleaned (concat (substring cleaned 0 pos)
-                                  (substring cleaned (1+ pos))))
-            ;; Adjust position since we removed a character
-            (setq pos (max 0 (1- pos))))))
+                                  (substring cleaned (1+ pos)))))
+          ;; Adjust position since we removed a character
+          (setq pos (1- pos))))
       ;; Return nil if nothing left, otherwise return cleaned prefix
       (if (string-empty-p cleaned) nil cleaned))))
 

Reply via email to