Add preference for virtual spaces.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4724 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Enrico Tröger 2010-03-07 10:36:27 +00:00
parent 7396f7672d
commit 49dff98485
9 changed files with 1143 additions and 900 deletions

View File

@ -1,3 +1,12 @@
2010-03-07 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* wscript, scintilla/*, scintilla/include/*:
Update Scintilla to version 2.03.
* geany.glade, doc/geany.txt, doc/geany.html, src/editor.c,
src/editor.h, src/interface.c, src/keyfile.c, src/plugindata.h:
Add preference for virtual spaces.
2010-03-05 Frank Lanitz <frank(at)frank(dot)uvena(dot)de> 2010-03-05 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
* src/about.c, THANKS, po/ast.po: * src/about.c, THANKS, po/ast.po:

File diff suppressed because it is too large Load Diff

View File

@ -2044,6 +2044,24 @@ Long line marker color
Set the color of the long line marker. Set the color of the long line marker.
Virtual spaces
``````````````
Virtual space is space beyond the end of each line.
The cursor may be moved into virtual space but no real space will be
added to the document until there is some text typed or some other
text insertion command is used.
Disabled
Do not show virtual spaces
Only for rectangular selections
Only show virtual spaces beyond the end of lines when drawing a rectangular selection
Always
Always show virtual spaces beyond the end of lines
Files preferences Files preferences
^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^

View File

@ -7117,7 +7117,128 @@ Match braces</property>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
<property name="expand">True</property> <property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkFrame" id="frame40">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="label_yalign">0.5</property>
<property name="shadow_type">GTK_SHADOW_NONE</property>
<child>
<widget class="GtkAlignment" id="alignment47">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xscale">1</property>
<property name="yscale">1</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">12</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkVBox" id="vbox48">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkRadioButton" id="radio_virtualspace_disabled">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Do not show virtual spaces</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Disabled</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkRadioButton" id="radio_virtualspace_selection">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Only show virtual spaces beyond the end of lines when drawing a rectangular selection</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Only for rectangular selections</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
<property name="group">radio_virtualspace_disabled</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkRadioButton" id="radio_virtualspace_always">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Always show virtual spaces beyond the end of lines</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Always</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
<property name="group">radio_virtualspace_disabled</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label238">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Virtual spaces&lt;/b&gt;</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
</packing> </packing>
</child> </child>

View File

@ -4651,6 +4651,12 @@ static ScintillaObject *create_new_sci(GeanyEditor *editor)
SSM(sci, SCI_REGISTERIMAGE, 1, (sptr_t)classviewer_var); SSM(sci, SCI_REGISTERIMAGE, 1, (sptr_t)classviewer_var);
SSM(sci, SCI_REGISTERIMAGE, 2, (sptr_t)classviewer_method); SSM(sci, SCI_REGISTERIMAGE, 2, (sptr_t)classviewer_method);
/* necessary for column mode editing, implemented in Scintilla since 2.0 */
SSM(sci, SCI_SETADDITIONALSELECTIONTYPING, 1, 0);
/* virtual space */
SSM(sci, SCI_SETVIRTUALSPACEOPTIONS, editor_prefs.show_virtual_space, 0);
/* only connect signals if this is for the document notebook, not split window */ /* only connect signals if this is for the document notebook, not split window */
if (editor->sci == NULL) if (editor->sci == NULL)
{ {
@ -4863,6 +4869,9 @@ void editor_apply_update_prefs(GeanyEditor *editor)
sci_set_folding_margin_visible(sci, editor_prefs.folding); sci_set_folding_margin_visible(sci, editor_prefs.folding);
/* virtual space */
SSM(sci, SCI_SETVIRTUALSPACEOPTIONS, editor_prefs.show_virtual_space, 0);
/* (dis)allow scrolling past end of document */ /* (dis)allow scrolling past end of document */
sci_set_scroll_stop_at_last_line(sci, editor_prefs.scroll_stop_at_last_line); sci_set_scroll_stop_at_last_line(sci, editor_prefs.scroll_stop_at_last_line);
} }

View File

@ -51,6 +51,14 @@ typedef enum
} }
GeanyAutoIndent; GeanyAutoIndent;
typedef enum
{
GEANY_VIRTUAL_SPACE_DISABLED = 0,
GEANY_VIRTUAL_SPACE_SELECTION = 1,
GEANY_VIRTUAL_SPACE_ALWAYS = 3
}
GeanyVirtualSpace;
/* Auto-close brackets/quotes */ /* Auto-close brackets/quotes */
enum { enum {
@ -106,7 +114,7 @@ typedef struct GeanyEditorPrefs
gboolean show_markers_margin; /* view menu */ gboolean show_markers_margin; /* view menu */
gboolean show_linenumber_margin; /* view menu */ gboolean show_linenumber_margin; /* view menu */
gboolean show_scrollbars; /* hidden pref */ gboolean show_scrollbars; /* hidden pref */
gboolean scroll_stop_at_last_line; /* hidden pref */ gboolean scroll_stop_at_last_line;
gboolean line_wrapping; gboolean line_wrapping;
gboolean use_indicators; gboolean use_indicators;
gboolean folding; gboolean folding;
@ -131,6 +139,7 @@ typedef struct GeanyEditorPrefs
gboolean autocomplete_doc_words; gboolean autocomplete_doc_words;
gboolean completion_drops_rest_of_word; gboolean completion_drops_rest_of_word;
gchar *color_scheme; gchar *color_scheme;
gint show_virtual_space;
} }
GeanyEditorPrefs; GeanyEditorPrefs;

View File

@ -2581,6 +2581,14 @@ create_prefs_dialog (void)
GtkWidget *radio_long_line_background; GtkWidget *radio_long_line_background;
GtkWidget *radio_long_line_disabled; GtkWidget *radio_long_line_disabled;
GtkWidget *label155; GtkWidget *label155;
GtkWidget *frame40;
GtkWidget *alignment47;
GtkWidget *vbox48;
GtkWidget *radio_virtualspace_disabled;
GSList *radio_virtualspace_disabled_group = NULL;
GtkWidget *radio_virtualspace_selection;
GtkWidget *radio_virtualspace_always;
GtkWidget *label238;
GtkWidget *label213; GtkWidget *label213;
GtkWidget *label95; GtkWidget *label95;
GtkWidget *vbox18; GtkWidget *vbox18;
@ -3922,7 +3930,7 @@ create_prefs_dialog (void)
frame8 = gtk_frame_new (NULL); frame8 = gtk_frame_new (NULL);
gtk_widget_show (frame8); gtk_widget_show (frame8);
gtk_box_pack_start (GTK_BOX (vbox24), frame8, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (vbox24), frame8, FALSE, TRUE, 0);
gtk_frame_set_shadow_type (GTK_FRAME (frame8), GTK_SHADOW_NONE); gtk_frame_set_shadow_type (GTK_FRAME (frame8), GTK_SHADOW_NONE);
alignment11 = gtk_alignment_new (0.5, 0.5, 1, 1); alignment11 = gtk_alignment_new (0.5, 0.5, 1, 1);
@ -4006,6 +4014,46 @@ create_prefs_dialog (void)
gtk_frame_set_label_widget (GTK_FRAME (frame8), label155); gtk_frame_set_label_widget (GTK_FRAME (frame8), label155);
gtk_label_set_use_markup (GTK_LABEL (label155), TRUE); gtk_label_set_use_markup (GTK_LABEL (label155), TRUE);
frame40 = gtk_frame_new (NULL);
gtk_widget_show (frame40);
gtk_box_pack_start (GTK_BOX (vbox24), frame40, FALSE, TRUE, 0);
gtk_frame_set_shadow_type (GTK_FRAME (frame40), GTK_SHADOW_NONE);
alignment47 = gtk_alignment_new (0.5, 0.5, 1, 1);
gtk_widget_show (alignment47);
gtk_container_add (GTK_CONTAINER (frame40), alignment47);
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment47), 0, 0, 12, 0);
vbox48 = gtk_vbox_new (FALSE, 0);
gtk_widget_show (vbox48);
gtk_container_add (GTK_CONTAINER (alignment47), vbox48);
radio_virtualspace_disabled = gtk_radio_button_new_with_mnemonic (NULL, _("Disabled"));
gtk_widget_show (radio_virtualspace_disabled);
gtk_box_pack_start (GTK_BOX (vbox48), radio_virtualspace_disabled, FALSE, FALSE, 0);
gtk_tooltips_set_tip (tooltips, radio_virtualspace_disabled, _("Do not show virtual spaces"), NULL);
gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_virtualspace_disabled), radio_virtualspace_disabled_group);
radio_virtualspace_disabled_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_virtualspace_disabled));
radio_virtualspace_selection = gtk_radio_button_new_with_mnemonic (NULL, _("Only for rectangular selections"));
gtk_widget_show (radio_virtualspace_selection);
gtk_box_pack_start (GTK_BOX (vbox48), radio_virtualspace_selection, FALSE, FALSE, 0);
gtk_tooltips_set_tip (tooltips, radio_virtualspace_selection, _("Only show virtual spaces beyond the end of lines when drawing a rectangular selection"), NULL);
gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_virtualspace_selection), radio_virtualspace_disabled_group);
radio_virtualspace_disabled_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_virtualspace_selection));
radio_virtualspace_always = gtk_radio_button_new_with_mnemonic (NULL, _("Always"));
gtk_widget_show (radio_virtualspace_always);
gtk_box_pack_start (GTK_BOX (vbox48), radio_virtualspace_always, FALSE, FALSE, 0);
gtk_tooltips_set_tip (tooltips, radio_virtualspace_always, _("Always show virtual spaces beyond the end of lines"), NULL);
gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_virtualspace_always), radio_virtualspace_disabled_group);
radio_virtualspace_disabled_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_virtualspace_always));
label238 = gtk_label_new (_("<b>Virtual spaces</b>"));
gtk_widget_show (label238);
gtk_frame_set_label_widget (GTK_FRAME (frame40), label238);
gtk_label_set_use_markup (GTK_LABEL (label238), TRUE);
label213 = gtk_label_new (_("Display")); label213 = gtk_label_new (_("Display"));
gtk_widget_show (label213); gtk_widget_show (label213);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook4), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook4), 3), label213); gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook4), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook4), 3), label213);
@ -4947,6 +4995,13 @@ create_prefs_dialog (void)
GLADE_HOOKUP_OBJECT (prefs_dialog, radio_long_line_background, "radio_long_line_background"); GLADE_HOOKUP_OBJECT (prefs_dialog, radio_long_line_background, "radio_long_line_background");
GLADE_HOOKUP_OBJECT (prefs_dialog, radio_long_line_disabled, "radio_long_line_disabled"); GLADE_HOOKUP_OBJECT (prefs_dialog, radio_long_line_disabled, "radio_long_line_disabled");
GLADE_HOOKUP_OBJECT (prefs_dialog, label155, "label155"); GLADE_HOOKUP_OBJECT (prefs_dialog, label155, "label155");
GLADE_HOOKUP_OBJECT (prefs_dialog, frame40, "frame40");
GLADE_HOOKUP_OBJECT (prefs_dialog, alignment47, "alignment47");
GLADE_HOOKUP_OBJECT (prefs_dialog, vbox48, "vbox48");
GLADE_HOOKUP_OBJECT (prefs_dialog, radio_virtualspace_disabled, "radio_virtualspace_disabled");
GLADE_HOOKUP_OBJECT (prefs_dialog, radio_virtualspace_selection, "radio_virtualspace_selection");
GLADE_HOOKUP_OBJECT (prefs_dialog, radio_virtualspace_always, "radio_virtualspace_always");
GLADE_HOOKUP_OBJECT (prefs_dialog, label238, "label238");
GLADE_HOOKUP_OBJECT (prefs_dialog, label213, "label213"); GLADE_HOOKUP_OBJECT (prefs_dialog, label213, "label213");
GLADE_HOOKUP_OBJECT (prefs_dialog, label95, "label95"); GLADE_HOOKUP_OBJECT (prefs_dialog, label95, "label95");
GLADE_HOOKUP_OBJECT (prefs_dialog, vbox18, "vbox18"); GLADE_HOOKUP_OBJECT (prefs_dialog, vbox18, "vbox18");

View File

@ -154,6 +154,12 @@ static void init_pref_groups(void)
"radio_indent_tabs", GEANY_INDENT_TYPE_TABS, "radio_indent_tabs", GEANY_INDENT_TYPE_TABS,
"radio_indent_both", GEANY_INDENT_TYPE_BOTH, "radio_indent_both", GEANY_INDENT_TYPE_BOTH,
NULL); NULL);
stash_group_add_radio_buttons(group, (gint*)(void*)&editor_prefs.show_virtual_space,
"virtualspace", GEANY_VIRTUAL_SPACE_SELECTION,
"radio_virtualspace_disabled", GEANY_VIRTUAL_SPACE_DISABLED,
"radio_virtualspace_selection", GEANY_VIRTUAL_SPACE_SELECTION,
"radio_virtualspace_always", GEANY_VIRTUAL_SPACE_ALWAYS,
NULL);
stash_group_add_toggle_button(group, &editor_prefs.autocomplete_doc_words, stash_group_add_toggle_button(group, &editor_prefs.autocomplete_doc_words,
"autocomplete_doc_words", FALSE, "check_autocomplete_doc_words"); "autocomplete_doc_words", FALSE, "check_autocomplete_doc_words");
stash_group_add_toggle_button(group, &editor_prefs.completion_drops_rest_of_word, stash_group_add_toggle_button(group, &editor_prefs.completion_drops_rest_of_word,

View File

@ -50,7 +50,7 @@
enum { enum {
/** The Application Programming Interface (API) version, incremented /** The Application Programming Interface (API) version, incremented
* whenever any plugin data types are modified or appended to. */ * whenever any plugin data types are modified or appended to. */
GEANY_API_VERSION = 173, GEANY_API_VERSION = 174,
/** The Application Binary Interface (ABI) version, incremented whenever /** The Application Binary Interface (ABI) version, incremented whenever
* existing fields in the plugin data types have to be changed or reordered. */ * existing fields in the plugin data types have to be changed or reordered. */