mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 20:42:21 +02:00
Added line number hiliting
This commit is contained in:
parent
498d6f2116
commit
36311cab2d
2 changed files with 8 additions and 2 deletions
|
@ -325,6 +325,7 @@ namespace IDE
|
|||
public Color mBuildWarning = 0xFFFFFF80;
|
||||
public Color mVisibleWhiteSpace = 0xFF9090C0;
|
||||
public Color mCurrentLineHilite = 0xFF4C4C54;
|
||||
public Color mCurrentLineNumberHilite = 0x20FFFFFF;
|
||||
|
||||
public void Deserialize(StructuredData sd)
|
||||
{
|
||||
|
@ -383,6 +384,8 @@ namespace IDE
|
|||
GetColor("BuildError", ref mBuildError);
|
||||
GetColor("BuildWarning", ref mBuildWarning);
|
||||
GetColor("VisibleWhiteSpace", ref mVisibleWhiteSpace);
|
||||
GetColor("CurrentLineHilite", ref mCurrentLineHilite);
|
||||
GetColor("CurrentLineNumberHilite", ref mCurrentLineNumberHilite);
|
||||
}
|
||||
|
||||
public void Apply()
|
||||
|
@ -619,7 +622,7 @@ namespace IDE
|
|||
public bool mFuzzyAutoComplete = false;
|
||||
public bool mShowLocatorAnim = true;
|
||||
public bool mHiliteCursorReferences = true;
|
||||
public bool mHiliteCurrentLine = true;
|
||||
public bool mHiliteCurrentLine = false;
|
||||
public bool mLockEditing;
|
||||
public LockWhileDebuggingKind mLockEditingWhenDebugging = .WhenNotHotSwappable;// Only applicable for
|
||||
// non-Beef sources
|
||||
|
|
|
@ -4089,8 +4089,11 @@ namespace IDE.ui
|
|||
{
|
||||
using (g.PushTranslate(0, mEditWidget.mY + mEditWidget.Content.Y + GS!(2)))
|
||||
{
|
||||
float lineSpacing = darkEditWidgetContent.mFont.GetLineSpacing();
|
||||
float editX = GetEditX();
|
||||
float lineSpacing = darkEditWidgetContent.mFont.GetLineSpacing();
|
||||
int cursorLineNumber = mEditWidget.mEditWidgetContent.CursorLineAndColumn.mLine;
|
||||
using (g.PushColor(gApp.mSettings.mUISettings.mColors.mCurrentLineNumberHilite))
|
||||
g.FillRect(0, GS!(2) + cursorLineNumber * lineSpacing, editX - GS!(2), lineSpacing);
|
||||
|
||||
int lineStart = (int)((-mEditWidget.Content.Y) / lineSpacing) - 1;
|
||||
int lineEnd = Math.Min(darkEditWidgetContent.GetLineCount(), lineStart + (int)(mHeight / lineSpacing) + 3);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue