changeset 65859:398b39fb5c3f

(gdb-fringe-width): New variable. (gdb-ann3): Set it. (gdb-put-breakpoint-icon): Don't take fringe-width from speedbar frame.
author Nick Roberts <nickrob@snap.net.nz>
date Thu, 06 Oct 2005 03:42:24 +0000
parents 6a0d43003c2b
children 85eb38c15a8f
files lisp/progmodes/gdb-ui.el
diffstat 1 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/gdb-ui.el	Thu Oct 06 03:41:32 2005 +0000
+++ b/lisp/progmodes/gdb-ui.el	Thu Oct 06 03:42:24 2005 +0000
@@ -103,6 +103,7 @@
 (defvar gdb-error "Non-nil when GDB is reporting an error.")
 (defvar gdb-macro-info nil
   "Non-nil if GDB knows that the inferior includes preprocessor macro info.")
+(defvar gdb-fringe-width nil)
 
 (defvar gdb-buffer-type nil
   "One of the symbols bound in `gdb-buffer-rules'.")
@@ -377,7 +378,8 @@
 	gdb-location-alist nil
 	gdb-find-file-unhook nil
 	gdb-error nil
-	gdb-macro-info nil)
+	gdb-macro-info nil
+	gdb-buffer-fringe-width (car (window-fringes)))
   ;;
   (setq gdb-buffer-type 'gdba)
   ;;
@@ -2470,7 +2472,8 @@
 (defun gdb-put-breakpoint-icon (enabled bptno)
   (let ((start (- (line-beginning-position) 1))
 	(end (+ (line-end-position) 1))
-	(putstring (if enabled "B" "b")))
+	(putstring (if enabled "B" "b"))
+	(source-window (get-buffer-window (current-buffer) 0)))
     (add-text-properties
      0 1 '(help-echo "mouse-1: set/clear bkpt, mouse-3: enable/disable bkpt")
      putstring)
@@ -2480,7 +2483,9 @@
        0 1 `(gdb-bptno ,bptno gdb-enabled nil) putstring))
     (gdb-remove-breakpoint-icons start end)
     (if (display-images-p)
-	(if (>= (car (window-fringes)) 8)
+	(if (>= (or left-fringe-width
+		   (if source-window (car (window-fringes source-window)))
+		   gdb-buffer-fringe-width) 8)
 	    (gdb-put-string
 	     nil (1+ start)
 	     `(left-fringe breakpoint
@@ -2490,9 +2495,9 @@
 	  (when (< left-margin-width 2)
 	    (save-current-buffer
 	      (setq left-margin-width 2)
-	      (if (get-buffer-window (current-buffer) 0)
+	      (if source-window
 		  (set-window-margins
-		   (get-buffer-window (current-buffer) 0)
+		   source-window
 		   left-margin-width right-margin-width))))
 	  (put-image
 	   (if enabled