Allow per-document indent width setting (patch by Jiří Techet,
updated by Erik de Castro Lopo - thanks). git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5228 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
72a1a9e7a0
commit
e664c8344f
@ -5,6 +5,11 @@
|
||||
Erik de Castro Lopo, thanks).
|
||||
* tagmanager/c.c:
|
||||
Parse D function template names.
|
||||
* src/interface.c, src/callbacks.c, src/callbacks.h, src/keyfile.c,
|
||||
src/document.c, src/editor.c, src/editor.h, src/ui_utils.c,
|
||||
geany.glade:
|
||||
Allow per-document indent width setting (patch by Jiří Techet,
|
||||
updated by Erik de Castro Lopo - thanks).
|
||||
|
||||
|
||||
2010-09-13 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||
|
100
geany.glade
100
geany.glade
@ -1423,6 +1423,106 @@
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="indent_width1">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Indent Widt_h</property>
|
||||
<property name="use_underline">True</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenu" id="indent_width1_menu">
|
||||
|
||||
<child>
|
||||
<widget class="GtkRadioMenuItem" id="indent_width_1">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_1</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="active">True</property>
|
||||
<signal name="activate" handler="on_indent_width_1_activate" last_modification_time="Mon, 09 Aug 2010 21:16:01 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkRadioMenuItem" id="indent_width_2">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_2</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="active">True</property>
|
||||
<property name="group">indent_width_1</property>
|
||||
<signal name="activate" handler="on_indent_width_2_activate" last_modification_time="Mon, 09 Aug 2010 21:16:01 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkRadioMenuItem" id="indent_width_3">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_3</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="active">True</property>
|
||||
<property name="group">indent_width_1</property>
|
||||
<signal name="activate" handler="on_indent_width_3_activate" last_modification_time="Mon, 09 Aug 2010 21:16:01 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkRadioMenuItem" id="indent_width_4">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_4</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="active">True</property>
|
||||
<property name="group">indent_width_1</property>
|
||||
<signal name="activate" handler="on_indent_width_4_activate" last_modification_time="Mon, 09 Aug 2010 21:16:01 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkRadioMenuItem" id="indent_width_5">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_5</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="active">True</property>
|
||||
<property name="group">indent_width_1</property>
|
||||
<signal name="activate" handler="on_indent_width_5_activate" last_modification_time="Mon, 09 Aug 2010 21:16:01 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkRadioMenuItem" id="indent_width_6">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_6</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="active">True</property>
|
||||
<property name="group">indent_width_1</property>
|
||||
<signal name="activate" handler="on_indent_width_6_activate" last_modification_time="Mon, 09 Aug 2010 21:16:01 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkRadioMenuItem" id="indent_width_7">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_7</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="active">True</property>
|
||||
<property name="group">indent_width_1</property>
|
||||
<signal name="activate" handler="on_indent_width_7_activate" last_modification_time="Mon, 09 Aug 2010 21:16:01 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkRadioMenuItem" id="indent_width_8">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_8</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="active">True</property>
|
||||
<property name="group">indent_width_1</property>
|
||||
<signal name="activate" handler="on_indent_width_8_activate" last_modification_time="Mon, 09 Aug 2010 21:16:01 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkSeparatorMenuItem" id="separator45">
|
||||
<property name="visible">True</property>
|
||||
|
@ -2025,7 +2025,7 @@ static void set_indent_type(GtkCheckMenuItem *menuitem, GeanyIndentType type)
|
||||
doc = document_get_current();
|
||||
g_return_if_fail(doc != NULL);
|
||||
|
||||
editor_set_indent_type(doc->editor, type);
|
||||
editor_set_indent(doc->editor, type, doc->editor->indent_width);
|
||||
ui_update_statusbar(doc, -1);
|
||||
}
|
||||
|
||||
@ -2347,3 +2347,81 @@ on_plugin_preferences1_activate (GtkMenuItem *menuitem,
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void set_indent_width(guint width)
|
||||
{
|
||||
GeanyDocument *doc;
|
||||
|
||||
if (ignore_callback)
|
||||
return;
|
||||
|
||||
doc = document_get_current();
|
||||
g_return_if_fail(doc != NULL);
|
||||
|
||||
editor_set_indent(doc->editor, doc->editor->indent_type, width);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
on_indent_width_1_activate (GtkMenuItem *menuitem,
|
||||
gpointer user_data)
|
||||
{
|
||||
set_indent_width(1);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
on_indent_width_2_activate (GtkMenuItem *menuitem,
|
||||
gpointer user_data)
|
||||
{
|
||||
set_indent_width(2);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
on_indent_width_3_activate (GtkMenuItem *menuitem,
|
||||
gpointer user_data)
|
||||
{
|
||||
set_indent_width(3);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
on_indent_width_4_activate (GtkMenuItem *menuitem,
|
||||
gpointer user_data)
|
||||
{
|
||||
set_indent_width(4);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
on_indent_width_5_activate (GtkMenuItem *menuitem,
|
||||
gpointer user_data)
|
||||
{
|
||||
set_indent_width(5);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
on_indent_width_6_activate (GtkMenuItem *menuitem,
|
||||
gpointer user_data)
|
||||
{
|
||||
set_indent_width(6);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
on_indent_width_7_activate (GtkMenuItem *menuitem,
|
||||
gpointer user_data)
|
||||
{
|
||||
set_indent_width(7);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
on_indent_width_8_activate (GtkMenuItem *menuitem,
|
||||
gpointer user_data)
|
||||
{
|
||||
set_indent_width(8);
|
||||
}
|
||||
|
||||
|
@ -644,3 +644,35 @@ on_goto_tag_definition1 (GtkMenuItem *menuitem,
|
||||
void
|
||||
on_goto_tag_declaration1 (GtkMenuItem *menuitem,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
on_indent_width_1_activate (GtkMenuItem *menuitem,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
on_indent_width_2_activate (GtkMenuItem *menuitem,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
on_indent_width_3_activate (GtkMenuItem *menuitem,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
on_indent_width_4_activate (GtkMenuItem *menuitem,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
on_indent_width_5_activate (GtkMenuItem *menuitem,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
on_indent_width_6_activate (GtkMenuItem *menuitem,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
on_indent_width_7_activate (GtkMenuItem *menuitem,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
on_indent_width_8_activate (GtkMenuItem *menuitem,
|
||||
gpointer user_data);
|
||||
|
@ -1143,11 +1143,11 @@ void document_apply_indent_settings(GeanyDocument *doc)
|
||||
{
|
||||
case GEANY_FILETYPES_MAKE:
|
||||
/* force using tabs for indentation for Makefiles */
|
||||
editor_set_indent_type(doc->editor, GEANY_INDENT_TYPE_TABS);
|
||||
editor_set_indent(doc->editor, GEANY_INDENT_TYPE_TABS, iprefs->width);
|
||||
return;
|
||||
case GEANY_FILETYPES_F77:
|
||||
/* force using spaces for indentation for Fortran 77 */
|
||||
editor_set_indent_type(doc->editor, GEANY_INDENT_TYPE_SPACES);
|
||||
editor_set_indent(doc->editor, GEANY_INDENT_TYPE_SPACES, iprefs->width);
|
||||
return;
|
||||
}
|
||||
if (iprefs->detect_type)
|
||||
@ -1176,7 +1176,7 @@ void document_apply_indent_settings(GeanyDocument *doc)
|
||||
DOC_FILENAME(doc));
|
||||
}
|
||||
}
|
||||
editor_set_indent_type(doc->editor, type);
|
||||
editor_set_indent(doc->editor, type, iprefs->width);
|
||||
}
|
||||
|
||||
|
||||
@ -1325,7 +1325,7 @@ GeanyDocument *document_open_file_full(GeanyDocument *doc, const gchar *filename
|
||||
|
||||
/* set indentation settings after setting the filetype */
|
||||
if (reload)
|
||||
editor_set_indent_type(doc->editor, doc->editor->indent_type); /* resetup sci */
|
||||
editor_set_indent(doc->editor, doc->editor->indent_type, doc->editor->indent_width); /* resetup sci */
|
||||
else
|
||||
document_apply_indent_settings(doc);
|
||||
|
||||
|
16
src/editor.c
16
src/editor.c
@ -1064,6 +1064,7 @@ editor_get_indent_prefs(GeanyEditor *editor)
|
||||
return &iprefs;
|
||||
|
||||
iprefs.type = editor->indent_type;
|
||||
iprefs.width = editor->indent_width;
|
||||
|
||||
/* if per-document auto-indent is enabled, but we don't have a global mode set,
|
||||
* just use basic auto-indenting */
|
||||
@ -4567,12 +4568,19 @@ void editor_set_line_wrapping(GeanyEditor *editor, gboolean wrap)
|
||||
* @since 0.16
|
||||
*/
|
||||
void editor_set_indent_type(GeanyEditor *editor, GeanyIndentType type)
|
||||
{
|
||||
editor_set_indent(editor, type, editor->indent_width);
|
||||
}
|
||||
|
||||
|
||||
void editor_set_indent(GeanyEditor *editor, GeanyIndentType type, gint width)
|
||||
{
|
||||
const GeanyIndentPrefs *iprefs = editor_get_indent_prefs(editor);
|
||||
ScintillaObject *sci = editor->sci;
|
||||
gboolean use_tabs = type != GEANY_INDENT_TYPE_SPACES;
|
||||
|
||||
editor->indent_type = type;
|
||||
editor->indent_width = width;
|
||||
sci_set_use_tabs(sci, use_tabs);
|
||||
|
||||
if (type == GEANY_INDENT_TYPE_BOTH)
|
||||
@ -4588,9 +4596,9 @@ void editor_set_indent_type(GeanyEditor *editor, GeanyIndentType type)
|
||||
}
|
||||
}
|
||||
else
|
||||
sci_set_tab_width(sci, iprefs->width);
|
||||
sci_set_tab_width(sci, width);
|
||||
|
||||
SSM(sci, SCI_SETINDENT, iprefs->width, 0);
|
||||
SSM(sci, SCI_SETINDENT, width, 0);
|
||||
|
||||
/* remove indent spaces on backspace, if using any spaces to indent */
|
||||
SSM(sci, SCI_SETBACKSPACEUNINDENTS, type != GEANY_INDENT_TYPE_TABS, 0);
|
||||
@ -4827,7 +4835,7 @@ ScintillaObject *editor_create_widget(GeanyEditor *editor)
|
||||
sci = create_new_sci(editor);
|
||||
editor->sci = sci;
|
||||
|
||||
editor_set_indent_type(editor, iprefs->type);
|
||||
editor_set_indent(editor, iprefs->type, iprefs->width);
|
||||
editor_set_font(editor, interface_prefs.editor_font);
|
||||
editor_apply_update_prefs(editor);
|
||||
|
||||
@ -4998,7 +5006,7 @@ void editor_apply_update_prefs(GeanyEditor *editor)
|
||||
editor_get_long_line_column(), editor_prefs.long_line_color);
|
||||
|
||||
/* update indent width, tab width */
|
||||
editor_set_indent_type(editor, editor->indent_type);
|
||||
editor_set_indent(editor, editor->indent_type, editor->indent_width);
|
||||
sci_set_tab_indents(sci, editor_prefs.use_tab_to_indent);
|
||||
|
||||
sci_set_autoc_max_height(sci, editor_prefs.symbolcompletion_max_height);
|
||||
|
@ -162,6 +162,7 @@ struct GeanyEditor
|
||||
gfloat scroll_percent;
|
||||
GeanyIndentType indent_type; /* Use editor_get_indent_prefs() instead. */
|
||||
gboolean line_breaking; /**< Whether to split long lines as you type. */
|
||||
gint indent_width;
|
||||
};
|
||||
|
||||
|
||||
@ -286,6 +287,8 @@ const GeanyIndentPrefs *editor_get_indent_prefs(GeanyEditor *editor);
|
||||
|
||||
void editor_set_indent_type(GeanyEditor *editor, GeanyIndentType type);
|
||||
|
||||
void editor_set_indent(GeanyEditor *editor, GeanyIndentType type, gint width);
|
||||
|
||||
void editor_set_line_wrapping(GeanyEditor *editor, gboolean wrap);
|
||||
|
||||
gboolean editor_goto_pos(GeanyEditor *editor, gint pos, gboolean mark);
|
||||
|
100
src/interface.c
100
src/interface.c
@ -197,6 +197,17 @@ create_window1 (void)
|
||||
GtkWidget *tabs1;
|
||||
GtkWidget *spaces1;
|
||||
GtkWidget *tabs_and_spaces1;
|
||||
GtkWidget *indent_width1;
|
||||
GtkWidget *indent_width1_menu;
|
||||
GSList *indent_width_1_group = NULL;
|
||||
GtkWidget *indent_width_1;
|
||||
GtkWidget *indent_width_2;
|
||||
GtkWidget *indent_width_3;
|
||||
GtkWidget *indent_width_4;
|
||||
GtkWidget *indent_width_5;
|
||||
GtkWidget *indent_width_6;
|
||||
GtkWidget *indent_width_7;
|
||||
GtkWidget *indent_width_8;
|
||||
GtkWidget *separator45;
|
||||
GtkWidget *set_file_readonly1;
|
||||
GtkWidget *menu_write_unicode_bom1;
|
||||
@ -967,6 +978,61 @@ create_window1 (void)
|
||||
gtk_container_add (GTK_CONTAINER (indent_type1_menu), tabs_and_spaces1);
|
||||
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (tabs_and_spaces1), TRUE);
|
||||
|
||||
indent_width1 = gtk_menu_item_new_with_mnemonic (_("Indent Widt_h"));
|
||||
gtk_widget_show (indent_width1);
|
||||
gtk_container_add (GTK_CONTAINER (menu_document1_menu), indent_width1);
|
||||
|
||||
indent_width1_menu = gtk_menu_new ();
|
||||
gtk_menu_item_set_submenu (GTK_MENU_ITEM (indent_width1), indent_width1_menu);
|
||||
|
||||
indent_width_1 = gtk_radio_menu_item_new_with_mnemonic (indent_width_1_group, _("_1"));
|
||||
indent_width_1_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (indent_width_1));
|
||||
gtk_widget_show (indent_width_1);
|
||||
gtk_container_add (GTK_CONTAINER (indent_width1_menu), indent_width_1);
|
||||
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (indent_width_1), TRUE);
|
||||
|
||||
indent_width_2 = gtk_radio_menu_item_new_with_mnemonic (indent_width_1_group, _("_2"));
|
||||
indent_width_1_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (indent_width_2));
|
||||
gtk_widget_show (indent_width_2);
|
||||
gtk_container_add (GTK_CONTAINER (indent_width1_menu), indent_width_2);
|
||||
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (indent_width_2), TRUE);
|
||||
|
||||
indent_width_3 = gtk_radio_menu_item_new_with_mnemonic (indent_width_1_group, _("_3"));
|
||||
indent_width_1_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (indent_width_3));
|
||||
gtk_widget_show (indent_width_3);
|
||||
gtk_container_add (GTK_CONTAINER (indent_width1_menu), indent_width_3);
|
||||
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (indent_width_3), TRUE);
|
||||
|
||||
indent_width_4 = gtk_radio_menu_item_new_with_mnemonic (indent_width_1_group, _("_4"));
|
||||
indent_width_1_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (indent_width_4));
|
||||
gtk_widget_show (indent_width_4);
|
||||
gtk_container_add (GTK_CONTAINER (indent_width1_menu), indent_width_4);
|
||||
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (indent_width_4), TRUE);
|
||||
|
||||
indent_width_5 = gtk_radio_menu_item_new_with_mnemonic (indent_width_1_group, _("_5"));
|
||||
indent_width_1_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (indent_width_5));
|
||||
gtk_widget_show (indent_width_5);
|
||||
gtk_container_add (GTK_CONTAINER (indent_width1_menu), indent_width_5);
|
||||
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (indent_width_5), TRUE);
|
||||
|
||||
indent_width_6 = gtk_radio_menu_item_new_with_mnemonic (indent_width_1_group, _("_6"));
|
||||
indent_width_1_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (indent_width_6));
|
||||
gtk_widget_show (indent_width_6);
|
||||
gtk_container_add (GTK_CONTAINER (indent_width1_menu), indent_width_6);
|
||||
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (indent_width_6), TRUE);
|
||||
|
||||
indent_width_7 = gtk_radio_menu_item_new_with_mnemonic (indent_width_1_group, _("_7"));
|
||||
indent_width_1_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (indent_width_7));
|
||||
gtk_widget_show (indent_width_7);
|
||||
gtk_container_add (GTK_CONTAINER (indent_width1_menu), indent_width_7);
|
||||
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (indent_width_7), TRUE);
|
||||
|
||||
indent_width_8 = gtk_radio_menu_item_new_with_mnemonic (indent_width_1_group, _("_8"));
|
||||
indent_width_1_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (indent_width_8));
|
||||
gtk_widget_show (indent_width_8);
|
||||
gtk_container_add (GTK_CONTAINER (indent_width1_menu), indent_width_8);
|
||||
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (indent_width_8), TRUE);
|
||||
|
||||
separator45 = gtk_separator_menu_item_new ();
|
||||
gtk_widget_show (separator45);
|
||||
gtk_container_add (GTK_CONTAINER (menu_document1_menu), separator45);
|
||||
@ -1584,6 +1650,30 @@ create_window1 (void)
|
||||
g_signal_connect ((gpointer) tabs_and_spaces1, "activate",
|
||||
G_CALLBACK (on_tabs_and_spaces1_activate),
|
||||
NULL);
|
||||
g_signal_connect ((gpointer) indent_width_1, "activate",
|
||||
G_CALLBACK (on_indent_width_1_activate),
|
||||
NULL);
|
||||
g_signal_connect ((gpointer) indent_width_2, "activate",
|
||||
G_CALLBACK (on_indent_width_2_activate),
|
||||
NULL);
|
||||
g_signal_connect ((gpointer) indent_width_3, "activate",
|
||||
G_CALLBACK (on_indent_width_3_activate),
|
||||
NULL);
|
||||
g_signal_connect ((gpointer) indent_width_4, "activate",
|
||||
G_CALLBACK (on_indent_width_4_activate),
|
||||
NULL);
|
||||
g_signal_connect ((gpointer) indent_width_5, "activate",
|
||||
G_CALLBACK (on_indent_width_5_activate),
|
||||
NULL);
|
||||
g_signal_connect ((gpointer) indent_width_6, "activate",
|
||||
G_CALLBACK (on_indent_width_6_activate),
|
||||
NULL);
|
||||
g_signal_connect ((gpointer) indent_width_7, "activate",
|
||||
G_CALLBACK (on_indent_width_7_activate),
|
||||
NULL);
|
||||
g_signal_connect ((gpointer) indent_width_8, "activate",
|
||||
G_CALLBACK (on_indent_width_8_activate),
|
||||
NULL);
|
||||
g_signal_connect ((gpointer) set_file_readonly1, "toggled",
|
||||
G_CALLBACK (on_set_file_readonly1_toggled),
|
||||
NULL);
|
||||
@ -1846,6 +1936,16 @@ create_window1 (void)
|
||||
GLADE_HOOKUP_OBJECT (window1, tabs1, "tabs1");
|
||||
GLADE_HOOKUP_OBJECT (window1, spaces1, "spaces1");
|
||||
GLADE_HOOKUP_OBJECT (window1, tabs_and_spaces1, "tabs_and_spaces1");
|
||||
GLADE_HOOKUP_OBJECT (window1, indent_width1, "indent_width1");
|
||||
GLADE_HOOKUP_OBJECT (window1, indent_width1_menu, "indent_width1_menu");
|
||||
GLADE_HOOKUP_OBJECT (window1, indent_width_1, "indent_width_1");
|
||||
GLADE_HOOKUP_OBJECT (window1, indent_width_2, "indent_width_2");
|
||||
GLADE_HOOKUP_OBJECT (window1, indent_width_3, "indent_width_3");
|
||||
GLADE_HOOKUP_OBJECT (window1, indent_width_4, "indent_width_4");
|
||||
GLADE_HOOKUP_OBJECT (window1, indent_width_5, "indent_width_5");
|
||||
GLADE_HOOKUP_OBJECT (window1, indent_width_6, "indent_width_6");
|
||||
GLADE_HOOKUP_OBJECT (window1, indent_width_7, "indent_width_7");
|
||||
GLADE_HOOKUP_OBJECT (window1, indent_width_8, "indent_width_8");
|
||||
GLADE_HOOKUP_OBJECT (window1, separator45, "separator45");
|
||||
GLADE_HOOKUP_OBJECT (window1, set_file_readonly1, "set_file_readonly1");
|
||||
GLADE_HOOKUP_OBJECT (window1, menu_write_unicode_bom1, "menu_write_unicode_bom1");
|
||||
|
@ -988,7 +988,7 @@ static gboolean open_session_file(gchar **tmp, guint len)
|
||||
|
||||
if (doc)
|
||||
{
|
||||
editor_set_indent_type(doc->editor, indent_type);
|
||||
editor_set_indent(doc->editor, indent_type, doc->editor->indent_width);
|
||||
editor_set_line_wrapping(doc->editor, line_wrapping);
|
||||
doc->editor->line_breaking = line_breaking;
|
||||
doc->editor->auto_indent = auto_indent;
|
||||
|
@ -886,6 +886,16 @@ void ui_document_show_hide(GeanyDocument *doc)
|
||||
item = ui_lookup_widget(main_widgets.window, widget_name);
|
||||
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), TRUE);
|
||||
|
||||
if (iprefs->width >= 1 && iprefs->width <= 8)
|
||||
{
|
||||
gchar *name;
|
||||
|
||||
name = g_strdup_printf("indent_width_%d", iprefs->width);
|
||||
item = ui_lookup_widget(main_widgets.window, name);
|
||||
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), TRUE);
|
||||
g_free(name);
|
||||
}
|
||||
|
||||
gtk_check_menu_item_set_active(
|
||||
GTK_CHECK_MENU_ITEM(ui_lookup_widget(main_widgets.window, "set_file_readonly1")),
|
||||
doc->readonly);
|
||||
|
Loading…
x
Reference in New Issue
Block a user