branch: externals/realgud
commit dd8909a5312f4352d7dd9d26e16496c1ac8fcb09
Author: Crane Chu <[email protected]>
Commit: Crane Chu <[email protected]>

    add key 'h' for cmd-until-here: continue until the current line
---
 realgud/common/cmds.el     | 8 ++++++++
 realgud/common/key.el      | 3 ++-
 realgud/common/shortkey.el | 2 ++
 3 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/realgud/common/cmds.el b/realgud/common/cmds.el
index 0f20535..a46f3bc 100644
--- a/realgud/common/cmds.el
+++ b/realgud/common/cmds.el
@@ -112,6 +112,7 @@ with other motion initiated by debugger messages."
     (puthash "step"        "step %p" hash)
     (puthash "tbreak"      "tbreak %X:%l" hash)
     (puthash "until"       "until" hash)
+    (puthash "until-here"  "until %l" hash)    
     (puthash "up"          "up %p" hash)
     hash)
   "Default hash of command name → debugger command.
@@ -188,6 +189,13 @@ With prefix argument LINE-NUMBER, prompt for line number."
   (realgud:cmd--with-line-override line-number
                                    (realgud:cmd-run-command line-number 
"tbreak")))
 
+(defun realgud:cmd-until-here (&optional line-number)
+  "Continue until the current line. 
+With prefix argument LINE-NUMBER, prompt for line number."
+  (interactive (realgud:cmd--line-number-from-prefix-arg))
+  (realgud:cmd--with-line-override line-number
+                                   (realgud:cmd-run-command line-number 
"until-here")))
+
 (defun realgud:cmd-clear(&optional line-number)
   "Delete breakpoint at the current line.
 With prefix argument LINE-NUMBER, prompt for line number."
diff --git a/realgud/common/key.el b/realgud/common/key.el
index bb5ed7c..783afb9 100644
--- a/realgud/common/key.el
+++ b/realgud/common/key.el
@@ -122,7 +122,8 @@ Nor does it touch prefix keys; for that see 
`realgud-populate-keys-standard'"
     (define-key map "Q" 'realgud:cmd-terminate)
     (define-key map "S" 'realgud-window-src-undisturb-cmd)
     (define-key map "U" 'realgud:cmd-until)
-
+    (define-key map "h" 'realgud:cmd-until-here)
+    
     (define-key map [M-down]    'realgud-track-hist-newer)
     (define-key map [M-kp-2]    'realgud-track-hist-newer)
     (define-key map [M-up]      'realgud-track-hist-older)
diff --git a/realgud/common/shortkey.el b/realgud/common/shortkey.el
index 3483eed..b017372 100644
--- a/realgud/common/shortkey.el
+++ b/realgud/common/shortkey.el
@@ -67,6 +67,8 @@
     (define-key map "e"        'realgud:cmd-eval-dwim)
     (define-key map "E"        'realgud:cmd-eval-at-point)
     (define-key map "U"        'realgud:cmd-until)
+    (define-key map "h"        'realgud:cmd-until-here)
+    
     (define-key map [mouse-2]  'realgud:tooltip-eval)
     (define-key map [left-fringe mouse-1] #'realgud-cmds--mouse-add-remove-bp)
     (define-key map [left-margin mouse-1] #'realgud-cmds--mouse-add-remove-bp)

Reply via email to