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

    Set margin on each breakpoint addition
    
    Hopefully solve #220
---
 dape.el | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/dape.el b/dape.el
index bc7103f64b..f8e2791351 100644
--- a/dape.el
+++ b/dape.el
@@ -3067,7 +3067,7 @@ Used as an hook on `find-file-hook'."
              (run-hooks 'dape-update-ui-hook)))
   (dape--breakpoint-maybe-remove-ff-hook))
 
-(defvar dape--original-margin nil
+(defvar-local dape--original-margin nil
   "Bookkeeping for buffer margin width.")
 
 (defun dape--indicator (string bitmap face)
@@ -3076,11 +3076,10 @@ The indicator is `propertize'd with with FACE."
   (if (and (window-system)
            (not (eql (frame-parameter (selected-frame) 'left-fringe) 0)))
       (propertize " " 'display `(left-fringe ,bitmap ,face))
-    (unless dape--original-margin
-      (setq-local dape--original-margin left-margin-width
-                  left-margin-width 2)
-      (set-window-margins (selected-window)
-                          left-margin-width right-margin-width))
+    (setq-local dape--original-margin (or dape--original-margin
+                                          left-margin-width)
+                left-margin-width 2)
+    (set-window-margins (selected-window) left-margin-width)
     (propertize " " 'display `((margin left-margin)
                                ,(propertize string 'face face)))))
 

Reply via email to