Sublime Forum

Send Code - go to next line behaivour


Where in the files of the Send Code package are the lines that cause the behaivour of going to next line after pressing “ctrl+enter”, can’t find them.

PS: loving the package in combination with Terminus. I was actually in the process of creating rather crude plugins that would result in similar behaivour for matlab when I found it (maybe will try adding the functionality to Code Send).



It’s the following code; the get_code method calls view.sel().subtract() to remove the current selection, then calls advance, which determines where the cursor should go and calls view.sel().add() to move it there.

Note that the selection and the cursor (aka caret) are one and the same; a bare cursor is just a selection that’s selecting no text, which is an indication that the start and end of the region it’s spanning are the same character.



Thank you for the response, slowly figuring my way around the code (much more sophisticated than what I was working with). For now I’ve taken on the task of adding matlab syntax to the package with some minor additions elsewhere.

Btw. I’m a big fan of your videos, they really sent me down the rabbit hole of writing my own plugins.