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

Show auto completion list immediately when called by a keybinding.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@562 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst b266eedb
2006-07-15 Enrico Tröger <enrico.troeger@uvena.de>
* src/keybindings.c, src/sci_cb.c:
Show auto completion list immediately when called by a keybinding.
2006-07-15 Nick Treleaven <nick.treleaven@btinternet.com>
* keybindings.c, keybindings.h: Add keybinding for Find in files.
......
......@@ -702,7 +702,8 @@ static void cb_func_edit_autocomplete(void)
{
gint idx = document_get_cur_idx();
if (idx == -1 || ! doc_list[idx].is_valid) return;
sci_cb_start_auto_complete(doc_list[idx].sci, sci_get_current_position(doc_list[idx].sci), idx);
sci_cb_start_auto_complete(doc_list[idx].sci,
sci_get_current_position(doc_list[idx].sci), idx, TRUE);
}
static void cb_func_edit_calltip(void)
......
......@@ -190,7 +190,7 @@ void on_editor_notification(GtkWidget *editor, gint scn, gpointer lscn, gpointer
if (doc_list[idx].use_auto_indention) sci_cb_close_block(sci, pos - 1);
break;
}
default: sci_cb_start_auto_complete(sci, pos, idx);
default: sci_cb_start_auto_complete(sci, pos, idx, FALSE);
}
break;
}
......@@ -404,7 +404,7 @@ gboolean sci_cb_show_calltip(ScintillaObject *sci, gint pos, gint idx)
}
gboolean sci_cb_start_auto_complete(ScintillaObject *sci, gint pos, gint idx)
gboolean sci_cb_start_auto_complete(ScintillaObject *sci, gint pos, gint idx, gboolean force)
{
gint line, line_start, line_len, line_pos, current, rootlen, startword, lexer, style;
gchar *linebuf, *root;
......@@ -460,16 +460,19 @@ gboolean sci_cb_start_auto_complete(ScintillaObject *sci, gint pos, gint idx)
TMTagAttrType attrs[] = { tm_tag_attr_name_t, 0 };
if (idx == -1 || ! doc_list[idx].is_valid || doc_list[idx].file_type == NULL)
{ // go home if typed less than 4 chars
{
g_free(linebuf);
return FALSE;
}
while ((line_pos - i >= 0) && ! g_ascii_isspace(linebuf[line_pos - i])) i++;
if (i < 4)
{ // go home if typed less than 4 chars
g_free(linebuf);
return FALSE;
if (! force)
{ // force is set when called by keyboard shortcut, otherwise start after at third char
while ((line_pos - i >= 0) && ! g_ascii_isspace(linebuf[line_pos - i])) i++;
if (i < 4)
{ // go home if typed less than 4 chars
g_free(linebuf);
return FALSE;
}
}
tags = tm_workspace_find(root, tm_tag_max_t, attrs, TRUE, doc_list[idx].file_type->lang);
......
......@@ -26,7 +26,7 @@
// callback func called by all editors when a signals arises
void on_editor_notification(GtkWidget* editor, gint scn, gpointer lscn, gpointer user_data);
gboolean sci_cb_start_auto_complete(ScintillaObject *sci, gint pos, gint idx);
gboolean sci_cb_start_auto_complete(ScintillaObject *sci, gint pos, gint idx, gboolean force);
void sci_cb_get_indent(ScintillaObject *sci, gint pos, gboolean use_this_line);
......
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