lalitmetkar / vim

Automatically exported from code.google.com/p/vim
0 stars 0 forks source link

":set spell spelllang=en" acts strangely after ":ownsyntax txt" #78

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
":set spell spelllang=en" acts strangely after ":ownsyntax txt":
either no spelling check is done, or the incorrect dictionary is used for 
highlighting unknown words.

What steps will reproduce the problem?
1. Start Vim with "vim -u NONE"
2. Enter Ex commands:

 :syntax on
 :help
 :set spell spelllang=en  (OK: Vim correctly highlights unknown words in help window)
 :split
 :ownsyntax txt  (WRONG: Vim no longer highlights unknown words in top help window)
 :set spell spelllang=fr  (WRONG: still no unknown words highlighted in top help windows!?)
 :set spell spelllang=en  (WRONG: now French dictionary is used in top help window instead of English for highligthting typos!?)
 :set spell spelllang=fr  (WRONG: now English dictionary is used in top window, instead of French for highlighting typos!?)

What is the expected output? What do you see instead?

See comments in above steps.
I would expect that ":set spell spelllang=en" works and use the English 
dictionary after ":ownsyntax txt"

What version of the product are you using? On what operating system?

Vim-7.3.629 (huge) on Linux x86 (xubuntu-12.04)

Original issue reported on code.google.com by dominiqu...@gmail.com on 12 Aug 2012 at 6:03

GoogleCodeExporter commented 9 years ago
Posted patch here: 
https://groups.google.com/d/msg/vim_dev/257N4jWJz-8/oJnMtEZvkDwJ

Original comment by chrisbr...@googlemail.com on 8 Oct 2014 at 9:05

GoogleCodeExporter commented 9 years ago
This should be fixed by patch 7.4.524.  Please verify, it's a bit different 
from Christian's patch.

Original comment by brammool...@gmail.com on 19 Nov 2014 at 6:34

GoogleCodeExporter commented 9 years ago
This did not fix the following case:

gvim -u NONE -N

Insert some text:

    foo bar baz

:syntax on
:set spell spelllang=en  (OK: Vim correctly highlights "foo" and "baz")
:ownsyntax foo  (OK: Vim resets 'spell'; no words are highlighted)
:syntax clear
:set syntax=vim  (This step is optional)
:set spell spelllang=en  (WRONG: 'spell' is set, but "foo" and "baz" are not 
highlighted.)

The "syntax clear" step is the important part. After that, "set spell" does not 
highlight words until after switching to another buffer and then switching back.

Original comment by jke...@connectwise.com on 4 May 2015 at 10:58

GoogleCodeExporter commented 9 years ago
Will this be re-opened? Should I create a new issue? The GitHub repo does not 
have issues enabled.

Original comment by jke...@connectwise.com on 6 May 2015 at 8:43

GoogleCodeExporter commented 9 years ago
I don't understand the problem:

1) ownsyntax foo does implicitly clear the syntax so no need for :syn clear
2) without :set syntax=vim the errors will immediatly highlighted as errors (as 
expected)
3) When doing :set syntax=vim no spelling errors will be highlighted. That 
might be related to the vim syntax file but that doesn't look like it is 
related to the :ownsyntax command (interestingly :syn spell toplevel does not 
work)
4) Using :set syntax=c it will work as exptected (when also using :syn spell 
toplevel), not sure, why it doesn't work with Vim syntax file
5) If e.g. you use the example text:
" foo bar baz 
it should also simply work, when following your steps.

so I tend to not consider this as a bug.

Original comment by chrisbr...@googlemail.com on 7 May 2015 at 9:56

GoogleCodeExporter commented 9 years ago
It turns out `:syntax clear` is not required to reproduce.

Here are reduced steps (Windows gvim 7.4.618):

gvim -u NONE -N

Insert text:
    foo bar baz

:syntax on
:set spell spelllang=en
:ownsyntax foo
:set syntax=c
:set spell spelllang=en

Wrong words are not highlighted. Are they highlighted for you, after those 
steps?

Original comment by jke...@connectwise.com on 7 May 2015 at 10:14