Kaydet (Commit) 3a2d560f authored tarafından Enrico Tröger's avatar Enrico Tröger

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
üst 458498ad
......@@ -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;
......
......@@ -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 "  " & < > Ü™ € • ∞ ∝ ∗\
− ∑ ∏ ∈ ∅ π Ω ω α ÿ ý\
÷ ø ù ú û ü ä å æ ç\
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment