spellcapcheck cleared when changing buffers

8 views
Skip to first unread message

Bee

unread,
Oct 12, 2010, 2:00:24 PM10/12/10
to vim_dev
I posted a question on vim_use about spellcapcheck being cleared when
changing buffers. Gary did a test:

On 2010-10-12, Gary Johnson wrote:
> Sorry--forgot to report the version info. I tested that using
> vim-7.3 on Cygwin on Windows XP and vim-7.3.3 on RHEL4.
> Also, I retested with vim in 'nocompatible' mode with slightly
> different results in that 'spellcapcheck' retained its default value
> in the original buffer.
>
> $ vim -N -u NONE
> :verbose set spellcapcheck?
> spellcapcheck=[.?!]\_[\])'"^I ]\+
> :new
> :verbose set spellcapcheck?
> spellcapcheck=
> :wincmd w
> :verbose set spellcapcheck?
> spellcapcheck=[.?!]\_[\])'"^I ]\+

I get the same result on MacOSX 10.4.11 vim 7.3.20 and Linux vim7.3.21

Is this a bug?

Christian Brabandt

unread,
Oct 12, 2010, 3:19:58 PM10/12/10
to vim_dev
Hi Bee!

On Di, 12 Okt 2010, Bee wrote:

> On 2010-10-12, Gary Johnson wrote:
> > Sorry--forgot to report the version info. I tested that using
> > vim-7.3 on Cygwin on Windows XP and vim-7.3.3 on RHEL4.
> > Also, I retested with vim in 'nocompatible' mode with slightly
> > different results in that 'spellcapcheck' retained its default value
> > in the original buffer.
> >
> > $ vim -N -u NONE
> > :verbose set spellcapcheck?
> > spellcapcheck=[.?!]\_[\])'"^I ]\+
> > :new
> > :verbose set spellcapcheck?
> > spellcapcheck=
> > :wincmd w
> > :verbose set spellcapcheck?
> > spellcapcheck=[.?!]\_[\])'"^I ]\+
>
> I get the same result on MacOSX 10.4.11 vim 7.3.20 and Linux vim7.3.21

Here is a patch:
diff --git a/src/option.c b/src/option.c
--- a/src/option.c
+++ b/src/option.c
@@ -10031,7 +10031,7 @@
buf->b_p_smc = p_smc;
#endif
#ifdef FEAT_SPELL
- buf->b_s.b_p_spc = vim_strsave(p_spf);
+ buf->b_s.b_p_spc = vim_strsave(p_spc);
(void)compile_cap_prog(&buf->b_s);
buf->b_s.b_p_spf = vim_strsave(p_spf);
buf->b_s.b_p_spl = vim_strsave(p_spl);


regards,
Christian

Benjamin R. Haskell

unread,
Oct 12, 2010, 7:58:10 PM10/12/10
to vim_dev
On Tue, 12 Oct 2010, Christian Brabandt wrote:

> Hi Bee!
>
> [...]


>
> Here is a patch:
> diff --git a/src/option.c b/src/option.c
> --- a/src/option.c
> +++ b/src/option.c
> @@ -10031,7 +10031,7 @@
> buf->b_p_smc = p_smc;
> #endif
> #ifdef FEAT_SPELL
> - buf->b_s.b_p_spc = vim_strsave(p_spf);
> + buf->b_s.b_p_spc = vim_strsave(p_spc);
> (void)compile_cap_prog(&buf->b_s);
> buf->b_s.b_p_spf = vim_strsave(p_spf);
> buf->b_s.b_p_spl = vim_strsave(p_spl);
>
>
> regards,
> Christian

Nicely done. I'd narrowed it down to four revisions via git bisect, one
of which is the crazy "Fold Vim 7.2 default branch back to trunk to
avoid two heads." commit. The 'git diff' for it is 194,340 lines. The
error your patch corrects is on line 168,694 of that diff. (I think the
length is mainly due to hg-fast-export not really handling the merge
properly.) hg blame shows it as originally introduced when the Conceal
Patch was integrated [hg rev 1bac28a53fae]

Not pointing fingers -- just spent some time improving my bisecting
skills and felt like applauding the quick fix and reporting what I
found.

Also attaching the bisect/build script I use (to which I just added tons
of comments). Has lots of options, mainly so it can be called to just
compile Vim and keep it around, with/without bisect. It was originally
for git, but I just modified it so it will run under either git or hg.
(Detection is really simplistic -- .git dir in current directory = git,
otherwise = hg.). Requires Zsh, as it's my preferred shell, and it's
often installed anyway.

Originally found the problematic commit in this case via:

$ git checkout master
$ git bisect reset
$ /path/to/bisect-vim-spellcapcheck.zsh
(output indicated badness)
$ git bisect bad
$ git checkout v7-2-000
$ /path/to/bisect-vim-spellcapcheck.zsh
(output indicated goodness)
$ git bisect good
$ git bisect run /path/to/bisect-vim/spellcapcheck.zsh

With the hg modifications, it actually one-ups (happens to not pick any
builds with compilation problems on my machine):

$ hg purge # danger -- 'purge' wipes uncommitted changes
$ hg bisect --reset
$ hg update tip
$ /path/to/bisect-vim-spellcapcheck.zsh
(output indicated badness)
$ hg bisect -b tip
$ hg update v7-2-000
$ /path/to/bisect-vim-spellcapcheck.zsh
(output indicated goodness)
$ hg bisect -g
$ hg bisect -c /path/to/bisect-vim-spellcapcheck.zsh
(... about nine iterations ...)
The first bad revision is:
changeset: 2247:1bac28a53fae

--
Best,
Ben

bisect-vim-spellcapcheck.zsh

Bram Moolenaar

unread,
Oct 13, 2010, 8:05:55 AM10/13/10
to Christian Brabandt, vim_dev

Christian Brabandt wrote:

Ah, simple copy/paste mistake. Thanks!

--
This sentence is not sure that it exists, but if it does, it will
certainly consider the possibility that other sentences exist.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Reply all
Reply to author
Forward
0 new messages