mirror of
https://github.com/correl/doom-modeline.git
synced 2024-11-27 11:09:52 +00:00
Optimize debug segment.
This commit is contained in:
parent
1a77ba0690
commit
34b23b3e25
1 changed files with 52 additions and 38 deletions
|
@ -1862,15 +1862,20 @@ mouse-3: Fetch notifications"
|
||||||
"The current debug state."
|
"The current debug state."
|
||||||
(when (doom-modeline--active)
|
(when (doom-modeline--active)
|
||||||
(concat
|
(concat
|
||||||
(and (or debug-on-error debug-on-quit
|
(when (or (and (bound-and-true-p dap-mode)
|
||||||
|
(bound-and-true-p lsp-mode)
|
||||||
|
(dap--cur-session))
|
||||||
(bound-and-true-p edebug-mode)
|
(bound-and-true-p edebug-mode)
|
||||||
(bound-and-true-p edebug-x-mode))
|
(bound-and-true-p edebug-x-mode)
|
||||||
|
debug-on-error
|
||||||
|
debug-on-quit)
|
||||||
(doom-modeline-spc))
|
(doom-modeline-spc))
|
||||||
|
|
||||||
;; For `dap-mode'
|
;; For `dap-mode'
|
||||||
(when (and (bound-and-true-p dap-mode)
|
(when (and (bound-and-true-p dap-mode)
|
||||||
(bound-and-true-p lsp-mode)
|
(bound-and-true-p lsp-mode)
|
||||||
(dap--cur-session))
|
(dap--cur-session))
|
||||||
|
(concat
|
||||||
(propertize
|
(propertize
|
||||||
(doom-modeline-debug-icon 'doom-modeline-warning)
|
(doom-modeline-debug-icon 'doom-modeline-warning)
|
||||||
'help-echo (format "DAP (%s)
|
'help-echo (format "DAP (%s)
|
||||||
|
@ -1886,11 +1891,13 @@ mouse-3: Disconnect session"
|
||||||
#'dap-debug-recent)
|
#'dap-debug-recent)
|
||||||
(define-key map [mode-line mouse-3]
|
(define-key map [mode-line mouse-3]
|
||||||
#'dap-disconnect)
|
#'dap-disconnect)
|
||||||
map)))
|
map))
|
||||||
|
(doom-modeline-vspc)))
|
||||||
|
|
||||||
;; For `edebug'
|
;; For `edebug'
|
||||||
(when (or (bound-and-true-p edebug-mode)
|
(when (or (bound-and-true-p edebug-mode)
|
||||||
(bound-and-true-p edebug-x-mode))
|
(bound-and-true-p edebug-x-mode))
|
||||||
|
(concat
|
||||||
(propertize
|
(propertize
|
||||||
(doom-modeline-debug-icon 'doom-modeline-warning)
|
(doom-modeline-debug-icon 'doom-modeline-warning)
|
||||||
'help-echo (format "EDebug (%s)
|
'help-echo (format "EDebug (%s)
|
||||||
|
@ -1906,15 +1913,18 @@ mouse-3: Stop debugging"
|
||||||
#'edebug-next-mode)
|
#'edebug-next-mode)
|
||||||
(define-key map [mode-line mouse-3]
|
(define-key map [mode-line mouse-3]
|
||||||
#'edebug-stop)
|
#'edebug-stop)
|
||||||
map)))
|
map))
|
||||||
|
(doom-modeline-vspc)))
|
||||||
|
|
||||||
;; For `debug-on-error'
|
;; For `debug-on-error'
|
||||||
(when debug-on-error
|
(when debug-on-error
|
||||||
|
(concat
|
||||||
(propertize (doom-modeline-debug-icon 'doom-modeline-urgent)
|
(propertize (doom-modeline-debug-icon 'doom-modeline-urgent)
|
||||||
'help-echo "Debug on Error
|
'help-echo "Debug on Error
|
||||||
mouse-1: Toggle Debug on Error"
|
mouse-1: Toggle Debug on Error"
|
||||||
'mouse-face '(:box 0)
|
'mouse-face '(:box 0)
|
||||||
'local-map (make-mode-line-mouse-map 'mouse-1 #'toggle-debug-on-error)))
|
'local-map (make-mode-line-mouse-map 'mouse-1 #'toggle-debug-on-error))
|
||||||
|
(doom-modeline-vspc)))
|
||||||
|
|
||||||
;; For `debug-on-quit'
|
;; For `debug-on-quit'
|
||||||
(when debug-on-quit
|
(when debug-on-quit
|
||||||
|
@ -1925,9 +1935,13 @@ mouse-1: Toggle Debug on Quit"
|
||||||
'mouse-face '(:box 0)
|
'mouse-face '(:box 0)
|
||||||
'local-map (make-mode-line-mouse-map 'mouse-1 #'toggle-debug-on-quit)))
|
'local-map (make-mode-line-mouse-map 'mouse-1 #'toggle-debug-on-quit)))
|
||||||
|
|
||||||
(and (or debug-on-error debug-on-quit
|
(when (or (and (bound-and-true-p dap-mode)
|
||||||
|
(bound-and-true-p lsp-mode)
|
||||||
|
(dap--cur-session))
|
||||||
(bound-and-true-p edebug-mode)
|
(bound-and-true-p edebug-mode)
|
||||||
(bound-and-true-p edebug-x-mode))
|
(bound-and-true-p edebug-x-mode)
|
||||||
|
debug-on-error
|
||||||
|
debug-on-quit)
|
||||||
(doom-modeline-spc)))))
|
(doom-modeline-spc)))))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue