I would like to add a little separation between some lines of code for readibility. Consider this MWE:
\documentclass{article}
\usepackage{minted}
\begin{document}
\begin{minted}[linenos]{python}
foo(1)
bar(1)
foofoo(1)
foobar(1)
\end{minted}
\end{document}
The produced output of course looks like
1 foo(1)
2 bar(1)
3 foobar(1)
4 foobaz(1)
What I would want to see is
1 foo(1)
2 bar(1)
3 foobar(1)
4 foobaz(1)
(With not necessarily an entire line’s spacing between lines 2 and 3, but some extra space.)
I first tried to use the minted options [escapeinside=] and \\[2ex], but it did nothing. I mean the \\ was recognized as a TeX command, since it did not show in the output, but no 2ex spacing was added.
I then stumbled upon David’s (brilliantly engineered ☺) answer here, but that solution still increments the line counter on the next line.
\renewcommand\theFancyVerbLine{%
\ifnum\value{FancyVerbLine}=3
\setcounter{FancyVerbLine}3
\else
{\scriptsize\arabic{FancyVerbLine}}
\fi
}
I cannot do \setcounter{FancyVerbLine}2 as that would cause an infinite loop, setting each line number to 2 starting from the 3rd line and not printing anything.

\newif\ifthreeocunted\threecountedfalseand then doing\ifthreecounted\arabic{FancyVerbLine}\else\setcounter{FancyVerbLine}2\threecountedtruein the\ifnum...block, but something is still missing. Line numbers are only printed up to 2. – bp99 Oct 24 '21 at 21:51