Hannah-Sten / TeXiFy-IDEA

LaTeX support for the IntelliJ platform by JetBrains.
https://hannah-sten.github.io/TeXiFy-IDEA
MIT License
876 stars 86 forks source link

`\left(` inserts incorrect paired brace #3493

Open jojo2357 opened 3 months ago

jojo2357 commented 3 months ago

In a math environment, doing \left( should, imo, automatically insert \right) rather than )

IE \left<carret> -> type ( -> \left(<caret>) expected \left<carret> -> type ( -> \left(<caret>\right)

PHPirates commented 3 months ago

I agree but on the condition that we can ensure the \right) is only inserted if the ) is inserted, so if there is no matching ) already present, for example \left<caret> (...) \right)

jojo2357 commented 1 month ago

That did not fix my issue.

My test, characterized by:

$\left<caret> $

typing (

expected:

$\left(<caret>\right) $

actual:

$\left(<caret>) $

the unit test described above can be characterized below:

fun testCorrectPairedBrace() {
    myFixture.configureByText(LatexFileType, """$\left<caret>$""")
    myFixture.type('(')
    myFixture.checkResult("""$\left(<caret>\right)$""")
}

Is not fixed by c20606a. #3562 did fix a fun bug, but not this issue.

Please reopen/

PHPirates commented 1 month ago

Thanks, closed this by mistake