set cursor position between brackets in sci_cb_auto_close_bracket()

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@71 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Enrico Tröger 2005-12-20 17:49:25 +00:00
parent 274c6487ca
commit 767cce068d
2 changed files with 5 additions and 6 deletions

View File

@ -158,13 +158,13 @@ on_editor_notification(GtkWidget* editor, gint scn, gpointer lscn, gpointer user
}
case ' ':
{ // if and for autocompletion
sci_cb_auto_forif(sci, idx);
if (app->auto_complete_constructs) sci_cb_auto_forif(sci, idx);
break;
}
case '[':
case '{':
{ // Tex auto-closing
sci_cb_auto_close_bracket(sci, nt->ch); // Tex auto-closing
sci_cb_auto_close_bracket(sci, pos, nt->ch); // Tex auto-closing
break;
}
case '}':
@ -242,7 +242,7 @@ void sci_cb_get_indent(ScintillaObject *sci, gint pos, gboolean use_this_line)
}
void sci_cb_auto_close_bracket(ScintillaObject *sci, gchar c)
void sci_cb_auto_close_bracket(ScintillaObject *sci, gint pos, gchar c)
{
if (SSM(sci, SCI_GETLEXER, 0, 0) != SCLEX_LATEX) return;
@ -254,6 +254,7 @@ void sci_cb_auto_close_bracket(ScintillaObject *sci, gchar c)
{
sci_add_text(sci, "}");
}
sci_set_current_position(sci, pos);
}
@ -408,8 +409,6 @@ void sci_cb_auto_forif(ScintillaObject *sci, gint idx)
//gint line = sci_get_line_from_position(sci, pos);
//gint start_style = SSM(sci, SCI_GETSTYLEAT, sci_get_position_from_line(sci, line), 0);
if (! app->auto_complete_constructs) return;
// only for C, C++, Java, Perl and PHP
if (lexer != SCLEX_CPP &&
lexer != SCLEX_HTML &&

View File

@ -56,7 +56,7 @@ 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);
void sci_cb_auto_close_bracket(ScintillaObject *sci, gint pos, gchar c);
#define sci_cb_html_entities "  " & < > Ü™ € • ∞ ∝ ∗\
− ∑ ∏ ∈ ∅ π Ω ω α ÿ ý\