Example #1
0
static void language_css_trigger_completion (Language_Provider *lgcss, guint ch)
{
    g_return_if_fail(lgcss);
    Language_CSSDetails *lgcssdet = LANGUAGE_CSS_GET_PRIVATE(lgcss);
    gint current_pos;
    gchar *member_function_buffer = NULL;

    current_pos = gtk_scintilla_get_current_pos(lgcssdet->sci);
    gboolean auto_brace;
    g_object_get(lgcssdet->prefmg, "auto_complete_braces", &auto_brace, NULL);

    if (IsOpenBrace(ch) && auto_brace) {
        InsertCloseBrace (lgcssdet->sci, current_pos, ch);
        return;
    }

    switch(ch) {
    case ('\r'):
    case ('\n'):
        autoindent_brace_code (lgcssdet->sci, lgcssdet->prefmg);
        break;
    case (';'):
        cancel_calltip (lgcssdet->sci);
        break;
    case (':'):
        show_calltip (lgcss);
        break;
    default:
        member_function_buffer = documentable_get_current_word(lgcssdet->doc);
        if (member_function_buffer && strlen(member_function_buffer)>=3) show_autocompletion (LANGUAGE_CSS(lgcss), current_pos);
        g_free(member_function_buffer);
    }
}
Example #2
0
bool IsBalanceParanthesis (char* s) {
	char* temp = s;
	int l = strlen(s);
	int j;
	for(j=0;j<l;j++) {
		if(IsOpenBrace(temp[j])) {
			Push(head,temp[j]);
		}else if(IsCloseBrace(temp[j])) {
			if(head == NULL) {
				return 0;
			}else if(!AreMatchingBraces(bla->data,temp[j])) {
				return 0;
			}else if(AreMatchingBraces(bla->data,temp[j])) {
				Pop(head);
			}
	
		}
	}
	
	if(IsEmpty(bla))
		return 1;	
}