1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-14 06:14:10 +02:00

Add option for configuring mMaxCol with mWrapCommentsAt

This commit is contained in:
unknown 2021-12-21 10:55:40 +02:00
parent 5c320fa9c9
commit acc2e5b14c
4 changed files with 8 additions and 4 deletions

View file

@ -120,7 +120,7 @@ namespace IDE.Compiler
static extern bool BfParser_Reduce(void* bfParser, void* bfPassInstance);
[CallingConvention(.Stdcall), CLink]
static extern char8* BfParser_Format(void* bfParser, int32 formatEnd, int32 formatStart, out int32* outCharMapping);
static extern char8* BfParser_Format(void* bfParser, int32 formatEnd, int32 formatStart, out int32* outCharMapping, int32 maxCol);
[CallingConvention(.Stdcall), CLink]
static extern char8* BfParser_GetDebugExpressionAt(void* bfParser, int32 cursorIdx);
@ -207,7 +207,7 @@ namespace IDE.Compiler
public void Reformat(int formatStart, int formatEnd, out int32[] char8Mapping, String str)
{
int32* char8MappingPtr;
var stringPtr = BfParser_Format(mNativeBfParser, (int32)formatStart, (int32)formatEnd, out char8MappingPtr);
var stringPtr = BfParser_Format(mNativeBfParser, (int32)formatStart, (int32)formatEnd, out char8MappingPtr, gApp.mSettings.mEditorSettings.mWrapCommentsAt);
str.Append(stringPtr);
char8Mapping = new int32[str.Length];

View file

@ -625,6 +625,7 @@ namespace IDE
public FileRecoveryKind mEnableFileRecovery = .Yes;
public bool mFormatOnSave = false;
public bool mSyncWithWorkspacePanel = false;
public int32 mWrapCommentsAt = 0;
public void Serialize(StructuredData sd)
{
@ -650,6 +651,7 @@ namespace IDE
sd.Add("EnableFileRecovery", mEnableFileRecovery);
sd.Add("FormatOnSave", mFormatOnSave);
sd.Add("SyncWithWorkspacePanel", mSyncWithWorkspacePanel);
sd.Add("WrapCommentsAt", mWrapCommentsAt);
}
public void Deserialize(StructuredData sd)
@ -679,6 +681,7 @@ namespace IDE
sd.GetEnum<FileRecoveryKind>("EnableFileRecovery", ref mEnableFileRecovery);
sd.Get("FormatOnSave", ref mFormatOnSave);
sd.Get("SyncWithWorkspacePanel", ref mSyncWithWorkspacePanel);
sd.Get("WrapCommentsAt", ref mWrapCommentsAt);
}
public void SetDefaults()

View file

@ -126,7 +126,7 @@ namespace IDE.ui
AddPropertiesItem(category, "Enable File Recovery", "mEnableFileRecovery");
AddPropertiesItem(category, "Format on Save", "mFormatOnSave");
AddPropertiesItem(category, "Sync with Workspace Panel", "mSyncWithWorkspacePanel");
AddPropertiesItem(category, "Wrap comments at length (0 = none)", "mWrapCommentsAt");
category.Open(true, true);
}