Skip to content

Commit

Permalink
plugin api: export editor_set_indent_width()
Browse files Browse the repository at this point in the history
Plugins can now change the indentation width of an editor.

Closes #903.
  • Loading branch information
kugel- authored and b4n committed Feb 24, 2016
1 parent 269980c commit 17e4a60
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions src/editor.c
Expand Up @@ -4663,6 +4663,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);
Expand Down
4 changes: 2 additions & 2 deletions src/editor.h
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/plugindata.h
Expand Up @@ -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 */
Expand Down

0 comments on commit 17e4a60

Please sign in to comment.