Handle empty input in +debugger-completing-read
This commit is contained in:
parent
8c33866b21
commit
cf3d9eb6e0
1 changed files with 18 additions and 15 deletions
|
@ -50,9 +50,12 @@ infromation."
|
||||||
(+debugger-list-for-dap)
|
(+debugger-list-for-dap)
|
||||||
(+debugger-list-for-realgud)))
|
(+debugger-list-for-realgud)))
|
||||||
(result (--map (cons (cadr it) it) configurations))
|
(result (--map (cons (cadr it) it) configurations))
|
||||||
(completion (completing-read "Start debugger: " (-map 'car result) nil t ))
|
(completion (completing-read "Start debugger: " (-map 'car result) nil t)))
|
||||||
(configuration (cdr (assoc completion result))))
|
(if (eq completion "")
|
||||||
|
(user-error "No debugging configuration specified.")
|
||||||
|
(let ((configuration (cdr (assoc completion result))))
|
||||||
(if (eq (car configuration) 'dap)
|
(if (eq (car configuration) 'dap)
|
||||||
|
;; get dap debugging arguments
|
||||||
(let* ((debug-args (-> (cdr configuration)
|
(let* ((debug-args (-> (cdr configuration)
|
||||||
cl-rest
|
cl-rest
|
||||||
copy-tree
|
copy-tree
|
||||||
|
@ -64,7 +67,7 @@ infromation."
|
||||||
(or (plist-get debug-args :type)
|
(or (plist-get debug-args :type)
|
||||||
(user-error "%s does not specify :type" debug-args))))))
|
(user-error "%s does not specify :type" debug-args))))))
|
||||||
(cons 'dap launch-args))
|
(cons 'dap launch-args))
|
||||||
(cons 'realgud (intern (cadr configuration))))))
|
(cons 'realgud (intern (cadr configuration))))))))
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;;; Interactive commands
|
;;; Interactive commands
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue