Christian Brabandt wrote:

> On Di, 31 Jul 2012, Ingo Karkat wrote:
> 
> > On 31-Jul-2012 21:31:24 +0200, Ben Fritz wrote:
> > > On Tuesday, July 31, 2012 1:04:21 PM UTC-5, Ingo Karkat wrote:
> > >> On 31-Jul-2012 18:56:21 +0200, Ben Fritz wrote:
> > >>
> > >>> On Tuesday, July 31, 2012 3:52:06 AM UTC-5, James  Cole wrote:
> > >>>> [...] I know it'd be possible to write a map to do this, but it seems
> > >>>> like it'd be a sensible default behavior for z=
> > >>>>
> > >>>> [4 lines deleted]
> > >>>
> > >>> How about:
> > >>>
> > >>> nnoremap z= :<C-U>set spell<CR>z=
> > >>>
> > >>> And probably another mapping to turn off spell check if you want it.
> > >>>
> > >>> Alternatively, you could just change the highlight to be less
> > >>> distracting, using :hi rules on SpellBad, SpellCap, SpellRare, and
> > >>> SpellLocal.
> > >>
> > >> Have you read his actual email? James explicitly referred to the
> > >> shortcomings of such a mapping. I second James' request, especially
> > >> because I have written such a mapping for myself, and it isn't
> > >> trivial (have to handle empty 'spelllang' and other settings that
> > >> prevent spell checking, turning off 'spell' again after the user
> > >> interaction requires an autocmd, ...)
> > >>
> > >> -- regards, ingo
> > > 
> > > I see "I know it'd be possible to write a map to do this, but it seems
> > > like it'd be a sensible default behavior for z=" but don't see a
> > > discussion of the shortcomings.
> > 
> > I think the key part that you missed is automatically turning off the
> > spell checking / highlighting after z=. Your proposed mapping doesn't
> > even attempt that. Having to invoke a second mapping to turn this off
> > is very cumbersome, and not what James had in mind.
> > 
> > > However, I can agree that it would be a useful feature to not
> > > require such a mapping.
> > 
> > Right. Especially because it's difficult to write a mapping around
> > something that requires user interaction, like the query of the spell
> > correction candidate in z=.
> 
> 
> Does this patch work for you?

I wonder if there are any side effects of doing it this way.  E.g., if
someone accidentally does z=, is any redrawing different, syntax HL,
etc.?  I suppose it's inefficient, but that would be less important.


-- 
hundred-and-one symptoms of being an internet addict:
217. Your sex life has drastically improved...so what if it's only cyber-sex!

 /// 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

Raspunde prin e-mail lui