Пример #1
0
/*
 * adds current instruction marker
 */
void markers_add_current_instruction(char* file, int line)
{
	GeanyDocument *doc = document_find_by_filename(file);
	if (doc)
	{
		sci_set_marker_at_line(doc->editor->sci, line - 1, M_CI_ARROW);
		sci_set_marker_at_line(doc->editor->sci, line - 1, M_CI_BACKGROUND);
	}
}
Пример #2
0
static void on_sci_notify(ScintillaObject *sci, gint param,
                          SCNotification *nt, gpointer data)
{
    gint line;

    switch (nt->nmhdr.code)
    {
    /* adapted from editor.c: on_margin_click() */
    case SCN_MARGINCLICK:
        /* left click to marker margin toggles marker */
        if (nt->margin == 1)
        {
            gboolean set;
            gint marker = 1;

            line = sci_get_line_from_position(sci, nt->position);
            set = sci_is_marker_set_at_line(sci, line, marker);
            if (!set)
                sci_set_marker_at_line(sci, line, marker);
            else
                sci_delete_marker_at_line(sci, line, marker);
        }
        /* left click on the folding margin to toggle folding state of current line */
        if (nt->margin == 2)
        {
            line = sci_get_line_from_position(sci, nt->position);
            scintilla_send_message(sci, SCI_TOGGLEFOLD, line, 0);
        }
        break;

    default:
        break;
    }
}
Пример #3
0
/*
 * adds frame marker
 */
void markers_add_frame(char* file, int line)
{
	GeanyDocument *doc = document_find_by_filename(file);
	if (doc)
	{
		sci_set_marker_at_line(doc->editor->sci, line - 1, M_FRAME);
	}
}
Пример #4
0
void sci_toggle_marker_at_line(ScintillaObject *sci, gint line, gint marker)
{
	gboolean set = sci_is_marker_set_at_line(sci, line, marker);

	if (!set)
		sci_set_marker_at_line(sci, line, marker);
	else
		sci_delete_marker_at_line(sci, line, marker);
}
Пример #5
0
/*
 * add breakpoint marker
 * enabled or disabled, based on bp->enabled value
 * arguments:
 * 		bp - breakpoint to add marker for  
 */
void markers_add_breakpoint(breakpoint* bp)
{
	GeanyDocument *doc = document_find_by_filename(bp->file);
	if (doc)
	{
		if (!bp->enabled)
		{
			sci_set_marker_at_line(doc->editor->sci, bp->line - 1, M_BP_DISABLED);
		}
		else if (strlen(bp->condition) || bp->hitscount)
		{
				sci_set_marker_at_line(doc->editor->sci, bp->line - 1, M_BP_CONDITIONAL);
		}
		else
		{
				sci_set_marker_at_line(doc->editor->sci, bp->line - 1, M_BP_ENABLED);
		}
	}
}
Пример #6
0
static PyObject *
Scintilla_set_marker_at_line(Scintilla *self, PyObject *args, PyObject *kwargs)
{
	gint line, marker;
	static gchar *kwlist[] = { "line", "marker", NULL };

	SCI_RET_IF_FAIL(self);

	if (PyArg_ParseTupleAndKeywords(args, kwargs, "ii", kwlist, &line, &marker))
		sci_set_marker_at_line(self->sci, line, marker);

	Py_RETURN_NONE;
}