Revision: 2153 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=2153&view=re... Author: frlan Date: 2011-08-15 19:44:28 +0000 (Mon, 15 Aug 2011)
Log Message: ----------- GeanyLaTeX: Merge latest version of GeanyLaTeX into geany-plugins
Modified Paths: -------------- trunk/geany-plugins/geanylatex/ChangeLog trunk/geany-plugins/geanylatex/src/geanylatex.c trunk/geany-plugins/geanylatex/src/geanylatex.h trunk/geany-plugins/geanylatex/src/latexenvironments.c trunk/geany-plugins/geanylatex/src/latexkeybindings.c trunk/geany-plugins/geanylatex/src/latexkeybindings.h trunk/geany-plugins/geanylatex/src/letters.c trunk/geany-plugins/geanylatex/src/templates.c
Modified: trunk/geany-plugins/geanylatex/ChangeLog =================================================================== --- trunk/geany-plugins/geanylatex/ChangeLog 2011-08-15 19:43:57 UTC (rev 2152) +++ trunk/geany-plugins/geanylatex/ChangeLog 2011-08-15 19:44:28 UTC (rev 2153) @@ -1,3 +1,8 @@ +2011-08-15 Frank Lanitz <frank(at)frank(dot)uvena(dot)de> + + * Merging last stand alone version into geany-pluins release. + + 2011-08-05 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
* Fixing an bug when using keybindings to insert typewriter format @@ -5,7 +10,7 @@
2011-03-17 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
- * Attempt to fix a couple of compiling warnings came up with updates + * Attempt to fix a couple of compiling warnings came up with updates build flags.
Modified: trunk/geany-plugins/geanylatex/src/geanylatex.c =================================================================== --- trunk/geany-plugins/geanylatex/src/geanylatex.c 2011-08-15 19:43:57 UTC (rev 2152) +++ trunk/geany-plugins/geanylatex/src/geanylatex.c 2011-08-15 19:44:28 UTC (rev 2153) @@ -27,7 +27,7 @@
#ifdef HAVE_CONFIG_H -# include "config.h" /* for the gettext domain */ + #include "config.h" /* for the gettext domain */ #endif
#include "geanylatex.h" @@ -90,7 +90,6 @@ * and \endgroup{}. */ static gint glatex_autocompletion_context_size; static gboolean glatex_autocompletion_only_for_latex; -static gboolean glatex_autobraces_active = TRUE;
/* Function will be deactivated, when only loaded */ static gboolean toggle_active = FALSE;
Modified: trunk/geany-plugins/geanylatex/src/geanylatex.h =================================================================== --- trunk/geany-plugins/geanylatex/src/geanylatex.h 2011-08-15 19:43:57 UTC (rev 2152) +++ trunk/geany-plugins/geanylatex/src/geanylatex.h 2011-08-15 19:44:28 UTC (rev 2153) @@ -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/geany-plugins/geanylatex/src/latexenvironments.c =================================================================== --- trunk/geany-plugins/geanylatex/src/latexenvironments.c 2011-08-15 19:43:57 UTC (rev 2152) +++ trunk/geany-plugins/geanylatex/src/latexenvironments.c 2011-08-15 19:44:28 UTC (rev 2153) @@ -114,7 +114,6 @@ } } } - pos = sci_get_current_position(doc->editor->sci);
sci_start_undo_action(doc->editor->sci);
Modified: trunk/geany-plugins/geanylatex/src/latexkeybindings.c =================================================================== --- trunk/geany-plugins/geanylatex/src/latexkeybindings.c 2011-08-15 19:43:57 UTC (rev 2152) +++ trunk/geany-plugins/geanylatex/src/latexkeybindings.c 2011-08-15 19:44:28 UTC (rev 2153) @@ -50,116 +50,129 @@
void glatex_kb_insert_newline(G_GNUC_UNUSED guint key_id) { - g_return_if_fail(document_get_current != NULL); + g_return_if_fail(document_get_current() != NULL); glatex_insert_string("\\\n", TRUE); }
void glatex_kb_insert_newitem(G_GNUC_UNUSED guint key_id) { - g_return_if_fail(document_get_current != NULL); + g_return_if_fail(document_get_current() != NULL); glatex_insert_string("\item ", TRUE); }
void glatex_kb_replace_special_chars(G_GNUC_UNUSED guint key_id) { - g_return_if_fail(document_get_current != NULL); + g_return_if_fail(document_get_current() != NULL); glatex_replace_special_character(); }
void glatex_kb_format_bold(G_GNUC_UNUSED guint key_id) { - g_return_if_fail(document_get_current != NULL); + g_return_if_fail(document_get_current() != NULL); glatex_insert_latex_format(NULL, GINT_TO_POINTER(LATEX_BOLD)); }
void glatex_kb_format_italic(G_GNUC_UNUSED guint key_id) { - g_return_if_fail(document_get_current != NULL); + g_return_if_fail(document_get_current() != NULL); glatex_insert_latex_format(NULL, GINT_TO_POINTER(LATEX_ITALIC)); }
void glatex_kb_format_typewriter(G_GNUC_UNUSED guint key_id) { - g_return_if_fail(document_get_current != NULL); + g_return_if_fail(document_get_current() != NULL); glatex_insert_latex_format(NULL, GINT_TO_POINTER(LATEX_TYPEWRITER)); }
void glatex_kb_format_centering(G_GNUC_UNUSED guint key_id) { - g_return_if_fail(document_get_current != NULL); + g_return_if_fail(document_get_current() != NULL); glatex_insert_latex_format(NULL, GINT_TO_POINTER(LATEX_CENTER)); }
void glatex_kb_format_left(G_GNUC_UNUSED guint key_id) { - g_return_if_fail(document_get_current != NULL); + g_return_if_fail(document_get_current() != NULL); glatex_insert_latex_format(NULL, GINT_TO_POINTER(LATEX_LEFT)); }
void glatex_kb_format_right(G_GNUC_UNUSED guint key_id) { - g_return_if_fail(document_get_current != NULL); + g_return_if_fail(document_get_current() != NULL); glatex_insert_latex_format(NULL, GINT_TO_POINTER(LATEX_RIGHT)); }
void glatex_kb_insert_description_list(G_GNUC_UNUSED guint key_id) { - g_return_if_fail(document_get_current != NULL); + g_return_if_fail(document_get_current() != NULL); glatex_insert_list_environment(GLATEX_LIST_DESCRIPTION); }
void glatex_kb_insert_itemize_list(G_GNUC_UNUSED guint key_id) { - g_return_if_fail(document_get_current != NULL); + g_return_if_fail(document_get_current() != NULL); glatex_insert_list_environment(GLATEX_LIST_ITEMIZE); }
void glatex_kb_insert_enumerate_list(G_GNUC_UNUSED guint key_id) { - g_return_if_fail(document_get_current != NULL); + g_return_if_fail(document_get_current() != NULL); glatex_insert_list_environment(GLATEX_LIST_ENUMERATE); }
void glatex_kb_structure_lvlup(G_GNUC_UNUSED guint key_id) { - g_return_if_fail(document_get_current != NULL); + g_return_if_fail(document_get_current() != NULL); glatex_structure_lvlup(); }
void glatex_kb_structure_lvldown(G_GNUC_UNUSED guint key_id) { - g_return_if_fail(document_get_current != NULL); + g_return_if_fail(document_get_current() != NULL); glatex_structure_lvldown(); }
void glatex_kb_usepackage_dialog(G_GNUC_UNUSED guint key_id) { - g_return_if_fail(document_get_current != NULL); + g_return_if_fail(document_get_current() != NULL); glatex_insert_usepackage_dialog(NULL, NULL); }
void glatex_kb_insert_command_dialog(G_GNUC_UNUSED guint key_id) { - g_return_if_fail(document_get_current != NULL); + g_return_if_fail(document_get_current() != NULL); glatex_insert_command_activated(NULL, NULL); }
void glatex_kb_insert_bibtex_cite(G_GNUC_UNUSED guint key_id) { - g_return_if_fail(document_get_current != NULL); + 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/geany-plugins/geanylatex/src/latexkeybindings.h =================================================================== --- trunk/geany-plugins/geanylatex/src/latexkeybindings.h 2011-08-15 19:43:57 UTC (rev 2152) +++ trunk/geany-plugins/geanylatex/src/latexkeybindings.h 2011-08-15 19:44:28 UTC (rev 2153) @@ -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
Modified: trunk/geany-plugins/geanylatex/src/letters.c =================================================================== --- trunk/geany-plugins/geanylatex/src/letters.c 2011-08-15 19:43:57 UTC (rev 2152) +++ trunk/geany-plugins/geanylatex/src/letters.c 2011-08-15 19:44:28 UTC (rev 2153) @@ -26,7 +26,8 @@
enum { - GREEK_LETTERS = 0, + LATEX_LETTERS = 0, + GREEK_LETTERS, GERMAN_LETTERS, MISC_LETTERS, ARROW_CHAR, @@ -36,6 +37,7 @@ };
CategoryName glatex_cat_names[] = { + { LATEX_LETTERS, N_("LaTeX letters"), TRUE}, { GREEK_LETTERS, N_("Greek letters"), TRUE}, { GERMAN_LETTERS, N_("German umlauts"), TRUE}, { MISC_LETTERS, N_("Misc"), FALSE}, @@ -51,6 +53,14 @@ * AAACCCBBB is valid * ACABCBACB is _not_ valid and will course trouble */ SubMenuTemplate glatex_char_array[] = { + /* LaTeX characters */ + {LATEX_LETTERS, "$", "\$"}, + {LATEX_LETTERS, "%", "\%"}, + {LATEX_LETTERS, "_", "\_"}, + {LATEX_LETTERS, "}", "\}"}, + {LATEX_LETTERS, "{", "\{"}, + {LATEX_LETTERS, "&", "\&"}, + {LATEX_LETTERS, "#", "\#"}, /* Greek characters */ {GREEK_LETTERS, "Α", "\Alpha" }, {GREEK_LETTERS, "α", "\alpha" },
Modified: trunk/geany-plugins/geanylatex/src/templates.c =================================================================== --- trunk/geany-plugins/geanylatex/src/templates.c 2011-08-15 19:43:57 UTC (rev 2152) +++ trunk/geany-plugins/geanylatex/src/templates.c 2011-08-15 19:44:28 UTC (rev 2153) @@ -39,14 +39,15 @@
static void glatex_init_cutom_template_item(gchar *file, GPtrArray *array) { - TemplateEntry *template = g_new0(TemplateEntry, 1); + TemplateEntry *template = NULL; gchar *tmp = NULL;
/* Return if its not a searched file */ if (g_str_has_suffix(file,".gtl") == FALSE) - g_free(template); return;
+ template = g_new0(TemplateEntry, 1); + template->filepath = g_strdup(file);
tmp = g_path_get_basename(file);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
plugins-commits@lists.geany.org