diff --git a/src/document.c b/src/document.c index f8123734..902c2d47 100644 --- a/src/document.c +++ b/src/document.c @@ -86,24 +86,6 @@ GeanyFilePrefs file_prefs; - - -/** Dynamic array of GeanyDocument pointers. - * Once a pointer is added to this, it is never freed. This means the same document pointer - * can represent a different document later on, or it may have been closed and become invalid. - * For this reason, you should use document_find_by_id() instead of storing - * document pointers over time if there is a chance the user can close the - * document. - * - * @warning You must check @c GeanyDocument::is_valid when iterating over this array. - * This is done automatically if you use the foreach_document() macro. - * - * @note - * Never assume that the order of document pointers is the same as the order of notebook tabs. - * One reason is that notebook tabs can be reordered. - * Use @c document_get_from_page() to lookup a document from a notebook tab number. - * - * @see documents. */ GPtrArray *documents_array = NULL; diff --git a/src/document.h b/src/document.h index f601f4e1..16316f43 100644 --- a/src/document.h +++ b/src/document.h @@ -118,8 +118,6 @@ typedef struct GeanyDocument } GeanyDocument; -extern GPtrArray *documents_array; - /** Wraps @ref documents_array so it can be used with C array syntax. * @warning Always check the returned document is valid (@c doc->is_valid). * @@ -231,6 +229,7 @@ GeanyDocument *document_find_by_id(guint id); #endif extern GeanyFilePrefs file_prefs; +extern GPtrArray *documents_array; /* These functions will replace the older functions. For now they have a documents_ prefix. */ diff --git a/src/plugindata.h b/src/plugindata.h index 2422c213..0c30bb1d 100644 --- a/src/plugindata.h +++ b/src/plugindata.h @@ -171,7 +171,23 @@ typedef struct GeanyData { struct GeanyApp *app; /**< Geany application data fields */ struct GeanyMainWidgets *main_widgets; /**< Important widgets in the main window */ - GPtrArray *documents_array; /**< See document.h#documents_array. @elementtype{GeanyDocument} */ + /** Dynamic array of GeanyDocument pointers. + * Once a pointer is added to this, it is never freed. This means the same document pointer + * can represent a different document later on, or it may have been closed and become invalid. + * For this reason, you should use document_find_by_id() instead of storing + * document pointers over time if there is a chance the user can close the + * document. + * + * @warning You must check @c GeanyDocument::is_valid when iterating over this array. + * This is done automatically if you use the foreach_document() macro. + * + * @note + * Never assume that the order of document pointers is the same as the order of notebook tabs. + * One reason is that notebook tabs can be reordered. + * Use @c document_get_from_page() to lookup a document from a notebook tab number. + * + * @see documents. */ + GPtrArray *documents_array; GPtrArray *filetypes_array; /**< Dynamic array of GeanyFiletype pointers. @elementtype{GeanyFiletype} */ struct GeanyPrefs *prefs; /**< General settings */ struct GeanyInterfacePrefs *interface_prefs; /**< Interface settings */