Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Commit eaba940

Browse files
committed
Reported bug; avoid doubled output
1 parent aefea21 commit eaba940

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

om-to-xml.el

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,15 +200,16 @@ If no FILENAME is given, the buffer filename will be used, with
200200
(setq elem (om-parse-element-at om-point))
201201
(setq parent (plist-get (cadr elem) :parent))
202202
(setq om-point (plist-get (cadr elem) :end))
203-
(setq om-list (append om-list (list elem)))
204203
;; There are places where parsing seems to get stuck.
205204
;; For example, if a paragraph precedes the first heading
206205
;; or if the file ends with several blank lines. The
207206
;; :end doesn't advance the cursor position and this
208207
;; while loop never ends. To avoid that, we use last-point
209208
;; to force the cursor to advance.
209+
;; https://github.com/ndwarshuis/om.el/issues/8
210210
(if (<= om-point last-point)
211-
(setq om-point (1+ last-point)))
211+
(setq om-point (1+ last-point))
212+
(setq om-list (append om-list (list elem))))
212213
(setq last-point om-point)
213214
(goto-char om-point))
214215
om-list))))

0 commit comments

Comments
 (0)