spacefrogg-overlay/factor-lang/fuel-dont-jump-to-using.patch

41 lines
1.4 KiB
Diff
Raw Normal View History

2020-12-06 13:31:05 +01:00
diff --git a/misc/fuel/fuel-debug.el b/misc/fuel/fuel-debug.el
index 7f9dc3ea41..0ee277ede8 100644
--- a/misc/fuel/fuel-debug.el
+++ b/misc/fuel/fuel-debug.el
@@ -308,20 +308,21 @@ the debugger."
(defun fuel-debug--replace-usings (file uses)
(pop-to-buffer (find-file-noselect file))
- (goto-char (point-min))
- (if (re-search-forward "^USING: " nil t)
- (let ((begin (point))
- (end (or (and (re-search-forward ";\\( \\|$\\)") (point))
- (point))))
- (kill-region begin end))
- (re-search-forward "^IN: " nil t)
- (beginning-of-line)
- (open-line 2)
- (insert "USING: "))
- (let ((start (point))
- (tokens (append uses '(";"))))
- (insert (mapconcat 'substring-no-properties tokens " "))
- (fill-region start (point) nil)))
+ (save-excursion
+ (goto-char (point-min))
+ (if (re-search-forward "^USING: " nil t)
+ (let ((begin (point))
+ (end (or (and (re-search-forward ";\\( \\|$\\)") (point))
+ (point))))
+ (kill-region begin end))
+ (re-search-forward "^IN: " nil t)
+ (beginning-of-line)
+ (open-line 2)
+ (insert "USING: "))
+ (let ((start (point))
+ (tokens (append uses '(";"))))
+ (insert (mapconcat 'substring-no-properties tokens " "))
+ (fill-region start (point) nil))))
(defun fuel-debug-update-usings ()
(interactive)