From 52ba82e18d6351274f4503a473ac10bef1d8a17e Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Tue, 15 Dec 2015 10:28:24 +0100 Subject: [PATCH 1/2] plugin api: export editor_set_indent_width() Plugins can now change the indentation width of an editor. --- src/editor.c | 7 +++++++ src/plugindata.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/editor.c b/src/editor.c index 766d45937f..51192fd826 100644 --- a/src/editor.c +++ b/src/editor.c @@ -4561,6 +4561,13 @@ void editor_set_indent_type(GeanyEditor *editor, GeanyIndentType type) } +/** Sets the indent width for @a editor. + * @param editor Editor. + * @param width New indent width. + * + * @since 1.27 (API 227) + */ +GEANY_API_SYMBOL void editor_set_indent_width(GeanyEditor *editor, gint width) { editor_set_indent(editor, editor->indent_type, width); diff --git a/src/plugindata.h b/src/plugindata.h index e3d67bc858..63dd373c89 100644 --- a/src/plugindata.h +++ b/src/plugindata.h @@ -58,7 +58,7 @@ G_BEGIN_DECLS * @warning You should not test for values below 200 as previously * @c GEANY_API_VERSION was defined as an enum value, not a macro. */ -#define GEANY_API_VERSION 226 +#define GEANY_API_VERSION 227 /* hack to have a different ABI when built with GTK3 because loading GTK2-linked plugins * with GTK3-linked Geany leads to crash */ From f7d47c8aba4ad8bd0dfff4316be6b16bd878e680 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Wed, 24 Feb 2016 19:40:25 +0100 Subject: [PATCH 2/2] plugin api: move editor_set_indent_width() out of GEANY_PRIVATE section --- src/editor.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/editor.h b/src/editor.h index 39035285eb..d77c878c98 100644 --- a/src/editor.h +++ b/src/editor.h @@ -167,6 +167,8 @@ void editor_indicator_clear(GeanyEditor *editor, gint indic); void editor_set_indent_type(GeanyEditor *editor, GeanyIndentType type); +void editor_set_indent_width(GeanyEditor *editor, gint width); + gchar *editor_get_word_at_pos(GeanyEditor *editor, gint pos, const gchar *wordchars); const gchar *editor_get_eol_char_name(GeanyEditor *editor); @@ -307,8 +309,6 @@ void editor_ensure_final_newline(GeanyEditor *editor); void editor_insert_color(GeanyEditor *editor, const gchar *colour); -void editor_set_indent_width(GeanyEditor *editor, gint width); - void editor_set_indent(GeanyEditor *editor, GeanyIndentType type, gint width); void editor_set_line_wrapping(GeanyEditor *editor, gboolean wrap);