Revision: 974 http://svn.sourceforge.net/geany/?rev=974&view=rev Author: eht16 Date: 2006-11-07 10:53:39 -0800 (Tue, 07 Nov 2006)
Log Message: ----------- Added an option to draw an horizontal line above or below folded text.
Modified Paths: -------------- trunk/ChangeLog trunk/data/filetypes.common trunk/src/highlighting.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-11-07 13:33:50 UTC (rev 973) +++ trunk/ChangeLog 2006-11-07 18:53:39 UTC (rev 974) @@ -2,6 +2,9 @@
* src/treeviews.c: Fixed unintentional appearance of sidebar after it was hidden and the preferences dialog was closed. + * data/filetypes.common, src/highlighting.c: + Added an option to draw an horizontal line above or below folded + text.
2006-11-07 Nick Treleaven nick.treleaven@btinternet.com
Modified: trunk/data/filetypes.common =================================================================== --- trunk/data/filetypes.common 2006-11-07 13:33:50 UTC (rev 973) +++ trunk/data/filetypes.common 2006-11-07 18:53:39 UTC (rev 974) @@ -3,22 +3,39 @@ # 3rd selection argument is true to override default foreground # 4th selection argument is true to override default background selection=0xc0c0c0;0x7f0000;false;false + +# style for a matching brace brace_good=0x0000ff;0xFFFFFF;true;false +# style for a non-matching brace (a brace without a counterpart) brace_bad=0xff0000;0xFFFFFF;true;false + # the following settings define the colours of the margins on the left side margin_linenumber=0x000000;0xd0d0d0;false;false margin_folding=0x000000;0xdfdfdf;false;false + # background colour of the current line, only the second and third argument is interpreted # use the third argument to enable or disable the highlighting of the current line (has to be true/false) current_line=0x0;0xf0f0f0;true;false + # colour of the caret(the blinking cursor), only first argument is interpreted caret=0x000000;0x0;false;false + +# set foreground and background colour of indentation guides indent_guide=0xc0c0c0;0xffffff;false;false + # the third argument defines whether to use these values or use the default values defined by the filetypes white_space=0xc0c0c0;0xffffff;true;false + # style of folding icons, only first and second arguments are used, valid values are: # first argument: 1 for boxes, 2 for circles # second argument: 1 for straight lines, 2 for curved lines folding_style=1;1;false;false + +# should an horizontal line be drawn at the line where text is folded (only first argument is interpreted) +# 0 to disable +# 1 to draw the line above folded text +# 2 to draw the line below folded text +folding_horiz_line=0;0;false;false + # only first argument is interpreted, sets whether all defined colours should be inverted invert_all=0;0;false;false
Modified: trunk/src/highlighting.c =================================================================== --- trunk/src/highlighting.c 2006-11-07 13:33:50 UTC (rev 973) +++ trunk/src/highlighting.c 2006-11-07 18:53:39 UTC (rev 974) @@ -69,9 +69,10 @@
typedef struct { - // can take values 1 or 2 + // can take values 1 or 2 (or 3) guchar marker:2; guchar lines:2; + guchar draw_line:3; } FoldingStyle;
static struct @@ -380,6 +381,9 @@ get_keyfile_int(config, config_home, "styling", "invert_all", 0, 0, &tmp_style); common_style_set.invert_all = tmp_style.foreground; + get_keyfile_int(config, config_home, "styling", "folding_horiz_line", + 0, 0, &tmp_style); + common_style_set.folding_style.draw_line = tmp_style.foreground; }
get_keyfile_wordchars(config, config_home, GEANY_WORDCHARS, &common_style_set.wordchars); @@ -434,25 +438,44 @@ // 2 -> folding marker, other folding settings SSM(sci, SCI_SETMARGINTYPEN, 2, SC_MARGIN_SYMBOL); SSM(sci, SCI_SETMARGINMASKN, 2, SC_MASK_FOLDERS); - SSM(sci, SCI_SETFOLDFLAGS, 0, 0);
+ // drawing a horizontal line when text if folded + switch (common_style_set.folding_style.draw_line) + { + case 1: + { + SSM(sci, SCI_SETFOLDFLAGS, 4, 0); + break; + } + case 2: + { + SSM(sci, SCI_SETFOLDFLAGS, 16, 0); + break; + } + default: + { + SSM(sci, SCI_SETFOLDFLAGS, 0, 0); + break; + } + } + // choose the folding style - boxes or circles, I prefer boxes, so it is default ;-) switch (common_style_set.folding_style.marker) { case 2: { - SSM (sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPEN, SC_MARK_CIRCLEMINUS); - SSM (sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDER, SC_MARK_CIRCLEPLUS); - SSM (sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDEREND, SC_MARK_CIRCLEPLUSCONNECTED); - SSM (sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPENMID, SC_MARK_CIRCLEMINUSCONNECTED); + SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPEN, SC_MARK_CIRCLEMINUS); + SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDER, SC_MARK_CIRCLEPLUS); + SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDEREND, SC_MARK_CIRCLEPLUSCONNECTED); + SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPENMID, SC_MARK_CIRCLEMINUSCONNECTED); break; } default: { - SSM (sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPEN, SC_MARK_BOXMINUS); - SSM (sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDER, SC_MARK_BOXPLUS); - SSM (sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDEREND, SC_MARK_BOXPLUSCONNECTED); - SSM (sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPENMID, SC_MARK_BOXMINUSCONNECTED); + SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPEN, SC_MARK_BOXMINUS); + SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDER, SC_MARK_BOXPLUS); + SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDEREND, SC_MARK_BOXPLUSCONNECTED); + SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPENMID, SC_MARK_BOXMINUSCONNECTED); break; } } @@ -462,14 +485,14 @@ { case 2: { - SSM (sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDERMIDTAIL, SC_MARK_TCORNERCURVE); - SSM (sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDERTAIL, SC_MARK_LCORNERCURVE); + SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDERMIDTAIL, SC_MARK_TCORNERCURVE); + SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDERTAIL, SC_MARK_LCORNERCURVE); break; } default: { - SSM (sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDERMIDTAIL, SC_MARK_TCORNER); - SSM (sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDERTAIL, SC_MARK_LCORNER); + SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDERMIDTAIL, SC_MARK_TCORNER); + SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDERTAIL, SC_MARK_LCORNER); break; } }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.