Skip to content

Commit

Permalink
prevent infinite loop
Browse files Browse the repository at this point in the history
When `dante-eval-block` finds a comment at the beginning of the file, it previously entered an infinite loop.  See Issue jyp#182 for a full description of the problem and code blocks to illustrate the issue and fix.
  • Loading branch information
eppolito authored Nov 27, 2024
1 parent ca47f8c commit c72c319
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dante.el
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ The command block is indicated by the >>> symbol."
;; ensure that there is a newline at the end of buffer
(when (eq (point) (point-max)) (newline))
(point-marker))))
(while (looking-at "[ \t]*--") (forward-line -1))
(while (and (looking-at "[ \t]*--") (forward-line -1)))
(forward-line)
(lcr-spawn
(lcr-call dante-async-load-current-buffer t nil)
Expand Down

0 comments on commit c72c319

Please sign in to comment.