Hi,
I'm coding lots of Obj-C++ stuff. I encountered two weird behaviours.
1) To reproduce - open a new window, set language to Obj-C++ - press ESC ⇢ nothing happens - fine - press ⇥, and then ESC ⇢ "retain" will be inserted whereby I didn't type any character
furthermore 2) - if I select something in a Obj-C++ doc and press ESC the selection will be replaced by retain
I have no idea if this is a feature or a bug but I would argue that this is a bit weird since it could happen that one presses ESC more or less accidentally. At least a selection should be untouched and ESC-completion should only be invoked if there's at least one character left from cursor as it is in TM1.
Thanks, --Hans
You might want to have a look at the latest blog post
http://blog.macromates.com/2012/clever-completion/
On 19 Jan 2012, at 10:10, Hans-Jörg Bibiko wrote:
Hi,
I'm coding lots of Obj-C++ stuff. I encountered two weird behaviours.
To reproduce
- open a new window, set language to Obj-C++
- press ESC ⇢ nothing happens - fine
- press ⇥, and then ESC ⇢ "retain" will be inserted whereby I didn't type any character
furthermore 2)
- if I select something in a Obj-C++ doc and press ESC the selection will be replaced by retain
I have no idea if this is a feature or a bug but I would argue that this is a bit weird since it could happen that one presses ESC more or less accidentally. At least a selection should be untouched and ESC-completion should only be invoked if there's at least one character left from cursor as it is in TM1.
Thanks, --Hans
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
On 19.01.2012, at 13:12, George McGinley Smith wrote:
You might want to have a look at the latest blog post
Thanks for the link :)
But now I found a workaround were this behaviour could lead to erroneous code. I performed a "Find" request which took a bit too long and pressed ESC for cancelling but nothing happened - or better TM2 reacted a bit slower than expected - thus I pressed ESC again (I know one shouldn't do this ;) ); the Find panel disappeared finally but my second ESC inserted some stuff.
Cheers, --Hans
On 19/01/2012, at 17.10, Hans-Jörg Bibiko wrote:
To reproduce
- open a new window, set language to Obj-C++
- press ESC ⇢ nothing happens - fine
- press ⇥, and then ESC ⇢ "retain" will be inserted whereby I didn't type any character
Since there is no prefix/suffix it inserts first completion candidate which is taken from the scoped settings (which provide a list for Objective-C wherein retain is included).
furthermore 2)
- if I select something in a Obj-C++ doc and press ESC the selection will be replaced by retain
I have no idea if this is a feature or a bug but I would argue that this is a bit weird since it could happen that one presses ESC more or less accidentally.
At least a selection should be untouched and ESC-completion should only be invoked if there's at least one character left from cursor as it is in TM1.
Esc-completion changed to allow empty prefix (since it also looks at suffix now).
I can make it a no-op when both prefix and suffix is empty to help users who accidentally press keys and expect nothing to happen — the argument seems a bit weird though ;) but given that the result from pressing ESC is likely unpredictable, I won’t claim it is a useful feature to always get a completion candidate inserted, although it could perhaps be if say, a custom completion command is setup say, for my unit test files or at root level in @implementation … @end to insert boilerplate for the only unit that makes sense given the context (i.e. method for the latter, unit test body for the former).