Dominique wrote:

> I am writing tests for spellbadword() which
> is currently not tested with arguments.
> While writing the tests, I found 2 things which
> are either bugs or I do not understand what is
> going on:
> 
> 1) The following command...
> 
> $ vim --clean -c 'set spell' -c "echo spellbadword('jupiter')"
> 
> ... shows: ['jupiter', 'bad']
> 
> But I would expect to get ['jupiter', 'caps'] since Jupiter with
> caps is a word and since :help spellbadword() says:
> 
> === BEGIN QUOTE ===
>              - The type of the spelling error:
>                         "bad"           spelling mistake
>                         "rare"          rare word
>                         "local"         word only valid in another region
>                         "caps"          word should start with Capital
> === END QUOTE ===
> 
> I can't get spellbadword() to return "caps". Is this a bug?

No, this works as intended.  You only get "caps" for a correct word that
is at the start of a sentence and is missing a starting capital.

> 2) There following command...
> 
> $ vim --clean \
>     -c 'set spell' -c "echo spellbadword('vim roks')"
> 
> ... shows: ['roks', 'bad']
> 
> Whereas:
> 
> $ vim -u DEFAULTS -U NONE -i NONE \
>     -c 'set spell' -c "echo spellbadword('vim roks')"
> 
> ... shows something different: ['vim', 'rare']
> 
> Yet ":help --clean" says:
> 
> === BEGIN QUOTE ===
> --clean         Equal to "-u DEFAULTS -U NONE -i NONE":
> === END QUOTE ===
> 
> Since I get different results, it does not look like
> --clean is equivalent to "-u DEFAULTS -U NONE -i NONE".
> And why are the results different?  As a result, I'm not able
> to write an automated test where spellbadword(...) returns
> ['...', "rare']. Yet when running interactively, spellbadword(...)
> can return 'rare' with spellbadword("vim") for example.

Yeah, --clean means something else now.  What probably matters is that
--clean omits the home directory.  I'll update the note in the help.

-- 
hundred-and-one symptoms of being an internet addict:
271. You collect hilarious signatures from all 250 mailing lists you
     are subscribed to.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui