Note: this breaks the plugin API for indentation editor_prefs.
Add GeanyIndentPrefs struct from some GeanyEditorPrefs fields (maybe this struct will get used elsewhere too). Add editor_init(). git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/custom-tab-width@2821 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
af5a64f186
commit
501d543492
@ -1,3 +1,12 @@
|
||||
2008-07-25 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||
|
||||
* src/plugindata.h, src/main.c, src/editor.c, src/editor.h:
|
||||
Note: this breaks the plugin API for indentation editor_prefs.
|
||||
Add GeanyIndentPrefs struct from some GeanyEditorPrefs fields (maybe
|
||||
this struct will get used elsewhere too).
|
||||
Add editor_init().
|
||||
|
||||
|
||||
2008-07-25 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||
|
||||
* src/interface.c, src/ui_utils.c, geany.glade:
|
||||
|
10
src/editor.c
10
src/editor.c
@ -3662,3 +3662,13 @@ GeanyEditor *editor_create(GeanyDocument *doc)
|
||||
return editor;
|
||||
}
|
||||
|
||||
|
||||
void editor_init(void)
|
||||
{
|
||||
static GeanyIndentPrefs indent_prefs;
|
||||
|
||||
memset(&editor_prefs, 0, sizeof(GeanyEditorPrefs));
|
||||
memset(&indent_prefs, 0, sizeof GeanyIndentPrefs);
|
||||
editor_prefs->indentation = &indent_prefs;
|
||||
}
|
||||
|
||||
|
29
src/editor.h
29
src/editor.h
@ -51,14 +51,25 @@ typedef enum
|
||||
INDENT_BASIC,
|
||||
INDENT_CURRENTCHARS,
|
||||
INDENT_MATCHBRACES
|
||||
} IndentMode;
|
||||
} GeanyIndentMode;
|
||||
|
||||
/* These are the default prefs when creating a new editor window.
|
||||
* Some of these can be overridden per document.
|
||||
* Remember to increment abi_version in plugindata.h when changing items. */
|
||||
typedef struct GeanyIndentPrefs
|
||||
{
|
||||
gint width; /**< Indent width. */
|
||||
gint tab_width; /**< Width of a tab, if @c custom_tab_width is set. */
|
||||
gboolean custom_tab_width; /**< Whether a tab is a different size from an indent. */
|
||||
gboolean use_tabs; /**< Whether to (mainly) use tabs or spaces to indent. */
|
||||
gboolean use_tab_to_indent; /* hidden pref */
|
||||
GeanyIndentMode mode;
|
||||
}
|
||||
GeanyIndentPrefs;
|
||||
|
||||
|
||||
/** Default prefs when creating a new editor window.
|
||||
* Some of these can be overridden per document. */
|
||||
typedef struct GeanyEditorPrefs
|
||||
{
|
||||
/* display */
|
||||
GeanyIndentPrefs *indentation; /**< Indentation prefs. */
|
||||
gboolean show_white_space;
|
||||
gboolean show_indent_guide;
|
||||
gboolean show_line_endings;
|
||||
@ -69,16 +80,10 @@ typedef struct GeanyEditorPrefs
|
||||
gboolean show_linenumber_margin; /* view menu */
|
||||
gboolean show_scrollbars; /* hidden pref */
|
||||
gboolean scroll_stop_at_last_line; /* hidden pref */
|
||||
|
||||
/* behaviour */
|
||||
gboolean line_wrapping;
|
||||
gboolean use_indicators;
|
||||
gboolean folding;
|
||||
gboolean unfold_all_children;
|
||||
gint tab_width;
|
||||
gboolean use_tabs;
|
||||
gboolean use_tab_to_indent; /* hidden pref */
|
||||
IndentMode indent_mode;
|
||||
gboolean disable_dnd;
|
||||
gboolean smart_home_key;
|
||||
gboolean newline_strip;
|
||||
@ -125,6 +130,8 @@ extern EditorInfo editor_info;
|
||||
|
||||
|
||||
|
||||
void editor_init(void);
|
||||
|
||||
GeanyEditor *editor_create(GeanyDocument *doc);
|
||||
|
||||
void on_editor_notification(GtkWidget* editor, gint scn, gpointer lscn, gpointer user_data);
|
||||
|
@ -740,7 +740,6 @@ gint main(gint argc, gchar **argv)
|
||||
memset(&prefs, 0, sizeof(GeanyPrefs));
|
||||
memset(&interface_prefs, 0, sizeof(GeanyInterfacePrefs));
|
||||
memset(&toolbar_prefs, 0, sizeof(GeanyToolbarPrefs));
|
||||
memset(&editor_prefs, 0, sizeof(GeanyEditorPrefs));
|
||||
memset(&file_prefs, 0, sizeof(GeanyFilePrefs));
|
||||
memset(&search_prefs, 0, sizeof(GeanySearchPrefs));
|
||||
memset(&tool_prefs, 0, sizeof(GeanyToolPrefs));
|
||||
@ -800,6 +799,7 @@ gint main(gint argc, gchar **argv)
|
||||
load_settings();
|
||||
|
||||
msgwin_init();
|
||||
editor_init();
|
||||
build_init();
|
||||
search_init();
|
||||
ui_create_insert_menu_items();
|
||||
|
@ -36,12 +36,12 @@
|
||||
|
||||
/* The API version should be incremented whenever any plugin data types below are
|
||||
* modified or appended to. */
|
||||
static const gint api_version = 82;
|
||||
static const gint api_version = 83;
|
||||
|
||||
/* The ABI version should be incremented whenever existing fields in the plugin
|
||||
* data types below have to be changed or reordered. It should stay the same if fields
|
||||
* are only appended, as this doesn't affect existing fields. */
|
||||
static const gint abi_version = 43;
|
||||
static const gint abi_version = 44;
|
||||
|
||||
/** Check the plugin can be loaded by Geany.
|
||||
* This performs runtime checks that try to ensure:
|
||||
|
Loading…
x
Reference in New Issue
Block a user