Skip to content

Including package luacode causes some legit brackets to mismatch #1958

@poetaman

Description

@poetaman

This was hard to narrow down!

Including package luacode causes some legitimate brackets to show as if they are unbalanced/unmatched/mismatched.

command

vim -u minimal.vim minimal.tex

minimal.vim

set nocompatible
let &runtimepath  = '~/.vim/plugged/vimtex,' . &runtimepath
let &runtimepath .= ',~/.vim/plugged/vimtex/after'
filetype plugin indent on
syntax enable

minimal.tex
Comment the line \usepackage{luacode} and load vim a second time to see that the problem doesn't occur if luacode is not included.

\documentclass[notitlepage,12pt]{article}
\usepackage{luacode}
\newcommand{\somecommand}{
\loop
\begingroup%
    \directlua{loopcnt=loopcnt+1}%
	\ifnum\somecount=1%
		\directlua{prevcount=prevcount+\luastring{\pgfmathresult}}%
	\else%
		\directlua{prevcount=prevcount+\luastring{\someamt}}%
	\fi%
\endgroup%
\if\someothercnt0%
\repeat%
\directlua{linecount=math.floor(prevcount)+1;}%
}

screenshot

Screen Shot 2021-02-14 at 4 07 52 PM

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions