[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dape 2f416b6dc3 4/8: Make expression and log breakpoint
From: |
ELPA Syncer |
Subject: |
[elpa] externals/dape 2f416b6dc3 4/8: Make expression and log breakpoint clickable |
Date: |
Tue, 16 Jan 2024 15:57:39 -0500 (EST) |
branch: externals/dape
commit 2f416b6dc3d4ea0e6379cde67f84ba2422824d41
Author: Daniel Pettersson <daniel@dpettersson.net>
Commit: Daniel Pettersson <daniel@dpettersson.net>
Make expression and log breakpoint clickable
---
dape.el | 62 ++++++++++++++++++++++++++++++++++++++++++++------------------
1 file changed, 44 insertions(+), 18 deletions(-)
diff --git a/dape.el b/dape.el
index 6c2afada1e..4c44f53064 100644
--- a/dape.el
+++ b/dape.el
@@ -531,14 +531,17 @@ The hook is run with one argument, the compilation
buffer."
;;; Face
+(defface dape-breakpoint-face
+ '((t :inherit (font-lock-keyword-face)))
+ "Face used to display breakpoint overlays.")
(defface dape-log-face
- '((t :inherit (font-lock-doc-face)
+ '((t :inherit (font-lock-string-face)
:height 0.85 :box (:line-width -1)))
"Face used to display log breakpoints.")
(defface dape-expression-face
- '((t :inherit (font-lock-warning-face)
+ '((t :inherit (dape-breakpoint-face)
:height 0.85 :box (:line-width -1)))
"Face used to display conditional breakpoints.")
@@ -546,10 +549,6 @@ The hook is run with one argument, the compilation buffer."
'((t :inherit (error tooltip)))
"Face used to display exception descriptions inline.")
-(defface dape-breakpoint-face
- '((t :inherit (font-lock-keyword-face)))
- "Face used to display breakpoint overlays.")
-
(defface dape-stack-trace
'((t :extend t))
"Face used to display stack trace overlays.")
@@ -2260,20 +2259,47 @@ If EXPRESSION place conditional breakpoint."
(cond
(log-message
(overlay-put breakpoint 'dape-log-message log-message)
- ;; TODO Add keybinds for removal and change of log message
- (overlay-put breakpoint 'after-string (concat
- " "
- (propertize
- (format "Log: %s" log-message)
- 'face 'dape-log-face))))
+ (overlay-put breakpoint 'after-string
+ (concat
+ " "
+ (propertize (format "Log: %s" log-message)
+ 'face 'dape-log-face
+ 'mouse-face 'highlight
+ 'help-echo "mouse-1: edit log message"
+ 'keymap
+ (let ((map (make-sparse-keymap)))
+ (define-key map [mouse-1]
+ (lambda (event)
+ (interactive "e")
+ (save-selected-window
+ (let ((start (event-start
event)))
+ (select-window
(posn-window start))
+ (save-excursion
+ (goto-char (posn-point
start))
+ (call-interactively
'dape-breakpoint-log))))))
+ map)))))
(expression
(overlay-put breakpoint 'dape-expr-message expression)
- ;; TODO Add keybinds for removal and change of expression message
- (overlay-put breakpoint 'after-string (concat
- " "
- (propertize
- (format "Break: %s" expression)
- 'face 'dape-expression-face))))
+ (overlay-put breakpoint 'after-string
+ (concat
+ " "
+ (propertize
+ (format "Break: %s" expression)
+ 'face 'dape-expression-face
+ 'mouse-face 'highlight
+ 'help-echo "mouse-1: edit break expression"
+ 'keymap
+ (let ((map (make-sparse-keymap)))
+ (define-key map [mouse-1]
+ (lambda (event)
+ (interactive "e")
+ (save-selected-window
+ (let ((start (event-start event)))
+ (select-window (posn-window start))
+ (save-excursion
+ (goto-char (posn-point start))
+ (call-interactively
'dape-breakpoint-expression))))))
+ map)))))
(t
(overlay-put breakpoint 'dape-breakpoint t)
(dape--overlay-icon breakpoint
- [elpa] externals/dape updated (b9d0579cd2 -> 848ba37797), ELPA Syncer, 2024/01/16
- [elpa] externals/dape a3113e072f 1/8: Include connection type in repl error message, ELPA Syncer, 2024/01/16
- [elpa] externals/dape 848ba37797 8/8: Remove :autoport from hint as it's probably just confusing, ELPA Syncer, 2024/01/16
- [elpa] externals/dape 46c725d327 2/8: Improve usability of evaluate, ELPA Syncer, 2024/01/16
- [elpa] externals/dape 328f7a923c 6/8: Remove js-debugs dependency on command-cwd for nicer hints, ELPA Syncer, 2024/01/16
- [elpa] externals/dape 24bfaea5ad 5/8: Add generic configs for generic launching generic adapters, ELPA Syncer, 2024/01/16
- [elpa] externals/dape baf9a1d630 3/8: Update shell modes display action to play nice with which-key, ELPA Syncer, 2024/01/16
- [elpa] externals/dape 49e6c302ac 7/8: Remove dap-mode recommendation in the README, ELPA Syncer, 2024/01/16
- [elpa] externals/dape 2f416b6dc3 4/8: Make expression and log breakpoint clickable,
ELPA Syncer <=