Skip to content

Unicode with superscripts breaks syntax highlighting #184

Open
@SuperFluffy

Description

@SuperFluffy

In the examples below I show that unicode characters (the alpha) seem to interfere badly with syntax highlighting. It seems like, vim-pandoc-syntax struggles with combinations like $x^{a}_{b}$, when x is a unicode character. Interestingly, reversing the order, $x_{b}^{a}$ seems to work. Also, when x is just an ASCII character, it seems to work as well.

In the example, the last line will break all successive highlighting. In vim in particular, the effect is the last _ gets concealed and the i italicized.

Ascii works: $a^i_i$.
Ascii with braced superscript works: $a^{i}_i$.
Ascii with braced subscript works: $a^i_{i}$.
Ascii with braced scripts works: $a^{i}_{i}$.

Unicode works: $α^i_i$. 
Unicode with subscript first works: $α_i^i$. 
Unicode with subscript first and braced subscript works: $α_{i}^i$. 
Unicode with subscript first and braced superscript works: $α_i^{i}$. 
Unicode with subscript first and braced scripts works: $α_{i}^{i}$. 

Unicode with braced superscript breaks: $α^{i}_i$.

EDIT: I have experimented some more, and to be honest, I am confused what is causing this. It doesn't look like braces affect this. It seems to be an interaction with unicode, but I cannot always reproduce this. When I change this:

$a^i_i$
$a^{i}_i$
$a^i_{i}$
$a^{i}_{i}$

to (notice the alpha):

$α^i_i$
$a^{i}_i$
$a^i_{i}$
$a^{i}_{i}$

I notice that all syntax highlighting is broken. In particular, on my vim, all the ^ in all $a^ are highlighted white, whereas with α^ the ^ will not be highlighted and all successive lines break.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions