/* * removes current instruction marker */ void markers_remove_current_instruction(char* file, int line) { GeanyDocument *doc = document_find_by_filename(file); if (doc) { sci_delete_marker_at_line(doc->editor->sci, line - 1, M_CI_ARROW); sci_delete_marker_at_line(doc->editor->sci, line - 1, M_CI_BACKGROUND); scintilla_send_message(doc->editor->sci, SCI_SETFOCUS, TRUE, 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; } }
/* * removes frame marker */ void markers_remove_frame(char* file, int line) { GeanyDocument *doc = document_find_by_filename(file); if (doc) { sci_delete_marker_at_line(doc->editor->sci, line - 1, M_FRAME); scintilla_send_message(doc->editor->sci, SCI_SETFOCUS, TRUE, 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); }
static PyObject * Scintilla_delete_marker_at_line(Scintilla *self, PyObject *args, PyObject *kwargs) { gint line_num, marker; static gchar *kwlist[] = { "line_number", "marker", NULL }; SCI_RET_IF_FAIL(self); if (PyArg_ParseTupleAndKeywords(args, kwargs, "ii", kwlist, &line_num, &marker)) sci_delete_marker_at_line(self->sci, line_num, marker); Py_RETURN_NONE; }
/* * removes breakpoints marker */ void markers_remove_breakpoint(breakpoint *bp) { static int breakpoint_markers[] = { M_BP_ENABLED, M_BP_DISABLED, M_BP_CONDITIONAL }; GeanyDocument *doc = document_find_by_filename(bp->file); if (doc) { int markers = scintilla_send_message(doc->editor->sci, SCI_MARKERGET, bp->line - 1, (long)NULL); int markers_count = sizeof(breakpoint_markers) / sizeof(breakpoint_markers[0]); int i = 0; for (; i < markers_count; i++) { int marker = breakpoint_markers[i]; if (markers & (0x01 << marker)) { sci_delete_marker_at_line(doc->editor->sci, bp->line - 1, marker); } } } }