mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-14 14:24:10 +02:00
Format on Save
This commit is contained in:
parent
f41365a58e
commit
e34dee7438
5 changed files with 18 additions and 3 deletions
|
@ -4389,7 +4389,7 @@ namespace IDE.ui
|
|||
base.FindNext(dir);
|
||||
}
|
||||
|
||||
public void ReformatDocument()
|
||||
public void ReformatDocument(bool ignoreSelection = false)
|
||||
{
|
||||
if (!mIsBeefSource)
|
||||
return;
|
||||
|
@ -4442,7 +4442,7 @@ namespace IDE.ui
|
|||
}
|
||||
}
|
||||
|
||||
if (mEditWidget.Content.HasSelection())
|
||||
if ((mEditWidget.Content.HasSelection()) && (!ignoreSelection))
|
||||
parser.ReformatInto(mEditWidget, mEditWidget.Content.mSelection.Value.MinPos, mEditWidget.Content.mSelection.Value.MaxPos);
|
||||
else
|
||||
parser.ReformatInto(mEditWidget, 0, text.Length);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue