added sci_cb_auto_close_bracket() to close { and [ brackets in LaTex-Mode (more could be added)

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@55 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Enrico Tröger 2005-12-13 22:06:12 +00:00
parent 458498ad41
commit 3a2d560fdc
2 changed files with 23 additions and 0 deletions

View File

@ -161,6 +161,12 @@ on_editor_notification(GtkWidget* editor, gint scn, gpointer lscn, gpointer user
sci_cb_auto_forif(sci, idx);
break;
}
case '[':
case '{':
{ // Tex auto-closing
sci_cb_auto_close_bracket(sci, nt->ch); // Tex auto-closing
break;
}
case '}':
{ // closing bracket handling
if (app->use_auto_indention) sci_cb_close_block(sci, pos - 1);
@ -236,6 +242,21 @@ void sci_cb_get_indent(ScintillaObject *sci, gint pos, gboolean use_this_line)
}
void sci_cb_auto_close_bracket(ScintillaObject *sci, gchar c)
{
if (SSM(sci, SCI_GETLEXER, 0, 0) != SCLEX_LATEX) return;
if (c == '[')
{
sci_add_text(sci, "]");
}
else if (c == '{')
{
sci_add_text(sci, "}");
}
}
void sci_cb_close_block(ScintillaObject *sci, gint pos)
{
gint x = 0, cnt = 0;

View File

@ -56,6 +56,8 @@ void sci_cb_auto_multiline(ScintillaObject *sci, gint pos);
void sci_cb_auto_table(ScintillaObject *sci, gint pos);
void sci_cb_auto_close_bracket(ScintillaObject *sci, gchar c);
#define sci_cb_html_entities "  " & < > Ü™ € • ∞ ∝ ∗\
− ∑ ∏ ∈ ∅ π Ω ω α ÿ ý\
÷ ø ù ú û ü ä å æ ç\