Vim spell indentation issue

8 views
Skip to first unread message

Mohit Agarwal

unread,
Dec 9, 2022, 2:10:53 AM12/9/22
to v...@vim.org
Hi,

I've seen the following issue with Vim spell on multiple installs.
In a markdown file, the spelling error in the second line is not
recognised here:

- The quick bron fox jumps over the lazy dog. The quick bron
fox jumps over the lazy dog. The quick bron fox jumps over

But it is recognised when that line is not indented here:

- The quick bron fox jumps over the lazy dog. The quick bron
fox jumps over the lazy dog. The quick bron fox jumps over the lazy

I have tried to attatch a screenshot which shows this issue. I have no
idea what could be going on.

Mohit.
spell.png

Christian Brabandt

unread,
Dec 9, 2022, 2:59:18 AM12/9/22
to v...@vim.org
I cannot seem to reproduce this. Are you using a custom markdown syntax
plugin? Can you reproduce this starting from vim --clean?



Best
Christian
--
Ein Autor bringt sich darum nicht ganz in seinen Roman, weil [er] eine
Menge Züge von sich übriglassen muß, um sie andern Leuten darin zu
leihen.
-- Jean Paul

Karthick Gururaj

unread,
Dec 9, 2022, 3:14:38 AM12/9/22
to vim...@googlegroups.com, v...@vim.org
This seems to be because the second line gets categorized as a code
block. I checked the markdown syntax file - and this is what I see:

syn region markdownCodeBlock start=" \|\t" end="$" contained

Changing it to:

syn region markdownCodeBlock start="^\n\( \|\t\)" end="$" contained

...seems to fix the issue.

Karthick Gururaj

unread,
Dec 9, 2022, 3:17:24 AM12/9/22
to vim...@googlegroups.com, v...@vim.org
On Fri, Dec 9, 2022 at 1:29 PM Christian Brabandt <cbl...@256bit.org> wrote:
>
>
> On Mi, 07 Dez 2022, Mohit Agarwal wrote:
>
> > Hi,
> >
> > I've seen the following issue with Vim spell on multiple installs.
> > In a markdown file, the spelling error in the second line is not
> > recognised here:
> >
> > - The quick bron fox jumps over the lazy dog. The quick bron
> > fox jumps over the lazy dog. The quick bron fox jumps over
> >
> > But it is recognised when that line is not indented here:
> >
> > - The quick bron fox jumps over the lazy dog. The quick bron
> > fox jumps over the lazy dog. The quick bron fox jumps over the lazy
> >
> > I have tried to attatch a screenshot which shows this issue. I have no
> > idea what could be going on.
>
> I cannot seem to reproduce this. Are you using a custom markdown syntax
> plugin? Can you reproduce this starting from vim --clean?

Can you try with 4 (not 3) spaces at the start of the line or tab as
the leading character?

Christian Brabandt

unread,
Dec 9, 2022, 3:24:12 AM12/9/22
to vim...@googlegroups.com, v...@vim.org

On Fr, 09 Dez 2022, Karthick Gururaj wrote:

> Can you try with 4 (not 3) spaces at the start of the line or tab as
> the leading character?

Ah, I only see it with an additional empty line above it and it will
then be matched as markDownCodeBlock. Note my syntax/markdown has the
following definition:

,----
| syn region markdownCodeBlock start="^\n\( \{4,}\|\t\)" end="^\ze \{,3}\S.*$" keepend
`----

and the file is from Oct 13, 2022 as mentioned in the header.

So I would recommend to update vim or the markdown syntax file.


Best,
Christian
--
Wie sich die Gegensätze gleichen!
-- Alfred Polgar

Mohit Agarwal

unread,
Dec 11, 2022, 12:03:11 PM12/11/22
to vim...@googlegroups.com
Hi,

Changing
> syn region markdownCodeBlock start=" \|\t" end="$" contained
to
> syn region markdownCodeBlock start="^\n\( \|\t\)" end="$" contained
works well. I thought my vim was the latest, but I'll look into Christian's
comment about more recent syntax files.

Massive thanks,

Mohit.
Reply all
Reply to author
Forward
0 new messages