geany-plugins icon indicating copy to clipboard operation
geany-plugins copied to clipboard

LaTeX plugin: Keyboard shurtcuts for itemize and enumerate generate wrong result

Open zeitgenosse opened this issue 3 years ago • 3 comments

If a assign a keyboard shortcut for generatin an itemize or enumerate environment, the result is

\begin{itemize}
  \it
\end{itemize}em

where the correct output should be

\begin{itemize}
  \item 
\end{itemize}

Steps to reproduce:

  • Assign some keyboard shortcut for itemize (or enumerate).
  • Press that combination of keys.

My version of Geany is 1.33 (the one shipped with recent Debian-ish distributions), the LaTeX plugin version is 0.7.

zeitgenosse avatar Mar 13 '21 19:03 zeitgenosse

LaTeX v0.7, Geany 1.36 (Ubuntu)

  • menu:Preferences > Keybindings > LaTeX > Insert Itemize List => Ctrl+Alt+M
  • menu:File > New
  • menu:Document > Set Filetype > Markup Languages > LaTeX source file
  • in the new document: Ctrl+Alt+M

Result:

\begin{itemize}
	\item 
\end{itemize}

nomadbyte avatar Apr 11 '21 04:04 nomadbyte

AFAICT nothing has changed in Latex plugin in that area since forever, looks like something in the OPs system, just in case ping @frlan

elextr avatar Apr 11 '21 04:04 elextr

Sorry for the late reaction ;)

To be honest I have not even an idea what might cause that issue. This function is actually done by building up a string

if (type == GLATEX_ENVIRONMENT_TYPE_LIST)
{
g_string_append(tmpstring, "\t\\item ");
}

and than later

GeanyDocument *doc = NULL;

	doc = document_get_current();

	if (doc != NULL && string != NULL)
	{
…
		editor_insert_text_block(doc->editor, string, pos, len, 0, TRUE);
	}
}

frlan avatar May 13 '21 12:05 frlan