branch: externals/realgud
commit fe1d6eab69375c704c6861125fa1f4d0d758a5e8
Merge: 5fb027b628 fb1d5f69e6
Author: R. Bernstein <[email protected]>
Commit: GitHub <[email protected]>

    Merge pull request #326 from yangyingchao/master
    
    Fix wrong cursor location for gdb source buffers
---
 realgud/common/file.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/realgud/common/file.el b/realgud/common/file.el
index 3b3eb3e409..26377c7d58 100644
--- a/realgud/common/file.el
+++ b/realgud/common/file.el
@@ -210,9 +210,10 @@ problem as best as we can determine."
                               (with-current-buffer source-buffer
                                 (goto-char (point-min))
                                 (forward-line (1- line-number))
-                                (if (and column-number
-                                         (numberp column-number))
-                                    (forward-char (1- column-number)))
+                                (when (and column-number
+                                           (numberp column-number)
+                                           (> column-number 0))
+                                  (forward-char (1- column-number)))
                                 ;; FIXME also allow byte offset.
                                 (make-realgud-loc
                                  :num bp-num

Reply via email to