           ;;       You need DeriveFunctor to derive an instance for this class
           ;;       Try GeneralizedNewtypeDeriving for GHC's newtype-deriving extension
           ;;       In the newtype declaration for ‘X’
-          (while (string-match extension-regex text start)
-            (setq note t)
-            (add-to-list 'intero-suggestions
-                         (list :type 'add-extension
-                               :extension (match-string 0 text)))
-            (setq start (min (length text) (1+ (match-end 0)))))
+          (let ((start 0))
+            (while (string-match extension-regex text start)
+              (setq note t)
+              (add-to-list 'intero-suggestions
+                           (list :type 'add-extension
+                                 :extension (match-string 0 text)))
+              (setq start (min (length text) (1+ (match-end 0))))))
           ;; Messages of this format:
           ;;
           ;; The import of ‘Control.Monad’ is redundant

                                      (plist-get suggestion :typo)
                                      "’ with ‘"
                                      (plist-get suggestion :replacement)
                                      "’ ("
                                      (plist-get suggestion :replacement-src)
                                      ")")
                       :default t))))
            intero-suggestions)))))
    (if (null to-apply)
        (message "No changes selected to apply.")

                               :line (flycheck-error-line msg))))
          ;; Messages of this format:
          ;;
          ;; Not in scope: ‘putStrn’
          ;; Perhaps you meant one of these:
          ;;   ‘putStr’ (imported from Prelude),
          ;;   ‘putStrLn’ (imported from Prelude)
          ;;
          ;; Or this format:
          ;;
          ;; error:
          ;;    • Variable not in scope: lopSetup :: [Statement Exp']
          ;;    • Perhaps you meant ‘loopSetup’ (line 437)
          (when (string-match
                 "Not in scope: [‘`‛]\\([^'’]+\\)['’]\n.*Perhaps you meant"
                 text)
            (let ((typo (match-string 1 text))
                  (start (min (length text) (1+ (match-end 0)))))
              (while (string-match quoted-symbol-regex text start)
                (setq note t)
                (add-to-list 'intero-suggestions
                             (list :type 'fix-typo
                                   :typo typo
                                   :replacement (match-string 1 text)
                                   :column (flycheck-error-column msg)
                                   :line (flycheck-error-line msg)))
                (setq start (min (length text) (1+ (match-end 0)))))))
          ;; Add a note if we found a suggestion to make
          (when note
            (setf (flycheck-error-message msg)
