-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
O (open line) should place the cursor at the appropriate indentation level #4
Comments
I was thinking of attacking this myself and wondered: how are you doing introspection to discover the range of editing methods (e.g. the many methods called as strings in editor_commands.rb) in TextMate? |
Hey JRK, feel free to tackle it. In the developers file it mentions that most of textmate's text-editing methods come from the NSResponder class in Cocoa. There's unlikely a command in NSResponder which will do the trick. Assuming not, you might need to try something like sending along the tab key when a new line is opened and letting textmate do its indentation logic. |
Actually upon closer inspection, the current implementation of insert_newline_below should work in theory. Maybe we need to replace "addNewLine" with a simulated enter key so TextMate steps in and implements indentation. |
Thanks. Saw the developers file shortly after posting. Nice reference for TextMate hacking in general. I also remembered that TextMate reports most of these NSResponder methods and arguments directly for macros in the bundle editor, making macro recording a useful way to quickly experiment. Your Vim-style setup seems like an ideal model just for managing a larger library of personal macros without having to fumble with the bundle editor and custom plist files, instead just using a Ruby DSL in a dotfile. Great work so far. On Apr 6, 2011, at 3:12 PM, philc [email protected] wrote:
|
I believe the method desired in this particular case is On Apr 6, 2011, at 3:15 PM, philc wrote:
|
Ah; we have a custom implementation of insert newline in TextMateVimWindow.m, as I didn't know such a command existed:
Maybe using insertNewline instead will do the trick and properly trigger Textmate's indentation. |
Ah; we have a custom implementation of insert newline in
Maybe using insertNewline instead will do the trick and properly trigger On Wed, Apr 6, 2011 at 1:40 PM, jrk <
|
It certainly seems to within the macro system, which suggests it would in general. On Apr 6, 2011, at 4:43 PM, philc wrote:
|
Oops, didn't mean to close this issue. |
This is to match Vim's behavior, and because it's generally useful.
O with a numeric modifier (e.g. adding 10 lines) probably shouldn't indent.
The text was updated successfully, but these errors were encountered: