- Indentation guides in script editor now use the same color as line numbers

- Fixed bug in script editor that unindents a line when autocomplete is used with Enter key.
This commit is contained in:
codeimp 2009-02-20 10:42:05 +00:00
parent 27d95e091d
commit 6cb509d90c
2 changed files with 17 additions and 4 deletions

View file

@ -103,6 +103,7 @@ namespace CodeImp.DoomBuilder.Controls
scriptedit.AutoCMaximumHeight = 8;
scriptedit.AutoCSeparator = ' ';
scriptedit.AutoCTypeSeparator = '?';
scriptedit.AutoCSetFillUps("\r\n();[]"); // I should put this in the script configs
scriptedit.CaretWidth = 2;
scriptedit.EndAtLastLine = 1;
scriptedit.EndOfLineMode = ScriptEndOfLine.CRLF;
@ -114,13 +115,13 @@ namespace CodeImp.DoomBuilder.Controls
scriptedit.IsHScrollBar = true;
scriptedit.IsIndentationGuides = true;
scriptedit.IsMouseDownCaptures = true;
scriptedit.IsTabIndents = true;
scriptedit.IsTabIndents = false;
scriptedit.IsUndoCollection = true;
scriptedit.IsUseTabs = true;
scriptedit.IsViewEOL = false;
scriptedit.IsVScrollBar = true;
scriptedit.SetFoldFlags((int)ScriptFoldFlag.Box);
scriptedit.TabWidth = 4;
scriptedit.TabWidth = 4; // This should be in the preferences dialog
// Symbol margin
scriptedit.SetMarginTypeN(0, (int)ScriptMarginType.Symbol);
@ -229,7 +230,11 @@ namespace CodeImp.DoomBuilder.Controls
scriptedit.CaretPeriod = SystemInformation.CaretBlinkTime;
scriptedit.CaretFore = General.Colors.ScriptBackground.Inverse().ToColorRef();
scriptedit.StyleBits = 7;
// These don't work?
scriptedit.TabWidth = 4;
scriptedit.IsUseTabs = true;
scriptedit.Indent = 0;
// This applies the default style to all styles
scriptedit.StyleClearAll();
@ -649,10 +654,13 @@ namespace CodeImp.DoomBuilder.Controls
// Apply identation of the previous line to this line
int ident = scriptedit.GetLineIndentation(curline - 1);
int tabs = ident / scriptedit.TabWidth;
if(scriptedit.GetLineIndentation(curline) == 0)
{
scriptedit.SetLineIndentation(curline, ident);
scriptedit.SetSel(scriptedit.SelectionStart + tabs, scriptedit.SelectionStart + tabs);
}
}
}
UpdatePositionInfo();

View file

@ -14,6 +14,7 @@ lexer1 // None
{
0 = 0; // plain text
33 = 5; // line numbers
37 = 5; // ident guides
keywordsindex = -1;
constantsindex = -1;
@ -31,6 +32,7 @@ lexer3 // CPP-style, case-sensitive
6 = 4; // literal
7 = 4; // literal
16 = 2; // constants
37 = 5; // ident guides
keywordsindex = 0;
constantsindex = 1;
@ -46,6 +48,7 @@ lexer6 // Perl-style
6 = 4; // literal
7 = 4; // literal
33 = 5; // line numbers
37 = 5; // ident guides
keywordsindex = 0;
constantsindex = -1;
@ -63,6 +66,7 @@ lexer18 // Pascal-style
6 = 4; // literal
7 = 4; // literal
16 = 2; // constants
37 = 5; // ident guides
keywordsindex = 0;
constantsindex = 1;
@ -80,6 +84,7 @@ lexer35 // CPP-style, case-insensitive
6 = 4; // literal
7 = 4; // literal
16 = 2; // constants
37 = 5; // ident guides
keywordsindex = 0;
constantsindex = 1;