mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Made Free Cursor Movement a setting (default false)
This commit is contained in:
parent
a81f76ffcd
commit
562b565f49
4 changed files with 45 additions and 22 deletions
|
@ -3409,6 +3409,29 @@ namespace IDE.ui
|
|||
IDEApp.sApp.mSymbolReferenceHelper.SourceUpdateText(this, index);
|
||||
}
|
||||
|
||||
public override void ClampCursor()
|
||||
{
|
||||
base.ClampCursor();
|
||||
|
||||
if (mVirtualCursorPos == null)
|
||||
return;
|
||||
if (gApp.mSettings.mEditorSettings.mFreeCursorMovement)
|
||||
return;
|
||||
|
||||
int line;
|
||||
int lineChar;
|
||||
GetCursorLineChar(out line, out lineChar);
|
||||
|
||||
float wantWidth = 0;
|
||||
int virtualEnd = GetLineEndColumn(line, false, false, false, false, &wantWidth);
|
||||
|
||||
String curLineStr = scope String();
|
||||
GetLineText(line, curLineStr);
|
||||
int32 lineEnd = (int32)curLineStr.Length;
|
||||
|
||||
mVirtualCursorPos.ValueRef.mColumn = (.)Math.Min(mVirtualCursorPos.Value.mColumn, Math.Max(virtualEnd, lineEnd));
|
||||
}
|
||||
|
||||
public override void PhysCursorMoved()
|
||||
{
|
||||
//Debug.WriteLine("Cursor moved {0} {1}", CursorLineAndColumn.mLine, CursorLineAndColumn.mColumn);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue