Exemplo n.º 1
0
static void on_document_filetype_set(G_GNUC_UNUSED GObject *obj, GeanyDocument *doc,
	G_GNUC_UNUSED GeanyFiletype *filetype_old, G_GNUC_UNUSED gpointer gdata)
{
	DebugState state = debug_state();
	utils_lock_unlock(doc, state != DS_INACTIVE && utils_source_document(doc));
	toolbar_update_state(state);
}
Exemplo n.º 2
0
static gboolean tooltip_launch(gpointer gdata)
{
	GeanyDocument *doc = document_get_current();

	if (doc && utils_source_document(doc) && doc->editor == gdata &&
		(debug_state() & DS_SENDABLE))
	{
		ScintillaObject *sci = doc->editor->sci;
		gchar *expr = sci_get_selection_mode(sci) == SC_SEL_STREAM &&
			peek_pos >= sci_get_selection_start(sci) &&
			peek_pos < sci_get_selection_end(sci) ?
			editor_get_default_selection(doc->editor, FALSE, NULL) :
			editor_get_word_at_pos(doc->editor, peek_pos, NULL);

		if ((expr = utils_verify_selection(expr)) != NULL)
		{
			g_free(input);
			input = debug_send_evaluate('3', scid_gen, expr);
			g_free(expr);
		}
		else
			tooltip_set(NULL);
	}
	else
		tooltip_set(NULL);

	query_id = 0;
	return FALSE;
}
Exemplo n.º 3
0
static guint debug_menu_extra_state(void)
{
	GeanyDocument *doc = document_get_current();

	return ((thread_state >= THREAD_AT_SOURCE) << DS_INDEX_1) |
		((doc && utils_source_document(doc)) << DS_INDEX_2) |
		((thread_state == THREAD_AT_ASSEMBLER) << DS_INDEX_3) |
		(recent_menu_items() << DS_INDEX_4);
}
Exemplo n.º 4
0
static gboolean on_editor_notify(G_GNUC_UNUSED GObject *obj, GeanyEditor *editor,
	SCNotification *nt, G_GNUC_UNUSED gpointer gdata)
{
	GeanyDocument *doc = editor->document;

	if (nt->nmhdr.code == SCN_MODIFIED && nt->linesAdded && utils_source_document(doc))
	{
		gboolean active = debug_state() != DS_INACTIVE;
		ScintillaObject *sci = editor->sci;
		gint start = sci_get_line_from_position(sci, nt->position);

		if (active)
			threads_delta(sci, doc->real_path, start, nt->linesAdded);

		breaks_delta(sci, doc->real_path, start, nt->linesAdded, active);
	}

	return FALSE;
}
Exemplo n.º 5
0
static void on_document_filetype_set(G_GNUC_UNUSED GObject *obj, GeanyDocument *doc,
	G_GNUC_UNUSED GeanyFiletype *filetype_old, G_GNUC_UNUSED gpointer gdata)
{
	utils_lock_unlock(doc, debug_state() != DS_INACTIVE && utils_source_document(doc));
}