[TxMt] Spell checking using Google
Allan Odgaard
throw-away-1 at macromates.com
Thu May 3 11:42:52 UTC 2007
On 2. May 2007, at 10:23, Hans-Joerg Bibiko wrote:
> 1) ESC behaviour
> If I press ESC while the pull-down menu is shown it takes Google's
> first suggestion. By my opinion it's more logically that pressing
> ESC will change nothing. Thus I wrote:
> ...
> res = TextMate::UI.menu(items.flatten)
> correction = (res) ? res['string'] : org
> ...
Actually, I think escape should abort the entire thing.
> 2) \n\n problem
> There's is still the problem if the selected text contains '\n\n'
> I managed it by relpacing all \n with a non-used character
I cannot reproduce this. What text are you testing with?
> 3) Google returns only one suggestion
>> When there is only one suggestion, the command uses that, and
>> makes the word a tab-stop.
> By my opinion it would be better to show always a pull-down menu
> with the original and the suggestion. Google hasn't always right.
hmm… you can always undo. If Google is right >50% of the time, I
think always accepting, and require an undo, is better than showing a
pop-up.
> 4)
>> Personally I think the menu is generally not wanted, so that part
>> should probably be removed (and the first suggestion should always
>> be picked).
> As you mentioned the popping up of many pull-down menus is a bit
> confusing because I don't know which word is currently checked.
> But how about that way:
>
> - If a single word will be checked - same behaviour (except the
> command doesn't return a snippet; it returns it as exit_replace_text)
>
> - If a text is selected meaning at least one space is in it the
> command only returns a snippet of misspelled word without any
> changes. After that you can navigate with TAB through the snippet
> (misspelled words) and if you find a really misspelled word you can
> invoke the command again and so forth.
Yes, this is probably a desired behavior most of the time.
> 5)
> For security reason the command returns the snippet: new_str + "${0:}"
Huh?
More information about the textmate
mailing list