gcv / julia-snail

An Emacs development environment for Julia
GNU General Public License v3.0
231 stars 21 forks source link

feature request: add key binding for send line and step #105

Open ngmaclaren opened 1 year ago

ngmaclaren commented 1 year ago

In ESS[R], "C-\<return>" evaluates the current line or region and steps to the next line (the function is ess-eval-region-or-line-visibly-and-step). I use that feature a lot when I'm debugging, and I'd like to use it in julia-snail. In julia-snail, "C-c C-l" evaluates the current line, but it doesn't step. I wrote a keyboard macro to do just the evaluate line and step portion for me and put this code in my init.el:

(fset 'send-line-and-step-jl
      (kmacro-lambda-form [?\C-c ?\C-l ?\C-n] 0 "%d"))
(add-hook 'julia-mode-hook
      (lambda () (local-set-key (kbd "C-<return>") #'send-line-and-step-jl)))

Could something like this be added to julia-snail? It would be nicer if the function could evaluate regions and step to the next code line (skipping over white space and comments).

Thanks for a great resource!

johnabs commented 1 year ago

Have you considered checking out Debugger.jl and binding something there? I recently found out about it, and 100% agree that such a stepping feature being either seperate, or attached to Debugger, would be an excellent addition.

Here's a link to it, if you want to take a look :3 https://github.com/JuliaDebug/Debugger.jl

gcv commented 1 year ago

A step debugger would, indeed, be a great addition to Snail. It's entirely possible that Debugger.jl is the necessary foundation on which to build. Patches welcome. :)