branch: externals/realgud
commit fb1d5f69e6d6b75e30fd8b4c6105d7d9a456da82
Author: yangyingchao <[email protected]>
Commit: yangyingchao <[email protected]>
Fix wrong cursor location for gdb source buffers
When error happends, column-number is 0, and (forward-char -1) moves the
cursor back to previous line...
This closes #325
---
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