I have next problem:
I can't compile code after I copied and paste it in editor, because dashes on the left side of picture are not the same as on the right.
but if I replace "−" to "−" it will work fine (surprisingly, dashes were pasted here are both correct) here You can find main source https://github.com/AnMnv/eBook (page 9)
Couse to paste here MWE is just useless, because all dashed pasted correctly on this site, so I would be very grateful if You can follow the link above open eBook.pdf and try to copy example 4.10 from page 9 into Your editor.
And if You want to see the error message:

MWE:
\documentclass{article}
\usepackage{scrextend}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[russian,english]{babel}
\usepackage[table]{xcolor}
\usepackage{nicematrix}
\NiceMatrixOptions{cell-space-top-limit=5pt,cell-space-bottom-limit=5pt}
\usepackage{listings}
\lstset{
basicstyle=\ttfamily,
columns=fullflexible,
frame=single,
breaklines=true,
postbreak=\mbox{\textcolor{red}{$\hookrightarrow$}\space},
}
\newcommand\realnumberstyle[1]{}
\makeatletter
\newcommand{\zebra}[3]{%
{\realnumberstyle{#3}}%
\begingroup
\lst@basicstyle
\ifodd\value{lstnumber}%
\color{#1}%
\else
\color{#2}%
\fi
\rlap{\hspace*{\lst@numbersep}%
\color@block{\linewidth}{\ht\strutbox}{\dp\strutbox}%
}%
\endgroup
}
\makeatother
\begin{document}
\begin{tabular}{c | c}
\begin{minipage}[m]{0.4\textwidth}
\begin{NiceTabular}{|c|c|c|}
\hline
\cellcolor{red}1& \cellcolor{green}1 & \cellcolor{black!10}EVERY\\hline
\cellcolor{orange}1 & \cellcolor{red!35}1 & \cellcolor{brown!50}CELL \ \hline
\cellcolor{green!35}1 & \cellcolor{blue!45}1 & \cellcolor{yellow}CENTERED \ \hline
\end{NiceTabular}
\end{minipage}
&
\begin{minipage}[m]{0.55\textwidth}
\begin{lstlisting}[numberstyle=\zebra{green!15}{yellow!15},numbers=left,basicstyle=\footnotesize]
\documentclass{article}
\usepackage[table]{xcolor}
\usepackage{nicematrix}
\NiceMatrixOptions{cell-space-top-limit=5pt,cell-space-bottom-limit=5pt}
\begin{document}
\begin{table}[htbp]
\centering
\begin{NiceTabular}{|c|c|c|}
\hline
\cellcolor{red}1& \cellcolor{green}1 & \cellcolor{black!10}1 \ \hline
\cellcolor{orange}1 & \cellcolor{red!35}1 & \cellcolor{brown!50}1 \ \hline
\cellcolor{green!35}1 & \cellcolor{blue!45}1 & \cellcolor{yellow}1 \ \hline
\end{NiceTabular}
\end{table}
\end{document}
\end{lstlisting}
\end{minipage}
\end{tabular}
\end{document}
Thanks in advance.


but if I replace "−" to "−"both dashes are minus signs U+2212 not the ascii hyphen-that you need in key names – David Carlisle Dec 20 '21 at 21:48but if I replace "−" to "−"already shows the problem, they are minus signs, −, not hyphens, - and the problem is unrelated to cut and paste as it is clearly visible in your pdf output. the listings or minted or whatever you are using to typeset the code is typesetting a keyaaa-bbbasaaa−bbbpresumably as it is misusing math mode somewhere so you could make a small complete test file that typesets one latex code listing using keys of that form that we can debug, – David Carlisle Dec 20 '21 at 22:00a-bin text mode you will get a hyphen that will cut and paste as-if you typeseta-bin math mode you will get a minus sign that probably cuts and pastes as − if you provided an example someone would say why you are getting minus signs in your output. – David Carlisle Dec 20 '21 at 22:03