                      (point-max))))
       buffer)))
 
-(defun +eval-open-repl (prompt-p &optional other-window-p)
-  (let ((command (cdr (assq major-mode +eval-repls))))
+(defun +eval-open-repl (prompt-p &optional displayfn)
+  (let ((command (cdr (assq major-mode +eval-repls)))
+        (region (if (use-region-p)
+                    (buffer-substring-no-properties (region-beginning)
+                                                    (region-end)))))
     (when (or (not command) prompt-p)
       (let* ((choices (or (cl-loop for sym being the symbols
                                    for sym-name = (symbol-name sym)

                         repl))))))
    (unless (commandp command)
      (error "Couldn't find a valid REPL for %s" major-mode))
    (when (+eval--ensure-in-repl-buffer command other-window-p)
      (when (bound-and-true-p evil-mode)
        (call-interactively #'evil-append-line))
      t)))

;;;###autoload


If ARG (universal argument), prompt for a specific REPL to open."
  (interactive "P")
  (+eval-open-repl arg #'switch-to-buffer))

;;;###autoload
(defun +eval/open-repl-other-window (&optional arg)
