Hi,
Word completion seems to look for matching words on the document from the cursor point and up, and then, from the cursor down. It's often the case, however, that the matching word you need is right on the next line, or even later in the same line, and it takes a lot of ESC-pressing to get to it.
My suggestion is that you sort them by proximity (as it is now), but look for words in both directions, so the words right in the next line stand a better chance.
(I had the impression that back in 1.0 it worked that way. Did it?)
On 6 Sep 2005, at 03:18, Caio Chassot wrote:
My suggestion is that you sort them by proximity (as it is now), but look for words in both directions, so the words right in the next line stand a better chance.
That would be most excellent. In addition, it'd be really nice if TextMate had the option to look in other files in the project -- for example, the completion of a function from another file.
The utterly uber-cool feature would be if the project-wide completion was scope sensitive...
On Sep 6, 2005, at 5:04 AM, Graeme Mathieson wrote:
On 6 Sep 2005, at 03:18, Caio Chassot wrote:
My suggestion is that you sort them by proximity (as it is now), but look for words in both directions, so the words right in the next line stand a better chance.
That would be most excellent. In addition, it'd be really nice if TextMate had the option to look in other files in the project -- for example, the completion of a function from another file.
I have wanted this since TextMate was first introduced. It's probably my top wish to have!
That would be most excellent. In addition, it'd be really nice if TextMate had the option to look in other files in the project -- for example, the completion of a function from another file.
I have wanted this since TextMate was first introduced. It's probably my top wish to have!
I think I want it too, though not so badly, but there's a downside to it: you begin getting too many options. I had this problem with jedit all the time.
But if we make a trimmed list, with only the more common or long-named methods, not, for example, the entire ruby library, it'll certainly be helpful.
On 06/09/2005, at 11.04, Graeme Mathieson wrote:
My suggestion is that you sort them by proximity (as it is now), but look for words in both directions, so the words right in the next line stand a better chance.
That would be most excellent. In addition, it'd be really nice if TextMate had the option to look in other files in the project -- for example, the completion of a function from another file.
The utterly uber-cool feature would be if the project-wide completion was scope sensitive...
You can actually overload the completion for different scopes.
Here's the example from the release notes (a preferences item in the bundle editor):
completionCommand = 'php -r '$a = get_defined_functions(); print_r(implode("\n", $a["internal"]));'|grep "^$TM_CURRENT_WORD"| sort'; disableDefaultCompletion = 1;
This disables the default suggestions, and instead completes based on PHP's list of build-in functions. You'd set the scope for this to source.php -- but you can also set it to a more restrictive scope.
To search *.cc files in current files directory, you could do something like:
completionCommand = 'cd "$TM_DIRECTORY"; cat *.cc|tr -cs "[:alpha:]_" "\n"|grep "^$TM_CURRENT_WORD."|sort|uniq';
On 06/09/2005, at 4.18, Caio Chassot wrote:
My suggestion is that you sort them by proximity (as it is now), but look for words in both directions, so the words right in the next line stand a better chance.
I have changed it now so that it does does mix in the word after the caret, with those in front (loosely based on proximity) -- watch my appcast :)
I made all words on the right side of the caret have lower ranking than those on the left side, since often I use the complete with a single letter, because the word is earlier on the line, and I don't want to loose this 100% predictability, even when there is stuff to the right of the caret.
I'm just wondering with all this stuff on autocompletion; do people really move their hands from the "alphabetic" keys, to reach up and hit escape, rather than just type out the whole word, or is there some more efficient way? Speaking of which, it would be really nice with automatic word completion with a drop down list that appears after a preference set number of seconds.
Andreas
On Sep 7, 2005, at 21:35 , Allan Odgaard wrote:
On 06/09/2005, at 4.18, Caio Chassot wrote:
My suggestion is that you sort them by proximity (as it is now), but look for words in both directions, so the words right in the next line stand a better chance.
I have changed it now so that it does does mix in the word after the caret, with those in front (loosely based on proximity) -- watch my appcast :)
I made all words on the right side of the caret have lower ranking than those on the left side, since often I use the complete with a single letter, because the word is earlier on the line, and I don't want to loose this 100% predictability, even when there is stuff to the right of the caret.
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On 07/09/2005, at 22.28, Andreas Wahlin wrote:
I'm just wondering with all this stuff on autocompletion; do people really move their hands from the "alphabetic" keys, to reach up and hit escape, rather than just type out the whole word
When that hole word is something like NSMutableDictionary or stringByDeletingLastPathComponent, sure, I use escape! :)
Andreas,
I've assigned different keybindings to Next/Previous Completion which are very close to "home base". I'm using Dvorak, but on a qwerty keyboard the commands would be positioned as ctrl-i and ctrl-o (with the caps lock as ctrl). I use TextMate for ConTeXt, so its mostly completion of largish words that I've used recently, as the "ctrl-i" position counts for me as just one keystroke. Very quick.
David
On Sep 7, 2005, at 1:28 PM, Andreas Wahlin wrote:
I'm just wondering with all this stuff on autocompletion; do people really move their hands from the "alphabetic" keys, to reach up and hit escape, rather than just type out the whole word, or is there some more efficient way? Speaking of which, it would be really nice with automatic word completion with a drop down list that appears after a preference set number of seconds.
Andreas
I have changed it now so that it does does mix in the word after the caret, with those in front (loosely based on proximity) -- watch my appcast :)
I've been using this new version for a few days now and it's highly unpredictable. Can you reveal what algorithm you're using?
What I had in mind was prioritizing matches like this:
-0 +0 -1 +1 -2 +2
Where - indicates before the caret, and + after, and the number is the number of lines offset from the current line. Within those groups you just order by position in the line.
On 10/09/2005, at 23.22, Caio Chassot wrote:
I have changed it now so that it does does mix in the word after the caret, with those in front (loosely based on proximity) -- watch my appcast :)
I've been using this new version for a few days now and it's highly unpredictable. Can you reveal what algorithm you're using?
Seems it was a little broken :) I'd switched the meaning of a high/ low rank but forgot to change a max to a min, so when a word had multiple candidates, the instance the farthest away from the caret would count.
But it still doesen't autocomplete from the entire project? Will this happen (if not)?
Andreas
On Sep 11, 2005, at 0:33 , Allan Odgaard wrote:
On 10/09/2005, at 23.22, Caio Chassot wrote:
I have changed it now so that it does does mix in the word after the caret, with those in front (loosely based on proximity) -- watch my appcast :)
I've been using this new version for a few days now and it's highly unpredictable. Can you reveal what algorithm you're using?
Seems it was a little broken :) I'd switched the meaning of a high/ low rank but forgot to change a max to a min, so when a word had multiple candidates, the instance the farthest away from the caret would count.
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On 11/09/2005, at 11.07, Andreas Wahlin wrote:
But it still doesen't autocomplete from the entire project? Will this happen (if not)?
I never said it would, or write that in the release notes -- and it's not something I'm going to change anytime soon.
As written here: http://lists.macromates.com/pipermail/textmate/2005-September/ 005382.html
You can already overload the completion to do more global completion.