                         (when (saw-script-output-overlay-p o)
                           (throw tag o)))
                       (error "No output at position %s" pos)))))
-      (let ((output (overlay-get o 'saw-script-output))
-            (buffer (get-buffer-create (saw-script-output-buffer-name (buffer-file-name)))))
-        (with-current-buffer buffer
-          (read-only-mode 1)
-          (let ((inhibit-read-only t))
-            (widen)
-            (erase-buffer)
-            (insert output)
-            (goto-char (point-min)))
-          (pop-to-buffer buffer))))))
+      (saw-script--view-overlay-output o))))
 
 ;;; Flycheck support
 


  ;; Setup code for output viewing
  (make-variable-buffer-local 'saw-script-output)
  )

;;;###autoload


See URL `http://saw.galois.com' for more information."
    :command ("saw" "--output-locations" source-inplace)
    :error-parser saw-script--flycheck-parse
    :modes (saw-script-mode))
  (add-to-list 'flycheck-checkers 'saw-script))
