SF.net SVN: geany-plugins:[1920] trunk/geanylatex

frlan at users.sourceforge.net frlan at xxxxx
Fri Feb 11 19:58:28 UTC 2011


Revision: 1920
          http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=1920&view=rev
Author:   frlan
Date:     2011-02-11 19:58:27 +0000 (Fri, 11 Feb 2011)

Log Message:
-----------
GeanyLaTeX:  Add a switch to turn on/off autoadding of {} after ^ and _ via keystroke.

Modified Paths:
--------------
    trunk/geanylatex/ChangeLog
    trunk/geanylatex/doc/geanylatex.tex
    trunk/geanylatex/src/geanylatex.c
    trunk/geanylatex/src/geanylatex.h
    trunk/geanylatex/src/latexkeybindings.c
    trunk/geanylatex/src/latexkeybindings.h

Modified: trunk/geanylatex/ChangeLog
===================================================================
--- trunk/geanylatex/ChangeLog	2011-02-10 22:10:41 UTC (rev 1919)
+++ trunk/geanylatex/ChangeLog	2011-02-11 19:58:27 UTC (rev 1920)
@@ -1,3 +1,8 @@
+2011-02-11  Frank Lanitz  <frank(at)frank(dot)uvena(dot)de>
+
+ * Add a switch to turn on/off autoadding of {} after ^ and _ via keystroke.
+
+
 2011-02-06  Frank Lanitz  <frank(at)frank(dot)uvena(dot)de>
 
  * src/templace.c: Fix a little memory leak.

Modified: trunk/geanylatex/doc/geanylatex.tex
===================================================================
--- trunk/geanylatex/doc/geanylatex.tex	2011-02-10 22:10:41 UTC (rev 1919)
+++ trunk/geanylatex/doc/geanylatex.tex	2011-02-11 19:58:27 UTC (rev 1920)
@@ -663,7 +663,8 @@
 Insert description list & Inserts an description environment as well as a 1\up{st} \textbackslash{}item element.\\\hline
 Insert itemize list & Inserts an itemize environment as well as a 1\up{st} \textbackslash{}item element.\\\hline
 Insert enumerate list & Inserts an enumerate environment as well as a 1\up{st} \textbackslash{}item element.\\\hline
-Insert BibTeX reference dialog & Opens up a dialog which is supporting insertion of BibTeX-references based on \texttt{bib}-files inside current directory.
+Insert BibTeX reference dialog & Opens up a dialog which is supporting insertion of BibTeX-references based on \texttt{bib}-files inside current directory.\\\hline
+Toggle autocompletion for \_ and \^ & Controlls whether braces should be inserted after \_ and \^ \ or not.
 \end{tabular}
 \end{table}
 

Modified: trunk/geanylatex/src/geanylatex.c
===================================================================
--- trunk/geanylatex/src/geanylatex.c	2011-02-10 22:10:41 UTC (rev 1919)
+++ trunk/geanylatex/src/geanylatex.c	2011-02-11 19:58:27 UTC (rev 1920)
@@ -85,7 +85,7 @@
  * and \endgroup{}. */
 static gint glatex_autocompletion_context_size;
 static gboolean glatex_autocompletion_only_for_latex;
-static gboolean glatex_autobraces_active = TRUE;
+gboolean glatex_autobraces_active = TRUE;
 
 /* Function will be deactivated, when only loaded */
 static gboolean toggle_active = FALSE;
@@ -1967,6 +1967,9 @@
 	keybindings_set_item(key_group, KB_LATEX_INSERT_CITE,
 		glatex_kb_insert_bibtex_cite, 0, 0, "insert_cite_dialog",
 		_("Insert BibTeX reference dialog"), menu_latex_insert_bibtex_cite);
+	keybindings_set_item(key_group, KB_LATEX_TOGGLE_UNDERSCORE_AUTOBRACES,
+		glatex_kb_toggle_underscore_autobraces, 0, 0, "toggle_autobraces",
+		_("Toggle autocompletion for underscore and ^"), NULL);
 }
 
 

Modified: trunk/geanylatex/src/geanylatex.h
===================================================================
--- trunk/geanylatex/src/geanylatex.h	2011-02-10 22:10:41 UTC (rev 1919)
+++ trunk/geanylatex/src/geanylatex.h	2011-02-11 19:58:27 UTC (rev 1920)
@@ -60,6 +60,8 @@
 #define MAX_MENU_ENTRIES 20
 
 extern LaTeXWizard glatex_wizard;
+extern gboolean glatex_autobraces_active;
+
 gint glatex_count_menu_entries(SubMenuTemplate *tmp, gint categorie);
 void glatex_wizard_activated(G_GNUC_UNUSED GtkMenuItem * menuitem,
 	 G_GNUC_UNUSED gpointer gdata);

Modified: trunk/geanylatex/src/latexkeybindings.c
===================================================================
--- trunk/geanylatex/src/latexkeybindings.c	2011-02-10 22:10:41 UTC (rev 1919)
+++ trunk/geanylatex/src/latexkeybindings.c	2011-02-11 19:58:27 UTC (rev 1920)
@@ -163,3 +163,16 @@
 	g_return_if_fail(document_get_current() != NULL);
 	on_insert_bibtex_dialog_activate(NULL, NULL);
 }
+
+
+void glatex_kb_toggle_underscore_autobraces(G_GNUC_UNUSED guint key_id)
+{
+	if (glatex_autobraces_active == TRUE)
+	{
+		glatex_autobraces_active = FALSE;
+	}
+	else
+	{
+		glatex_autobraces_active = TRUE;
+	}
+}

Modified: trunk/geanylatex/src/latexkeybindings.h
===================================================================
--- trunk/geanylatex/src/latexkeybindings.h	2011-02-10 22:10:41 UTC (rev 1919)
+++ trunk/geanylatex/src/latexkeybindings.h	2011-02-11 19:58:27 UTC (rev 1920)
@@ -49,6 +49,7 @@
 	KB_LATEX_USEPACKAGE_DIALOG,
 	KB_LATEX_INSERT_COMMAND,
 	KB_LATEX_INSERT_CITE,
+	KB_LATEX_TOGGLE_UNDERSCORE_AUTOBRACES,
 	COUNT_KB
 };
 
@@ -74,5 +75,6 @@
 void glatex_kb_usepackage_dialog(G_GNUC_UNUSED guint key_id);
 void glatex_kb_insert_command_dialog(G_GNUC_UNUSED guint key_id);
 void glatex_kb_insert_bibtex_cite(G_GNUC_UNUSED guint key_id);
+void glatex_kb_toggle_underscore_autobraces(G_GNUC_UNUSED guint key_id);
 
 #endif


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Plugins-Commits mailing list