Unify the API in editor.c, all public functions now take a GeanyEditor* object.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2998 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
b69b6cc71f
commit
a032d6a660
@ -4,6 +4,11 @@
|
||||
Set the page_size parameter of GtkAdjustments to 0 instead
|
||||
of 10 which is set by default by Glade. This prevents breakage of
|
||||
spin buttons with early versions of GTK 2.14.
|
||||
* src/callbacks.c, src/document.c, src/editor.c, src/editor.h,
|
||||
src/ui_utils.c, src/keybindings.c, src/prefs.c, src/search.c,
|
||||
src/tools.c:
|
||||
Unify the API in editor.c, all public functions now take a
|
||||
GeanyEditor* object.
|
||||
|
||||
|
||||
2008-09-25 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||
|
@ -805,7 +805,8 @@ on_replace_tabs_activate (GtkMenuItem *menuitem,
|
||||
{
|
||||
GeanyDocument *doc = document_get_current();
|
||||
|
||||
editor_replace_tabs(doc);
|
||||
if (doc != NULL)
|
||||
editor_replace_tabs(doc->editor);
|
||||
}
|
||||
|
||||
|
||||
@ -1074,7 +1075,7 @@ on_show_color_chooser1_activate (GtkMenuItem *menuitem,
|
||||
return;
|
||||
|
||||
pos = sci_get_current_position(doc->editor->sci);
|
||||
editor_find_current_word(doc->editor->sci, pos, colour, sizeof colour, GEANY_WORDCHARS"#");
|
||||
editor_find_current_word(doc->editor, pos, colour, sizeof colour, GEANY_WORDCHARS"#");
|
||||
tools_color_chooser(colour);
|
||||
}
|
||||
|
||||
@ -1314,7 +1315,7 @@ on_comments_multiline_activate (GtkMenuItem *menuitem,
|
||||
|
||||
verify_click_pos(doc); /* make sure that the click_pos is valid */
|
||||
|
||||
editor_insert_multiline_comment(doc);
|
||||
editor_insert_multiline_comment(doc->editor);
|
||||
}
|
||||
|
||||
|
||||
@ -1510,7 +1511,8 @@ on_menu_fold_all1_activate (GtkMenuItem *menuitem,
|
||||
gpointer user_data)
|
||||
{
|
||||
GeanyDocument *doc = document_get_current();
|
||||
editor_fold_all(doc);
|
||||
if (doc != NULL)
|
||||
editor_fold_all(doc->editor);
|
||||
}
|
||||
|
||||
|
||||
@ -1519,7 +1521,8 @@ on_menu_unfold_all1_activate (GtkMenuItem *menuitem,
|
||||
gpointer user_data)
|
||||
{
|
||||
GeanyDocument *doc = document_get_current();
|
||||
editor_unfold_all(doc);
|
||||
if (doc != NULL)
|
||||
editor_unfold_all(doc->editor);
|
||||
}
|
||||
|
||||
|
||||
@ -1653,7 +1656,7 @@ on_menu_comment_line1_activate (GtkMenuItem *menuitem,
|
||||
{
|
||||
GeanyDocument *doc = document_get_current();
|
||||
if (doc != NULL)
|
||||
editor_do_comment(doc, -1, FALSE, FALSE);
|
||||
editor_do_comment(doc->editor, -1, FALSE, FALSE);
|
||||
}
|
||||
|
||||
|
||||
@ -1663,7 +1666,7 @@ on_menu_uncomment_line1_activate (GtkMenuItem *menuitem,
|
||||
{
|
||||
GeanyDocument *doc = document_get_current();
|
||||
if (doc != NULL)
|
||||
editor_do_uncomment(doc, -1, FALSE);
|
||||
editor_do_uncomment(doc->editor, -1, FALSE);
|
||||
}
|
||||
|
||||
|
||||
@ -1674,7 +1677,7 @@ on_menu_toggle_line_commentation1_activate
|
||||
{
|
||||
GeanyDocument *doc = document_get_current();
|
||||
if (doc != NULL)
|
||||
editor_do_comment_toggle(doc);
|
||||
editor_do_comment_toggle(doc->editor);
|
||||
}
|
||||
|
||||
|
||||
@ -1861,7 +1864,7 @@ on_menu_open_selected_file1_activate (GtkMenuItem *menuitem,
|
||||
if (doc == NULL)
|
||||
return;
|
||||
|
||||
sel = editor_get_default_selection(doc, TRUE, GEANY_WORDCHARS"./-");
|
||||
sel = editor_get_default_selection(doc->editor, TRUE, GEANY_WORDCHARS"./-");
|
||||
|
||||
if (sel != NULL)
|
||||
{
|
||||
@ -2087,12 +2090,15 @@ void
|
||||
on_strip_trailing_spaces1_activate (GtkMenuItem *menuitem,
|
||||
gpointer user_data)
|
||||
{
|
||||
GeanyDocument *doc = document_get_current();
|
||||
GeanyDocument *doc;
|
||||
|
||||
if (doc == NULL || ignore_callback)
|
||||
if (ignore_callback)
|
||||
return;
|
||||
|
||||
editor_strip_trailing_spaces(doc);
|
||||
doc = document_get_current();
|
||||
g_return_if_fail(doc != NULL);
|
||||
|
||||
editor_strip_trailing_spaces(doc->editor);
|
||||
}
|
||||
|
||||
|
||||
@ -2152,7 +2158,8 @@ on_replace_spaces_activate (GtkMenuItem *menuitem,
|
||||
{
|
||||
GeanyDocument *doc = document_get_current();
|
||||
|
||||
editor_replace_spaces(doc);
|
||||
if (doc != NULL)
|
||||
editor_replace_spaces(doc->editor);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1455,13 +1455,13 @@ gboolean document_save_file(GeanyDocument *doc, gboolean force)
|
||||
|
||||
/* replaces tabs by spaces but only if the current file is not a Makefile */
|
||||
if (file_prefs.replace_tabs && FILETYPE_ID(doc->file_type) != GEANY_FILETYPES_MAKE)
|
||||
editor_replace_tabs(doc);
|
||||
editor_replace_tabs(doc->editor);
|
||||
/* strip trailing spaces */
|
||||
if (file_prefs.strip_trailing_spaces)
|
||||
editor_strip_trailing_spaces(doc);
|
||||
editor_strip_trailing_spaces(doc->editor);
|
||||
/* ensure the file has a newline at the end */
|
||||
if (file_prefs.final_new_line)
|
||||
editor_ensure_final_newline(doc);
|
||||
editor_ensure_final_newline(doc->editor);
|
||||
|
||||
len = sci_get_length(doc->editor->sci) + 1;
|
||||
if (doc->has_bom && encodings_is_unicode_charset(doc->encoding))
|
||||
@ -1595,11 +1595,11 @@ gboolean document_search_bar_find(GeanyDocument *doc, const gchar *text, gint fl
|
||||
sci_set_selection_start(doc->editor->sci, ttf.chrgText.cpMin);
|
||||
sci_set_selection_end(doc->editor->sci, ttf.chrgText.cpMax);
|
||||
|
||||
if (! editor_line_in_view(doc->editor->sci, line))
|
||||
if (! editor_line_in_view(doc->editor, line))
|
||||
{ /* we need to force scrolling in case the cursor is outside of the current visible area
|
||||
* GeanyDocument::scroll_percent doesn't work because sci isn't always updated
|
||||
* while searching */
|
||||
editor_scroll_to_line(doc->editor->sci, -1, 0.3F);
|
||||
editor_scroll_to_line(doc->editor, -1, 0.3F);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@ -1889,7 +1889,7 @@ void document_replace_sel(GeanyDocument *doc, const gchar *find_text, const gcha
|
||||
first_line = sci_get_line_from_position(doc->editor->sci, selection_start);
|
||||
/* Find the last line with chars selected (not EOL char) */
|
||||
last_line = sci_get_line_from_position(doc->editor->sci,
|
||||
selection_end - editor_get_eol_char_len(doc));
|
||||
selection_end - editor_get_eol_char_len(doc->editor));
|
||||
last_line = MAX(first_line, last_line);
|
||||
for (line = first_line; line < (first_line + selected_lines); line++)
|
||||
{
|
||||
|
678
src/editor.c
678
src/editor.c
File diff suppressed because it is too large
Load Diff
60
src/editor.h
60
src/editor.h
@ -146,39 +146,39 @@ ScintillaObject *editor_create_widget(GeanyEditor *editor);
|
||||
|
||||
void on_editor_notification(GtkWidget* editor, gint scn, gpointer lscn, gpointer user_data);
|
||||
|
||||
gboolean editor_start_auto_complete(GeanyDocument *doc, gint pos, gboolean force);
|
||||
gboolean editor_start_auto_complete(GeanyEditor *editor, gint pos, gboolean force);
|
||||
|
||||
gboolean editor_complete_snippet(GeanyDocument *doc, gint pos);
|
||||
gboolean editor_complete_snippet(GeanyEditor *editor, gint pos);
|
||||
|
||||
void editor_auto_latex(GeanyDocument *doc, gint pos);
|
||||
void editor_auto_latex(GeanyEditor *editor, gint pos);
|
||||
|
||||
void editor_show_macro_list(ScintillaObject *sci);
|
||||
void editor_show_macro_list(GeanyEditor *editor);
|
||||
|
||||
gboolean editor_show_calltip(GeanyDocument *doc, gint pos);
|
||||
gboolean editor_show_calltip(GeanyEditor *editor, gint pos);
|
||||
|
||||
void editor_do_comment_toggle(GeanyDocument *doc);
|
||||
void editor_do_comment_toggle(GeanyEditor *editor);
|
||||
|
||||
void editor_do_comment(GeanyDocument *doc, gint line, gboolean allow_empty_lines, gboolean toggle);
|
||||
void editor_do_comment(GeanyEditor *editor, gint line, gboolean allow_empty_lines, gboolean toggle);
|
||||
|
||||
gint editor_do_uncomment(GeanyDocument *doc, gint line, gboolean toggle);
|
||||
gint editor_do_uncomment(GeanyEditor *editor, gint line, gboolean toggle);
|
||||
|
||||
void editor_highlight_braces(ScintillaObject *sci, gint cur_pos);
|
||||
void editor_highlight_braces(GeanyEditor *editor, gint cur_pos);
|
||||
|
||||
gboolean editor_lexer_is_c_like(gint lexer);
|
||||
|
||||
gint editor_lexer_get_type_keyword_idx(gint lexer);
|
||||
|
||||
void editor_insert_multiline_comment(GeanyDocument *doc);
|
||||
void editor_insert_multiline_comment(GeanyEditor *editor);
|
||||
|
||||
void editor_insert_alternative_whitespace(GeanyEditor *editor);
|
||||
|
||||
void editor_smart_line_indentation(GeanyDocument *doc, gint pos);
|
||||
void editor_smart_line_indentation(GeanyEditor *editor, gint pos);
|
||||
|
||||
void editor_indentation_by_one_space(GeanyDocument *doc, gint pos, gboolean decrease);
|
||||
void editor_indentation_by_one_space(GeanyEditor *editor, gint pos, gboolean decrease);
|
||||
|
||||
gboolean editor_line_in_view(ScintillaObject *sci, gint line);
|
||||
gboolean editor_line_in_view(GeanyEditor *editor, gint line);
|
||||
|
||||
void editor_scroll_to_line(ScintillaObject *sci, gint line, gfloat percent_of_view);
|
||||
void editor_scroll_to_line(GeanyEditor *editor, gint line, gfloat percent_of_view);
|
||||
|
||||
void editor_display_current_line(GeanyEditor *editor, gfloat percent_of_view);
|
||||
|
||||
@ -190,16 +190,16 @@ void editor_snippets_free(void);
|
||||
|
||||
/* General editing functions */
|
||||
|
||||
void editor_find_current_word(ScintillaObject *sci, gint pos, gchar *word, size_t wordlen,
|
||||
void editor_find_current_word(GeanyEditor *editor, gint pos, gchar *word, size_t wordlen,
|
||||
const gchar *wc);
|
||||
|
||||
gchar *editor_get_default_selection(GeanyDocument *doc, gboolean use_current_word, const gchar *wordchars);
|
||||
gchar *editor_get_default_selection(GeanyEditor *editor, gboolean use_current_word, const gchar *wordchars);
|
||||
|
||||
void editor_select_word(ScintillaObject *sci);
|
||||
void editor_select_word(GeanyEditor *editor);
|
||||
|
||||
void editor_select_lines(ScintillaObject *sci, gboolean extra_line);
|
||||
void editor_select_lines(GeanyEditor *editor, gboolean extra_line);
|
||||
|
||||
void editor_select_paragraph(ScintillaObject *sci);
|
||||
void editor_select_paragraph(GeanyEditor *editor);
|
||||
|
||||
void editor_set_indicator_on_line(GeanyEditor *editor, gint line);
|
||||
|
||||
@ -209,27 +209,27 @@ void editor_clear_indicators(GeanyEditor *editor);
|
||||
|
||||
void editor_set_font(GeanyEditor *editor, const gchar *font);
|
||||
|
||||
const gchar *editor_get_eol_char_name(GeanyDocument *doc);
|
||||
const gchar *editor_get_eol_char_name(GeanyEditor *editor);
|
||||
|
||||
gint editor_get_eol_char_len(GeanyDocument *doc);
|
||||
gint editor_get_eol_char_len(GeanyEditor *editor);
|
||||
|
||||
const gchar *editor_get_eol_char(GeanyDocument *doc);
|
||||
const gchar *editor_get_eol_char(GeanyEditor *editor);
|
||||
|
||||
void editor_fold_all(GeanyDocument *doc);
|
||||
void editor_fold_all(GeanyEditor *editor);
|
||||
|
||||
void editor_unfold_all(GeanyDocument *doc);
|
||||
void editor_unfold_all(GeanyEditor *editor);
|
||||
|
||||
void editor_replace_tabs(GeanyDocument *doc);
|
||||
void editor_replace_tabs(GeanyEditor *editor);
|
||||
|
||||
void editor_replace_spaces(GeanyDocument *doc);
|
||||
void editor_replace_spaces(GeanyEditor *editor);
|
||||
|
||||
void editor_strip_line_trailing_spaces(GeanyDocument *doc, gint line);
|
||||
void editor_strip_line_trailing_spaces(GeanyEditor *editor, gint line);
|
||||
|
||||
void editor_strip_trailing_spaces(GeanyDocument *doc);
|
||||
void editor_strip_trailing_spaces(GeanyEditor *editor);
|
||||
|
||||
void editor_ensure_final_newline(GeanyDocument *doc);
|
||||
void editor_ensure_final_newline(GeanyEditor *editor);
|
||||
|
||||
void editor_insert_color(GeanyDocument *doc, const gchar *colour);
|
||||
void editor_insert_color(GeanyEditor *editor, const gchar *colour);
|
||||
|
||||
const GeanyIndentPrefs *editor_get_indent_prefs(GeanyEditor *editor);
|
||||
|
||||
|
@ -839,7 +839,7 @@ static gboolean check_snippet_completion(guint keyval, guint state)
|
||||
gint pos = sci_get_current_position(sci);
|
||||
|
||||
if (editor_prefs.complete_snippets)
|
||||
return editor_complete_snippet(doc, pos);
|
||||
return editor_complete_snippet(doc->editor, pos);
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
@ -1197,7 +1197,7 @@ static gboolean check_current_word(void)
|
||||
|
||||
pos = sci_get_current_position(doc->editor->sci);
|
||||
|
||||
editor_find_current_word(doc->editor->sci, pos,
|
||||
editor_find_current_word(doc->editor, pos,
|
||||
editor_info.current_word, GEANY_MAX_WORD_LENGTH, NULL);
|
||||
|
||||
if (*editor_info.current_word == 0)
|
||||
@ -1473,24 +1473,24 @@ static void cb_func_goto_action(guint key_id)
|
||||
}
|
||||
|
||||
|
||||
static void duplicate_lines(ScintillaObject *sci)
|
||||
static void duplicate_lines(GeanyEditor *editor)
|
||||
{
|
||||
if (sci_get_lines_selected(sci) > 1)
|
||||
if (sci_get_lines_selected(editor->sci) > 1)
|
||||
{ /* ignore extra_line because of selecting lines from the line number column */
|
||||
editor_select_lines(sci, FALSE);
|
||||
sci_selection_duplicate(sci);
|
||||
editor_select_lines(editor, FALSE);
|
||||
sci_selection_duplicate(editor->sci);
|
||||
}
|
||||
else if (sci_has_selection(sci))
|
||||
sci_selection_duplicate(sci);
|
||||
else if (sci_has_selection(editor->sci))
|
||||
sci_selection_duplicate(editor->sci);
|
||||
else
|
||||
sci_line_duplicate(sci);
|
||||
sci_line_duplicate(editor->sci);
|
||||
}
|
||||
|
||||
|
||||
static void delete_lines(ScintillaObject *sci)
|
||||
static void delete_lines(GeanyEditor *editor)
|
||||
{
|
||||
editor_select_lines(sci, TRUE); /* include last line (like cut lines, copy lines do) */
|
||||
sci_clear(sci); /* (SCI_LINEDELETE only does 1 line) */
|
||||
editor_select_lines(editor, TRUE); /* include last line (like cut lines, copy lines do) */
|
||||
sci_clear(editor->sci); /* (SCI_LINEDELETE only does 1 line) */
|
||||
}
|
||||
|
||||
|
||||
@ -1513,7 +1513,7 @@ static void cb_func_editor_action(guint key_id)
|
||||
on_redo1_activate(NULL, NULL);
|
||||
break;
|
||||
case GEANY_KEYS_EDITOR_SCROLLTOLINE:
|
||||
editor_scroll_to_line(doc->editor->sci, -1, 0.5F);
|
||||
editor_scroll_to_line(doc->editor, -1, 0.5F);
|
||||
break;
|
||||
case GEANY_KEYS_EDITOR_SCROLLLINEUP:
|
||||
sci_cmd(doc->editor->sci, SCI_LINESCROLLUP);
|
||||
@ -1522,22 +1522,22 @@ static void cb_func_editor_action(guint key_id)
|
||||
sci_cmd(doc->editor->sci, SCI_LINESCROLLDOWN);
|
||||
break;
|
||||
case GEANY_KEYS_EDITOR_DUPLICATELINE:
|
||||
duplicate_lines(doc->editor->sci);
|
||||
duplicate_lines(doc->editor);
|
||||
break;
|
||||
case GEANY_KEYS_EDITOR_DELETELINE:
|
||||
delete_lines(doc->editor->sci);
|
||||
delete_lines(doc->editor);
|
||||
break;
|
||||
case GEANY_KEYS_EDITOR_TRANSPOSELINE:
|
||||
sci_cmd(doc->editor->sci, SCI_LINETRANSPOSE);
|
||||
break;
|
||||
case GEANY_KEYS_EDITOR_AUTOCOMPLETE:
|
||||
editor_start_auto_complete(doc, sci_get_current_position(doc->editor->sci), TRUE);
|
||||
editor_start_auto_complete(doc->editor, sci_get_current_position(doc->editor->sci), TRUE);
|
||||
break;
|
||||
case GEANY_KEYS_EDITOR_CALLTIP:
|
||||
editor_show_calltip(doc, -1);
|
||||
editor_show_calltip(doc->editor, -1);
|
||||
break;
|
||||
case GEANY_KEYS_EDITOR_MACROLIST:
|
||||
editor_show_macro_list(doc->editor->sci);
|
||||
editor_show_macro_list(doc->editor);
|
||||
break;
|
||||
case GEANY_KEYS_EDITOR_CONTEXTACTION:
|
||||
if (check_current_word())
|
||||
@ -1594,13 +1594,13 @@ static void cb_func_format_action(guint key_id)
|
||||
on_menu_decrease_indent1_activate(NULL, NULL);
|
||||
break;
|
||||
case GEANY_KEYS_FORMAT_INCREASEINDENTBYSPACE:
|
||||
editor_indentation_by_one_space(doc, -1, FALSE);
|
||||
editor_indentation_by_one_space(doc->editor, -1, FALSE);
|
||||
break;
|
||||
case GEANY_KEYS_FORMAT_DECREASEINDENTBYSPACE:
|
||||
editor_indentation_by_one_space(doc, -1, TRUE);
|
||||
editor_indentation_by_one_space(doc->editor, -1, TRUE);
|
||||
break;
|
||||
case GEANY_KEYS_FORMAT_AUTOINDENT:
|
||||
editor_smart_line_indentation(doc, -1);
|
||||
editor_smart_line_indentation(doc->editor, -1);
|
||||
break;
|
||||
case GEANY_KEYS_FORMAT_TOGGLECASE:
|
||||
on_toggle_case1_activate(NULL, NULL);
|
||||
@ -1647,13 +1647,13 @@ static void cb_func_select_action(guint key_id)
|
||||
on_menu_select_all1_activate(NULL, NULL);
|
||||
break;
|
||||
case GEANY_KEYS_SELECT_WORD:
|
||||
editor_select_word(doc->editor->sci);
|
||||
editor_select_word(doc->editor);
|
||||
break;
|
||||
case GEANY_KEYS_SELECT_LINE:
|
||||
editor_select_lines(doc->editor->sci, FALSE);
|
||||
editor_select_lines(doc->editor, FALSE);
|
||||
break;
|
||||
case GEANY_KEYS_SELECT_PARAGRAPH:
|
||||
editor_select_paragraph(doc->editor->sci);
|
||||
editor_select_paragraph(doc->editor);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1683,10 +1683,10 @@ static void cb_func_document_action(guint key_id)
|
||||
document_update_tag_list(doc, TRUE);
|
||||
break;
|
||||
case GEANY_KEYS_DOCUMENT_FOLDALL:
|
||||
editor_fold_all(doc);
|
||||
editor_fold_all(doc->editor);
|
||||
break;
|
||||
case GEANY_KEYS_DOCUMENT_UNFOLDALL:
|
||||
editor_unfold_all(doc);
|
||||
editor_unfold_all(doc->editor);
|
||||
break;
|
||||
case GEANY_KEYS_DOCUMENT_TOGGLEFOLD:
|
||||
if (editor_prefs.folding)
|
||||
|
@ -1132,7 +1132,7 @@ on_prefs_button_clicked(GtkDialog *dialog, gint response, gpointer user_data)
|
||||
{
|
||||
editor_apply_update_prefs(documents[i]->editor);
|
||||
if (! editor_prefs.folding)
|
||||
editor_unfold_all(documents[i]);
|
||||
editor_unfold_all(documents[i]->editor);
|
||||
}
|
||||
}
|
||||
ui_document_show_hide(NULL);
|
||||
|
10
src/search.c
10
src/search.c
@ -249,7 +249,7 @@ void search_find_selection(GeanyDocument *doc, gboolean search_backwards)
|
||||
#endif
|
||||
|
||||
if (!s)
|
||||
s = editor_get_default_selection(doc, TRUE, NULL);
|
||||
s = editor_get_default_selection(doc->editor, TRUE, NULL);
|
||||
|
||||
if (s)
|
||||
{
|
||||
@ -291,7 +291,7 @@ void search_show_find_dialog(void)
|
||||
|
||||
g_return_if_fail(doc != NULL);
|
||||
|
||||
sel = editor_get_default_selection(doc, search_prefs.use_current_word, NULL);
|
||||
sel = editor_get_default_selection(doc->editor, search_prefs.use_current_word, NULL);
|
||||
|
||||
if (widgets.find_dialog == NULL)
|
||||
{
|
||||
@ -413,7 +413,7 @@ void search_show_replace_dialog(void)
|
||||
if (doc == NULL)
|
||||
return;
|
||||
|
||||
sel = editor_get_default_selection(doc, search_prefs.use_current_word, NULL);
|
||||
sel = editor_get_default_selection(doc->editor, search_prefs.use_current_word, NULL);
|
||||
|
||||
if (widgets.replace_dialog == NULL)
|
||||
{
|
||||
@ -712,13 +712,13 @@ void search_show_find_in_files_dialog(const gchar *dir)
|
||||
G_CALLBACK(gtk_widget_hide_on_delete), NULL);
|
||||
|
||||
gtk_widget_show_all(widgets.find_in_files_dialog);
|
||||
sel = editor_get_default_selection(doc, search_prefs.use_current_word, NULL);
|
||||
sel = editor_get_default_selection(doc->editor, search_prefs.use_current_word, NULL);
|
||||
}
|
||||
|
||||
entry = GTK_BIN(combo)->child;
|
||||
/* only set selection if the dialog is not already visible, or has just been created */
|
||||
if (! sel && ! GTK_WIDGET_VISIBLE(widgets.find_in_files_dialog))
|
||||
sel = editor_get_default_selection(doc, search_prefs.use_current_word, NULL);
|
||||
sel = editor_get_default_selection(doc->editor, search_prefs.use_current_word, NULL);
|
||||
if (sel)
|
||||
gtk_entry_set_text(GTK_ENTRY(entry), sel);
|
||||
g_free(sel);
|
||||
|
@ -725,7 +725,7 @@ on_color_ok_button_clicked (GtkButton *button,
|
||||
GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(ui_widgets.open_colorsel)->colorsel), &color);
|
||||
|
||||
hex = utils_get_hex_from_color(&color);
|
||||
editor_insert_color(doc, hex);
|
||||
editor_insert_color(doc->editor, hex);
|
||||
g_free(hex);
|
||||
}
|
||||
#endif
|
||||
|
@ -189,7 +189,7 @@ void ui_update_statusbar(GeanyDocument *doc, gint pos)
|
||||
}
|
||||
g_string_append(stats_str, sp);
|
||||
g_string_append_printf(stats_str, _("mode: %s"),
|
||||
editor_get_eol_char_name(doc));
|
||||
editor_get_eol_char_name(doc->editor));
|
||||
g_string_append(stats_str, sp);
|
||||
g_string_append_printf(stats_str, _("encoding: %s %s"),
|
||||
(doc->encoding) ? doc->encoding : _("unknown"),
|
||||
|
Loading…
x
Reference in New Issue
Block a user