How do we assign Tab key to the new Indent Line command ourselves, since you did not do that for us?
Shawn
p.s. Why are you making it so hard for emacs users to embrace your program??
On Sun, 30 Oct 2005 12:00:04 +0000 (GMT), textmate-request@lists.macromates.com wrote:
Send textmate mailing list submissions to textmate@lists.macromates.com
To subscribe or unsubscribe via the World Wide Web, visit http://lists.macromates.com/mailman/listinfo/textmate or, via email, send a message with subject or body 'help' to textmate-request@lists.macromates.com
You can reach the person managing the list at textmate-owner@lists.macromates.com
When replying, please edit your Subject line so it is more specific than "Re: Contents of textmate digest..." Today's Topics:
- IDL Bundle (Konstantinos Theofilis)
- Re: Tabulation of end tags (Andreas Wahlin)
- Printing/Print Server Problem (v665) (Tim Martens)
- No "new command" option in Bundle editor? (Charilaos Skiadas)
- Re: Tabulation of end tags (Allan Odgaard)
- Re: No "new command" option in Bundle editor? (Allan Odgaard)
- Re: Printing/Print Server Problem (v665) (Allan Odgaard)
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/mailman/listinfo/textmate
On 31/10/2005, at 3.11, Shawn Van Ittersum wrote:
How do we assign Tab key to the new Indent Line command ourselves, since you did not do that for us?
The action method (for the key bindings dictionary) is “indent:” (it's actually declared by NSResponder, though unimplemented by NSTextView).
A more flexible method is recording a macro:
1) Automation / Start Macro Recording (option-cmd M) 2) Text / Indent Line (option-cmd [) 3) Automation / Stop Macro Recording (option-cmd M) 4) Automation / Save Scratch Macro… (ctrl-cmd M)
Then give it TAB as key equivalent. Probably store it in an Emacs- compatibility bundle.
I am mentioning the macro as more flexible because this would allow you to:
a) limit the scope of the key, e.g. to source files, or source files except comments in sources (source - comment) etc., and b) because you can record further actions, you can get the indent to trigger on other keys as well, e.g. record inserting a “;” and then do the Text / Indent Line, bind that macro to the ; key (limited in scope to sources that terminate lines by a “;”) and you get the line properly indented when you type a “;” character.
p.s. Why are you making it so hard for emacs users to embrace your program??
Oh come on! I never used Emacs and I never planned for TextMate to be Emacs -- but I have made plenty of changes to TextMate only to suit Emacs users. But the role-model for behavior when it comes to TextMate is NSTextView and OS X, that should go without saying!
On Oct 30, 2005, at 20:49, Allan Odgaard wrote:
But the role-model for behavior when it comes to TextMate is NSTextView and OS X
OK, so PLEASE look at how it handles double-click-extend-selection for non-word characters! Pretty please? Pretty, pretty, pretty please?
Gerd
I'll second this request and include the solution I first offered to Allan on 9 August, so the user community can decide if it's on the right track:
I figured out what TextMate is doing wrong with regard to double-click word selection. Now that I can see what it's doing, I think the fix will be relatively easy and quick.
When the user double-clicks a character, TextMate selects the character and expands the selection to get characters of the same class (alnum, or everything else) on either side. The problem is that these two classes of characters are not enough, because the "everything else" class does not differentiate between white-space and other non-alnum characters, such as punctuation. If the user starts a double-click selection with a word, then TextMate treats any punctuation on either sides of words as white-space, which makes it impossible to select words and their prepended or trailing punctuation using the double-click technique, without selecting trailing white space and possibly more punctuation from the next word.
When determining the character class for double-click selection, there should be three classes:
- alpha-numeric (including the user-defined word characters from
Preferences) 2. white space 3. everything else (including punctuation not set as word characters)
This seems like a pretty simple change. When you detect a double-click and run the word selection routine, just check which class the clicked character belongs to, then expand each side until a character from one of the other classes is encountered.
Shawn
On Sun, 30 Oct 2005 22:55:00 -0600, Gerd Knops wrote:
On Oct 30, 2005, at 20:49, Allan Odgaard wrote:
But the role-model for behavior when it comes to TextMate is NSTextView and OS X
OK, so PLEASE look at how it handles double-click-extend-selection for non-word characters! Pretty please? Pretty, pretty, pretty please?
Gerd
Thank you, Allan, for the detailed instructions on assigning Indent Line to the tab key.
While we're on the topic of line indentation:
1. If you place the cursor at the end of a line and Shift Left, the cursor ends up at the start of the next line. This makes it very difficult to Shift Left more than once on the same line from the end of the line (which is a natural place to do it, after typing a semicolon).
2. When shifting left or right with the cursor at the start or middle of a line, the cursor position does not stay between the same characters after the shift; instead, its position stays constant relative to the start of the line. For example:
for i in array { object.method_call(| <--cursor ...oops I need to shift right... object.method_c|all(
The cursor should stay with the context it had before the shift. Keeping the absolute column position has the potential of shifting the cursor out of one scope into another. But more importantly, it's just plain disorienting to have the cursor move around relative to the text I was just typing. In the example above, I had paused before adding a method argument, and now if I continue to type the argument, I'm not in the right place anymore.
I noticed that when using the Indent Line command, the cursor position is correctly preserved relative to the text on the line. The same behavior should be used when shifting left and right.
Shawn
On Mon, 31 Oct 2005 03:49:36 +0100, Allan Odgaard wrote:
On 31/10/2005, at 3.11, Shawn Van Ittersum wrote:
How do we assign Tab key to the new Indent Line command ourselves, since you did not do that for us?
The action method (for the key bindings dictionary) is “indent:” (it's actually declared by NSResponder, though unimplemented by NSTextView).
A more flexible method is recording a macro:
- Automation / Start Macro Recording (option-cmd M)
- Text / Indent Line (option-cmd [)
- Automation / Stop Macro Recording (option-cmd M)
- Automation / Save Scratch Macro… (ctrl-cmd M)
Then give it TAB as key equivalent. Probably store it in an Emacs-compatibility bundle.
I am mentioning the macro as more flexible because this would allow you to:
a) limit the scope of the key, e.g. to source files, or source files except comments in sources (source - comment) etc., and b) because you can record further actions, you can get the indent to trigger on other keys as well, e.g. record inserting a “;” and then do the Text / Indent Line, bind that macro to the ; key (limited in scope to sources that terminate lines by a “;”) and you get the line properly indented when you type a “;” character.
p.s. Why are you making it so hard for emacs users to embrace your program??
Oh come on! I never used Emacs and I never planned for TextMate to be Emacs -- but I have made plenty of changes to TextMate only to suit Emacs users. But the role-model for behavior when it comes to TextMate is NSTextView and OS X, that should go without saying!
On 31/10/2005, at 22.51, Shawn Van Ittersum wrote:
[...] I noticed that when using the Indent Line command, the cursor position is correctly preserved relative to the text on the line. The same behavior should be used when shifting left and right.
I'm aware of the problem -- shift left/right and a lot of other actions are implemented in a declarative way, which unfortunately have some trade-offs for the end user -- it's something I have on the list of things to improve.