 (defun fstar-subp--start-syntax-check (_checker callback)
   "Start a light syntax check; pass results to CALLBACK."
   (if (fstar-subp--can-run-flycheck)
-      (let ((beg (fstar-subp-unprocessed-beginning))
-            (end (fstar-subp--next-unprocessed-start 3))) ;; FIXME customize number
-        (if (< beg end)
+      (let ((beg (fstar-subp--untracked-beginning-position))
+            (end (fstar-subp--find-point-to-process 3))) ;; FIXME customize number
+        (if (and (numberp end) (< beg end))
             (fstar-subp-peek-region
              beg end 'lax ;; FIXME make configurable
              (apply-partially #'fstar-subp--flycheck-continuation callback))

into blocks; process it as one large block instead."
  (interactive "P")
  (fstar-subp-start)
  (let ((limit (fstar-subp-unprocessed-beginning)))
    (cond
     ((<= (point) limit) (fstar-subp-retract-until (point)))
     ((>  (point) limit) (if (consp arg)
                             (fstar-subp-enqueue-until (point))
                           (fstar-subp-advance-until (point)))))))

(defun fstar-subp-advance-or-retract-to-point-lax (&optional arg)
  "Like `fstar-subp-advance-or-retract-to-point' with ARG, in lax mode."

(flycheck-define-generic-checker 'fstar-interactive
  "Flycheck checker for F*'s interactive mode.
This checker uses the F* subprocess to do light real-time
checking of the first few chunks of the untracked region of the
buffer."
  :start #'fstar-subp--start-syntax-check
  :modes '(fstar-mode)
