syntax highlighting stops somewhere in a file -- why?

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

syntax highlighting stops somewhere in a file -- why?

meine van essen
Hi,

I use vim a lot with regular markdown --
see: daringfireball.net/projects/markdown

in several files syntax coloring suddenly stops, and I can't find why.
this happens with files while typing, as well as in files while editing
afterwards.

for example some markdown pieces of text:

[text](http://link.to/highlight_text) which makes the text clickable
in a PDF after converting the markdown file. the word between [] is in a
different color;

ë HTML codes used in markdown to provide accents etc, used a lot in
Dutch language. the code is in a different color.

my vimrc has two lines activating syntax coloring:

syntax on
syntax enable

because at least in the beginning of each file markdown syntax coloring
works fine, my 'evening' colorscheme can't be the problem.

I hope anyone can give me a clue to make syntax coloring work for the
entire file!

TIA

//meine

--
--
You received this message from the "vim_use" 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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: syntax highlighting stops somewhere in a file -- why?

Tony Mechelynck
On Mon, Oct 1, 2018 at 11:40 AM meine <[hidden email]> wrote:

>
> Hi,
>
> I use vim a lot with regular markdown --
> see: daringfireball.net/projects/markdown
>
> in several files syntax coloring suddenly stops, and I can't find why.
> this happens with files while typing, as well as in files while editing
> afterwards.
>
> for example some markdown pieces of text:
>
> [text](http://link.to/highlight_text) which makes the text clickable
> in a PDF after converting the markdown file. the word between [] is in a
> different color;
>
> &euml; HTML codes used in markdown to provide accents etc, used a lot in
> Dutch language. the code is in a different color.
>
> my vimrc has two lines activating syntax coloring:
>
> syntax on
> syntax enable
>
> because at least in the beginning of each file markdown syntax coloring
> works fine, my 'evening' colorscheme can't be the problem.
>
> I hope anyone can give me a clue to make syntax coloring work for the
> entire file!
>
> TIA
>
> //meine

See
        :help :syn-sync
        :help 'synmaxcol'
and if that doesn't help, please describe your problem in more detail.

Best regards,
Tony.

--
--
You received this message from the "vim_use" 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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: syntax highlighting stops somewhere in a file -- why?

Bram Moolenaar
In reply to this post by meine van essen

> I use vim a lot with regular markdown --
> see: daringfireball.net/projects/markdown
>
> in several files syntax coloring suddenly stops, and I can't find why.
> this happens with files while typing, as well as in files while editing
> afterwards.
>
> for example some markdown pieces of text:
>
> [text](http://link.to/highlight_text) which makes the text clickable
> in a PDF after converting the markdown file. the word between [] is in a
> different color;
>
> &euml; HTML codes used in markdown to provide accents etc, used a lot in
> Dutch language. the code is in a different color.
>
> my vimrc has two lines activating syntax coloring:
>
> syntax on
> syntax enable
>
> because at least in the beginning of each file markdown syntax coloring
> works fine, my 'evening' colorscheme can't be the problem.
>
> I hope anyone can give me a clue to make syntax coloring work for the
> entire file!

Have you tried changing the value for 'redrawtime'?  The syntax
highlighting may just be too slow.

--
hundred-and-one symptoms of being an internet addict:
126. You brag to all of your friends about your date Saturday night...but
     you don't tell them it was only in a chat room.

 /// Bram Moolenaar -- [hidden email] -- 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_use" 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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: syntax highlighting stops somewhere in a file -- why?

meine van essen
On Mon, Oct 1, 2018, Tony Mechelynck wrote:

> try syn-sync

I read the suggested documentation and tried

:set syntax fromstart

, but it made no difference for a correct syncax coloring.

On Mon, Oct 01, 2018 at 05:39:46PM +0200, Bram Moolenaar wrote:
 
> Have you tried changing the value for 'redrawtime'?  The syntax
> highlighting may just be too slow.

I put

set redrawtime=10000

in my vimrc, but it had no effect.

The file in question is of limited length, only 36 lines and 995 words.
Therefore I suspected that the correct coloring being in sync shouldn't
be the real problem, but thanks to your reactions I was able to exclude
this.

I am a relatively novice in vim and don't do much technical stuff.
Writing and editing files I only do on basic (markdown) writing and
editing pdftotext files and text copies of webpages -- both containing
lots of digraphs. Those 'leftovers' from different text formats
sometimes cause trouble in the expected coloring as is my observation.

In the file at hand I looked for unusual characters and tested the
change of coloring by copying a small block of '[text](link)', that
displayed proper coloring in the beginning of the file.

Then I found 'the Beast', it was a solitary ` mark (Digr '!).

It was the only one used on that text-saved webpage. Secondary testing
by putting a ` more to the beginning of the file 'switched off' syntax
coloring.

I couldn't find any difference in the meaning of ` and ' in vim help,
probably it has something to do with a non-closed tag.

Last and least is that especially in tty it is hard to see the diffence
between the two accents, making it harder to find the Beast anyway...

TNX again for your thoughts!

//meine

--
--
You received this message from the "vim_use" 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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: syntax highlighting stops somewhere in a file -- why?

Tony Mechelynck
On Tue, Oct 2, 2018 at 1:11 PM meine <[hidden email]> wrote:

>
> On Mon, Oct 1, 2018, Tony Mechelynck wrote:
>
> > try syn-sync
>
> I read the suggested documentation and tried
>
> :set syntax fromstart
>
> , but it made no difference for a correct syncax coloring.
>
> On Mon, Oct 01, 2018 at 05:39:46PM +0200, Bram Moolenaar wrote:
>
> > Have you tried changing the value for 'redrawtime'?  The syntax
> > highlighting may just be too slow.
>
> I put
>
> set redrawtime=10000
>
> in my vimrc, but it had no effect.
>
> The file in question is of limited length, only 36 lines and 995 words.
> Therefore I suspected that the correct coloring being in sync shouldn't
> be the real problem, but thanks to your reactions I was able to exclude
> this.
>
> I am a relatively novice in vim and don't do much technical stuff.
> Writing and editing files I only do on basic (markdown) writing and
> editing pdftotext files and text copies of webpages -- both containing
> lots of digraphs. Those 'leftovers' from different text formats
> sometimes cause trouble in the expected coloring as is my observation.
>
> In the file at hand I looked for unusual characters and tested the
> change of coloring by copying a small block of '[text](link)', that
> displayed proper coloring in the beginning of the file.
>
> Then I found 'the Beast', it was a solitary ` mark (Digr '!).
>
> It was the only one used on that text-saved webpage. Secondary testing
> by putting a ` more to the beginning of the file 'switched off' syntax
> coloring.
>
> I couldn't find any difference in the meaning of ` and ' in vim help,
> probably it has something to do with a non-closed tag.
>
> Last and least is that especially in tty it is hard to see the diffence
> between the two accents, making it harder to find the Beast anyway...
>
> TNX again for your thoughts!
>
> //meine

Vim help doesn't explain the syntax of every kind of file you might
edit with it. IIUC, by putting text between grave accents in Markdown
`like this` you make it appear in monospace: for instance in Github
comments about Vim problems, this marks inline stuff that would be
typed literally in Vim. (To make a block stand out you put three such
characters above and below it.)

OTOH manpages often use a grave accent as an opening quote and an
apostrophe as a closing quote, which is one place where unpaired, or
differently paired, such characters might be found (and unwittingly
got from, by copying and pasting).

Best regards,
Tony.

--
--
You received this message from the "vim_use" 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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: syntax highlighting stops somewhere in a file -- why?

meine van essen
> Vim help doesn't explain the syntax of every kind of file you might
> edit with it. IIUC, by putting text between grave accents in Markdown
> `like this` you make it appear in monospace: for instance in Github
> comments about Vim problems, this marks inline stuff that would be
> typed literally in Vim. (To make a block stand out you put three such
> characters above and below it.)
>
> OTOH manpages often use a grave accent as an opening quote and an
> apostrophe as a closing quote, which is one place where unpaired, or
> differently paired, such characters might be found (and unwittingly
> got from, by copying and pasting).

this solved some previous problems with my markdown files as well, when
pandoc printed some lines in monotype -- now I know the reason.

I only use the basic set of markdown as described on the daringfireball
site. there code is tagged by four spaces, one tab or a <code> tag.

the vim syntax coloring works on the extensive md-set, where other
characters can be used as formatting tag. using this extensive set
brings more formatting options as well.

-- a bit OT, but probably useful for other vimmers here...

cheers,

//meine

--
--
You received this message from the "vim_use" 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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: syntax highlighting stops somewhere in a file -- why?

meine van essen
> the vim syntax coloring works on the extensive md-set, where other
> characters can be used as formatting tag. using this extensive set
> brings more formatting options as well.

should have RTFM completely, the backticks are explained on the
daringfireball.

just found the ~~ as striketrough marker as a new one.

//meine

--
--
You received this message from the "vim_use" 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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.