Skip to content

Commit 5e33684

Browse files
authored
dap-ui: Fixed issue where control icon background was unspecified (#513)
This resolves #462. If a user starts `dap-debug`, dap-mode creates a set of icons used to do common debug actions (step, continue, etc). These icons are created using `propertize` to make the text that displays the images on a background. The existing setting uses the background color from the `fringe` face to set the background of the icon. The return value for the `face-attribute` function is not guaranteed to be specified. When the `:background` is unspecified, the space is made for the icons but nothing is displayed. This PR defines a face to control the background color used for the debug icons. It defaults to using the background color defined in the `fringe` face, but will inherit from the `default` face if the `:background` attribute is unspecified in `fringe`.
1 parent 0aaef4d commit 5e33684

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

dap-ui.el

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,11 @@ number - expand N levels."
151151
"Face for enabled breakpoint icon in fringe."
152152
:group 'dap-ui)
153153

154+
(defface dap-ui-controls-fringe
155+
'((t :inherit fringe))
156+
"Face used for the background of debugger icons in fringe."
157+
:group 'dap-ui)
158+
154159
(defcustom dap-ui-default-fetch-count 30
155160
"Default number of variables to load in inspect variables view for
156161
array variables."
@@ -494,7 +499,7 @@ DEBUG-SESSION is the debug session triggering the event."
494499
'display `(image :type png
495500
:file ,(f-join dap-ui--control-images-root-dir image)
496501
:ascent center
497-
:background ,(face-attribute 'fringe :background nil t))
502+
:background ,(face-attribute 'dap-ui-controls-fringe :background nil 'default))
498503
'local-map (--doto (make-sparse-keymap)
499504
(define-key it [mouse-1] command))
500505
'pointer 'hand

0 commit comments

Comments
 (0)