1
0
mirror of https://github.com/fadden/6502bench.git synced 2025-07-18 15:24:09 +00:00

Fancy comments, part 2

Started implementing the fancy formatter.  It currently doesn't do
anything fancy, just word-wrapping.

Moved the static DebugShowRuler field into Formatter, so that the
cached data is discarded when the setting changes.

Also, updated SourceNotes with instructions for publishing a release.
This commit is contained in:
Andy McFadden
2024-07-06 14:54:09 -07:00
parent 83da0d952c
commit 1c84357bbf
9 changed files with 371 additions and 92 deletions

View File

@@ -500,6 +500,7 @@ namespace SourceGen {
settings.GetString(AppSettings.FMT_LOCAL_VARIABLE_PREFIX, string.Empty);
mFormatterConfig.CommaSeparatedDense =
settings.GetBool(AppSettings.FMT_COMMA_SEP_BULK_DATA, true);
mFormatterConfig.DebugLongComments = DebugLongComments;
string chrDelCereal = settings.GetString(AppSettings.FMT_CHAR_DELIM, null);
if (chrDelCereal != null) {
@@ -4721,6 +4722,11 @@ namespace SourceGen {
#region Debug features
/// <summary>
/// If set, show rulers and visible spaces in long comments.
/// </summary>
internal bool DebugLongComments { get; private set; } = false;
public void Debug_ExtensionScriptInfo() {
string info = mProject.DebugGetLoadedScriptInfo();
@@ -4793,12 +4799,15 @@ namespace SourceGen {
}
public void Debug_ToggleCommentRulers() {
MultiLineComment.DebugShowRuler = !MultiLineComment.DebugShowRuler;
// Don't need to repeat the analysis, but we do want to save/restore the
// selection and top position when the comment fields change size.
UndoableChange uc =
UndoableChange.CreateDummyChange(UndoableChange.ReanalysisScope.DataOnly);
ApplyChanges(new ChangeSet(uc), false);
DebugLongComments = !DebugLongComments;
mFormatterConfig.DebugLongComments = DebugLongComments;
mFormatterConfig.AddSpaceLongComment = !DebugLongComments;
mFormatterCpuDef = null; // force mFormatter refresh on next analysis
if (CodeLineList != null) {
UndoableChange uc =
UndoableChange.CreateDummyChange(UndoableChange.ReanalysisScope.DisplayOnly);
ApplyChanges(new ChangeSet(uc), false);
}
}
public void Debug_ToggleKeepAliveHack() {