GtkSourceCompletion skip lines
- From: alpha150 free fr
- To: gtk-app-devel-list gnome org
- Subject: GtkSourceCompletion skip lines
- Date: Wed, 13 May 2015 08:14:22 -0000
Hi,
I'm using gtksourceview 2.10.x on win32. GtkSourceCompletion skip lines, for example with the following code:
#define ABCD
#define ABCDE
Only ABCD will be available for completion.
My source code is the following:
textview_ea_h = gtk_text_view_new();
GtkTextBuffer * buf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview_ea_h));
//////////////////////////////////////////
// Load the file into the textview:
GtkTextIter start;
GtkTextIter end;
gchar read_buf[4097];
FILE * file = fopen("ea.h","rb");
fseek(file,0,SEEK_END);
unsigned int len = ftell(file);
rewind(file);
gtk_text_buffer_get_start_iter(GTK_TEXT_BUFFER(buf),&start);
gtk_text_buffer_get_end_iter(GTK_TEXT_BUFFER(buf),&end);
gtk_text_buffer_delete(GTK_TEXT_BUFFER(buf), &start, &end);
gchar * buf_utf8;
while(fgets(read_buf,4097,file)) {
gtk_text_buffer_get_end_iter(GTK_TEXT_BUFFER(buf),&end);
buf_utf8 = g_locale_to_utf8(read_buf, -1, NULL, NULL, NULL);
gtk_text_buffer_insert(GTK_TEXT_BUFFER(buf), &end, buf_utf8, -1);
g_free (buf_utf8);
}
gtk_text_buffer_set_modified (GTK_TEXT_BUFFER (buf), TRUE);
fclose(file);
// End load of file.
/////////////////////////////////////////
source_completion_words_ea_h = gtk_source_completion_words_new("ea.h", NULL);
gtk_source_completion_words_register(source_completion_words_ea_h, GTK_TEXT_BUFFER(buf));
l->source_completion = gtk_source_view_get_completion(GTK_SOURCE_VIEW(l->editor));
GError *error = NULL;
gtk_source_completion_add_provider(l->source_completion,
GTK_SOURCE_COMPLETION_PROVIDER(source_completion_words_ea_h),&error);
if(error != NULL) g_error_free(error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]