Skip to content

Commit 24a6774

Browse files
authored
Don't hang when the beginning of the error can't be found
Tools that interfere with rustc output can cause the line to be prefixed (see DioxusLabs/dioxus#4547), which can cause the line never to be found, and the loop to continue until the user presses C-g
1 parent 9915b3a commit 24a6774

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rust-compile.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ the compilation window until the top of the error is visible."
7575
(let ((start-of-error
7676
(save-excursion
7777
(beginning-of-line)
78-
(while (not (looking-at "^[a-z]+:\\|^[a-z]+\\[E[0-9]+\\]:"))
79-
(forward-line -1))
78+
(while (and (not (looking-at "^[a-z]+:\\|^[a-z]+\\[E[0-9]+\\]:"))
79+
(equal (forward-line -1) 0)))
8080
(point))))
8181
(set-window-start (selected-window) start-of-error))))))
8282

0 commit comments

Comments
 (0)