A curiosity with vimrc_example.vim, html, and spell

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

A curiosity with vimrc_example.vim, html, and spell

Dave Roberts
Latest VIM7 (WinXP):

File containing only:
<html>
<body bgcolor=#FFB290>
</body>
</html>

.vimrc containing only:
runtime vimrc_example.vim

Name the file TEST.TXT and run:
setl spell spelllang=en

Spell checking works (assuming of course that you have the English spell
files)

Name the file TEST.HTM or TEST.HTML and run the same command

Spell checking doesn't work.

I don't think the contents of the file matter, that's just what I used.

Also, I renamed my VIMFiles\after, plugin, and ftplugin directories to
make sure it wasn't something in there.

If I put everything back the way it was (original .vimrc and directory
names correctly spelled) and then comment out the 'runtime
vimrc_example.vim' line then spell checking works in the .HTM(L) file
but I get the following message on startup:

Error detected while processing C:\PKG\vim\menu.vim:
line  401:
E329: No menu of that name

Thanks,

- Dave

Reply | Threaded
Open this post in threaded view
|

Re: A curiosity with vimrc_example.vim, html, and spell

Bram Moolenaar

Dave Roberts wrote:

> Latest VIM7 (WinXP):
>
> File containing only:
> <html>
> <body bgcolor=#FFB290>
> </body>
> </html>
>
> .vimrc containing only:
> runtime vimrc_example.vim
>
> Name the file TEST.TXT and run:
> setl spell spelllang=en
>
> Spell checking works (assuming of course that you have the English spell
> files)
>
> Name the file TEST.HTM or TEST.HTML and run the same command
>
> Spell checking doesn't work.
>
> I don't think the contents of the file matter, that's just what I used.

The HTML syntax file defines regions where spell checking is done.  It
excludes the HTML tags, for good reasons.  But the @Spell cluster isn't
used properly, the text at the top level isn't spell checked.  It does
work if you put something in <b> badword </b>.

Try removing the "@Spell" items from runtime/syntax/html.vim.  Now to
many things are spell-checked, thus @NoSpell should be added for these
items.

> Also, I renamed my VIMFiles\after, plugin, and ftplugin directories to
> make sure it wasn't something in there.
>
> If I put everything back the way it was (original .vimrc and directory
> names correctly spelled) and then comment out the 'runtime
> vimrc_example.vim' line then spell checking works in the .HTM(L) file

That must be because syntax HL is disabled.

> but I get the following message on startup:
>
> Error detected while processing C:\PKG\vim\menu.vim:
> line  401:
> E329: No menu of that name

Strange, the menu was defined in the line just above it.  I can't
reproduce this error.

--
hundred-and-one symptoms of being an internet addict:
243. You unsuccessfully try to download a pizza from www.dominos.com.

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
 \\\     Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html   ///
Reply | Threaded
Open this post in threaded view
|

Re: A curiosity with vimrc_example.vim, html, and spell

Dave Roberts
Bram Moolenaar wrote:

>Dave Roberts wrote:
>
>  
>
>>Latest VIM7 (WinXP):
>>
>>File containing only:
>><html>
>><body bgcolor=#FFB290>
>></body>
>></html>
>>
>>.vimrc containing only:
>>runtime vimrc_example.vim
>>
>>Name the file TEST.TXT and run:
>>setl spell spelllang=en
>>
>>Spell checking works (assuming of course that you have the English spell
>>files)
>>
>>Name the file TEST.HTM or TEST.HTML and run the same command
>>
>>Spell checking doesn't work.
>>
>>I don't think the contents of the file matter, that's just what I used.
>>    
>>
>
>The HTML syntax file defines regions where spell checking is done.  It
>excludes the HTML tags, for good reasons.  But the @Spell cluster isn't
>used properly, the text at the top level isn't spell checked.  It does
>work if you put something in <b> badword </b>.
>
>Try removing the "@Spell" items from runtime/syntax/html.vim.  Now to
>many things are spell-checked, thus @NoSpell should be added for these
>items.
>  
>

OK, I see that but why then does this happen:

Create test.htm containing the single line:
Thiss is <b>bolld</b> and this is noot
(or add the head/body begin/end tags as well - doesn't matter)

Do:
gvim -u NONE -U NONE test.htm
:syntax on
:setl spell spelllang=en

What you get is 'bolld' is highlighted as black on black (so you can't
see the letters) and 'Thiss' and 'noot' are ignored.

It's obviously still something to do with syntax highlightling because
the same file renamed to test.txt catches all three bad spellings and
they're all visible.

>  
>
>>Also, I renamed my VIMFiles\after, plugin, and ftplugin directories to
>>make sure it wasn't something in there.
>>
>>If I put everything back the way it was (original .vimrc and directory
>>names correctly spelled) and then comment out the 'runtime
>>vimrc_example.vim' line then spell checking works in the .HTM(L) file
>>    
>>
>
>That must be because syntax HL is disabled.
>  
>

Yep.

>  
>
>>but I get the following message on startup:
>>
>>Error detected while processing C:\PKG\vim\menu.vim:
>>line  401:
>>E329: No menu of that name
>>    
>>
>
>Strange, the menu was defined in the line just above it.  I can't
>reproduce this error.
>
>  
>
Sorry.  That one was caused by a file called tagsmenu.vim in my plugin
directory. Don't know where I got it and never use it so just removed it.

Thanks,

- Dave