Skip to content

Commit

Permalink
Fix building editor.c, using GeanyEditor* instead of GeanyDocument*
Browse files Browse the repository at this point in the history
(most global editor functions still need conversion though).


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/editor-struct@2765 ea778897-0a13-0410-b9d1-a72fbfd435f5
  • Loading branch information
ntrel committed Jul 8, 2008
1 parent 8dcfb7e commit 7c71457
Show file tree
Hide file tree
Showing 10 changed files with 151 additions and 137 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
src/main.c, src/editor.c, src/ui_utils.c, plugins/export.c,
plugins/vcdiff.c, plugins/htmlchars.c, plugins/classbuilder.c:
Update for doc->editor->scintilla.
* src/keybindings.c, src/prefs.c, src/navqueue.c, src/callbacks.c,
src/keyfile.c, src/search.c, src/document.c, src/editor.c,
src/editor.h:
Fix building editor.c, using GeanyEditor* instead of GeanyDocument*
(most global editor functions still need conversion though).


2008-07-07 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Expand Down
10 changes: 5 additions & 5 deletions src/callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ on_line_wrapping1_toggled (GtkCheckMenuItem *checkmenuitem,
{
GeanyDocument *doc = document_get_current();
if (doc != NULL)
editor_set_line_wrapping(doc, ! doc->line_wrapping);
editor_set_line_wrapping(doc->editor, ! doc->editor->line_wrapping);
}
}

Expand Down Expand Up @@ -1101,7 +1101,7 @@ static void find_again(gboolean change_direction)
change_direction ? forward : !forward, FALSE, NULL);

if (result > -1)
editor_display_current_line(doc, 0.3F);
editor_display_current_line(doc->editor, 0.3F);

set_search_bar_background((result > -1) ? TRUE : FALSE);
}
Expand Down Expand Up @@ -1192,7 +1192,7 @@ on_goto_line_dialog_response (GtkDialog *dialog,

line--; /* the user counts lines from 1, we begin at 0 so bring the user line to our one */
pos = sci_get_position_from_line(doc->editor->scintilla, line);
editor_goto_pos(doc, pos, TRUE);
editor_goto_pos(doc->editor, pos, TRUE);
}
else
{
Expand Down Expand Up @@ -2074,7 +2074,7 @@ on_tabs1_activate (GtkMenuItem *menuitem,
if (doc == NULL || ignore_callback)
return;

editor_set_use_tabs(doc, TRUE);
editor_set_use_tabs(doc->editor, TRUE);
ui_update_statusbar(doc, -1);
}

Expand All @@ -2088,7 +2088,7 @@ on_spaces1_activate (GtkMenuItem *menuitem,
if (doc == NULL || ignore_callback)
return;

editor_set_use_tabs(doc, FALSE);
editor_set_use_tabs(doc->editor, FALSE);
ui_update_statusbar(doc, -1);
}

Expand Down
10 changes: 5 additions & 5 deletions src/document.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ GeanyDocument *document_new_file(const gchar *filename, GeanyFiletype *ft, const
if (text != NULL)
sci_convert_eols(doc->editor->scintilla, file_prefs.default_eol_character);

editor_set_use_tabs(doc, editor_prefs.use_tabs);
editor_set_use_tabs(doc->editor, editor_prefs.use_tabs);
sci_set_undo_collection(doc->editor->scintilla, TRUE);
sci_empty_undo_buffer(doc->editor->scintilla);

Expand Down Expand Up @@ -917,17 +917,17 @@ static void set_indentation(GeanyDocument *doc)
{
/* force using tabs for indentation for Makefiles */
if (FILETYPE_ID(doc->file_type) == GEANY_FILETYPES_MAKE)
editor_set_use_tabs(doc, TRUE);
editor_set_use_tabs(doc->editor, TRUE);
else if (! editor_prefs.detect_tab_mode)
editor_set_use_tabs(doc, editor_prefs.use_tabs);
editor_set_use_tabs(doc->editor, editor_prefs.use_tabs);
else
{ /* detect & set tabs/spaces */
gboolean use_tabs = detect_use_tabs(doc->editor->scintilla);

if (use_tabs != editor_prefs.use_tabs)
ui_set_statusbar(TRUE, _("Setting %s indentation mode."),
(use_tabs) ? _("Tabs") : _("Spaces"));
editor_set_use_tabs(doc, use_tabs);
editor_set_use_tabs(doc->editor, use_tabs);
}
}

Expand Down Expand Up @@ -1057,7 +1057,7 @@ GeanyDocument *document_open_file_full(GeanyDocument *doc, const gchar *filename

/* set indentation settings after setting the filetype */
if (reload)
editor_set_use_tabs(doc, doc->use_tabs); /* resetup sci */
editor_set_use_tabs(doc->editor, doc->use_tabs); /* resetup sci */
else
set_indentation(doc);

Expand Down

0 comments on commit 7c71457

Please sign in to comment.