Add sci_goto_line() to the plugin API.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4363 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Enrico Tröger 2009-10-25 22:27:13 +00:00
parent 8d2a258b94
commit d7e8d98649
5 changed files with 15 additions and 3 deletions

View File

@ -10,7 +10,8 @@
* src/sidebar.c:
Rename "select" variables into "selection" to avoid shadowed names.
* plugins/geanyfunctions.h, src/plugins.c, src/plugindata.h:
Add ui_widget_modify_font_from_string() to the plugin API.
Add ui_widget_modify_font_from_string() and sci_goto_line()
to the plugin API.
* plugins/filebrowser.c:
Rename "select" variables into "selection" to avoid shadowed names.
Make use of ui_widget_modify_font_from_string().

View File

@ -178,6 +178,8 @@
geany_functions->p_sci->delete_marker_at_line
#define sci_is_marker_set_at_line \
geany_functions->p_sci->is_marker_set_at_line
#define sci_goto_line \
geany_functions->p_sci->goto_line
#define templates_get_template_fileheader \
geany_functions->p_templates->get_template_fileheader
#define utils_str_equal \

View File

@ -50,7 +50,7 @@
enum {
/** The Application Programming Interface (API) version, incremented
* whenever any plugin data types are modified or appended to. */
GEANY_API_VERSION = 163,
GEANY_API_VERSION = 164,
/** The Application Binary Interface (ABI) version, incremented whenever
* existing fields in the plugin data types have to be changed or reordered. */
@ -345,6 +345,7 @@ typedef struct SciFuncs
void (*set_marker_at_line) (struct _ScintillaObject *sci, gint line_number, gint marker);
void (*delete_marker_at_line) (struct _ScintillaObject *sci, gint line_number, gint marker);
gboolean (*is_marker_set_at_line) (struct _ScintillaObject *sci, gint line, gint marker);
void (*goto_line) (struct _ScintillaObject *sci, gint line, gboolean unfold);
}
SciFuncs;

View File

@ -176,7 +176,8 @@ static SciFuncs sci_funcs = {
&sci_replace_target,
&sci_set_marker_at_line,
&sci_delete_marker_at_line,
&sci_is_marker_set_at_line
&sci_is_marker_set_at_line,
&sci_goto_line
};
static TemplateFuncs template_funcs = {

View File

@ -809,6 +809,13 @@ void sci_set_font(ScintillaObject *sci, gint style, const gchar *font, gint size
}
/** Jump to the specified line in the document.
* If @a unfold is set and @a line is hidden by a fold, it is unfolded
* first to ensure it is visible.
* @param sci Scintilla widget.
* @param line Line.
* @param unfold Whether to unfold first.
*/
void sci_goto_line(ScintillaObject *sci, gint line, gboolean unfold)
{
if (unfold) SSM(sci, SCI_ENSUREVISIBLE, line, 0);