branch: externals/dape
commit 2a044186a52edc2b0f81a9f9e22063b61f37f83c
Author: Daniel Pettersson <dan...@dpettersson.net>
Commit: Daniel Pettersson <dan...@dpettersson.net>

    Improve repl welcome banner
---
 dape.el | 40 +++++++++++++++++++++++++---------------
 1 file changed, 25 insertions(+), 15 deletions(-)

diff --git a/dape.el b/dape.el
index 710dfbf5d2..c7e71ff331 100644
--- a/dape.el
+++ b/dape.el
@@ -4789,21 +4789,31 @@ If EXPRESSIONS is non blank add or remove expression to 
watch list."
     (insert
      (format
       "* Welcome to the Dape REPL *
-Available Dape commands: %s
-Empty input will rerun last command.\n\n"
-      (mapconcat (pcase-lambda (`(,str . ,command))
-                   (setq str (concat str))
-                   (when dape-repl-use-shorthand
-                     (set-text-properties
-                      0 (thread-last (dape--repl-shorthand-alist)
-                                     (rassoc command)
-                                     (car)
-                                     (length))
-                      '(font-lock-face help-key-binding)
-                      str))
-                   str)
-                 dape-repl-commands
-                 ", ")))
+
+Available Dape commands:
+%s
+
+Any other input or input starting with a space is sent directly to the
+debugger.  An empty line will repeat the last command.\n\n"
+      (with-temp-buffer
+        (insert  "  "
+                 (mapconcat (pcase-lambda (`(,str . ,command))
+                              (setq str (concat str))
+                              (when dape-repl-use-shorthand
+                                (set-text-properties
+                                 0 (thread-last (dape--repl-shorthand-alist)
+                                                (rassoc command)
+                                                (car)
+                                                (length))
+                                 '(font-lock-face help-key-binding)
+                                 str))
+                              str)
+                            dape-repl-commands
+                            ", "))
+        (let ((fill-column 72)
+              (adaptive-fill-mode t))
+          (fill-region (point-min) (point-max)))
+        (buffer-string))))
     (set-marker (process-mark (get-buffer-process (current-buffer))) (point))
     (comint-output-filter (get-buffer-process (current-buffer))
                           dape--repl-prompt)))

Reply via email to