Esempio n. 1
0
static void on_document_close(GObject *obj, GeanyDocument *doc, gpointer user_data)
{
    if (doc->editor == edit_window.editor)
    {
        /* select current or unsplit in IDLE time, so the tab has changed */
        plugin_idle_add(geany_plugin, do_select_current, NULL);
    }
}
Esempio n. 2
0
static void schedule_settings_saved(gboolean conterm)
{
	guint i;

	saved_id = plugin_idle_add(geany_plugin, settings_saved, GINT_TO_POINTER(conterm));

	foreach_document(i)
	{
		if (utils_attrib(documents[i], SCOPE_LOCK))
			documents[i]->readonly = FALSE;
	}
}
Esempio n. 3
0
/* Autosave the current file when the focus out of the _editor_
 *
 * Get the SCN_FOCUSOUT signal, and then ask plugin_idle_add()
 * to save the current doc when idle
 *
 * @return always FALSE = Non block signals
 *
 */
static gboolean on_document_focus_out(GObject *object, GeanyEditor *editor,
								 SCNotification *nt, gpointer data)
{
	if (nt->nmhdr.code == SCN_FOCUSOUT
		&& enable_autosave_losing_focus
		&& editor->document->file_name != NULL)
	{
		plugin_idle_add(geany_plugin, save_on_focus_out_idle, editor->document);
	}

	return FALSE;
}
Esempio n. 4
0
void
plugin_init (GeanyData *data)
{
  GeanyKeyGroup *group;
  
  group = plugin_set_key_group (geany_plugin, "commander", KB_COUNT, NULL);
  keybindings_set_item (group, KB_SHOW_PANEL, on_kb_show_panel,
                        0, 0, "show_panel", _("Show Command Panel"), NULL);
  
  /* delay for other plugins to have a chance to load before, so we will
   * include their items */
  plugin_idle_add (geany_plugin, on_plugin_idle_init, NULL);
}
Esempio n. 5
0
static void unlock_readonly(void)
{
	guint i;

	foreach_document(i)
	{
		if (utils_attrib(documents[i], SCOPE_LOCK))
		{
			documents[i]->readonly = FALSE;

			if (!resync_id)
				resync_id = plugin_idle_add(geany_plugin, resync_readonly, NULL);
		}
	}
}
Esempio n. 6
0
static void deferred_op_queue_enqueue(gchar* filename, DeferredTagOpType type)
{
	DeferredTagOp * op;

	op = (DeferredTagOp *) g_new0(DeferredTagOp, 1);
	op->type = type;
	op->filename = g_strdup(filename);

	file_tag_deferred_op_queue = g_slist_prepend(file_tag_deferred_op_queue,op);

	if (!flush_queued)
	{
		flush_queued = TRUE;
		plugin_idle_add(geany_plugin, (GSourceFunc)deferred_op_queue_flush, NULL);
	}
}
Esempio n. 7
0
void
plugin_init (GeanyData *data)
{
  GeanyKeyGroup *group;
  
  group = plugin_set_key_group (geany_plugin, "commander", KB_COUNT, NULL);
  keybindings_set_item_full (group, KB_SHOW_PANEL, 0, 0, "show_panel",
                             _("Show Command Panel"), NULL,
                             on_kb_show_panel, NULL, NULL);
  keybindings_set_item_full (group, KB_SHOW_PANEL_COMMANDS, 0, 0,
                             "show_panel_commands",
                             _("Show Command Panel (Commands Only)"), NULL,
                             on_kb_show_panel, (gpointer) "c:", NULL);
  keybindings_set_item_full (group, KB_SHOW_PANEL_FILES, 0, 0,
                             "show_panel_files",
                             _("Show Command Panel (Files Only)"), NULL,
                             on_kb_show_panel, (gpointer) "f:", NULL);
  
  /* delay for other plugins to have a chance to load before, so we will
   * include their items */
  plugin_idle_add (geany_plugin, on_plugin_idle_init, NULL);
}
Esempio n. 8
0
static void on_project_close(G_GNUC_UNUSED GObject *obj, G_GNUC_UNUSED GKeyFile *config)
{
	plugin_idle_add(geany_plugin, change_context, NULL);
}