Skip to content

Commit

Permalink
fixed #48 , Updated docs and codeQL
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernando Cerqueira committed Aug 7, 2023
1 parent 0104ab6 commit 2e33b94
Show file tree
Hide file tree
Showing 12 changed files with 438 additions and 100 deletions.
9 changes: 3 additions & 6 deletions Src/Controls/Input/AutoCompleteControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -447,13 +447,10 @@ public override ResultPrompt<string> TryResult(CancellationToken cancellationTok
}
else
{
if (!skipstartComplete)
if (!skipstartComplete && oldinput != _inputBuffer.ToString() && oldinput != null)
{
if (oldinput != _inputBuffer.ToString() && oldinput != null)
{
_autoCompleteRunning = true;
_autoCompleteSendStart = true;
}
_autoCompleteRunning = true;
_autoCompleteSendStart = true;
}
}
var clear = !_autoCompleteRunning;
Expand Down
2 changes: 1 addition & 1 deletion Src/Controls/StyleSchema.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace PPlus.Controls
/// </summary>
public class StyleSchema
{
private Dictionary<StyleControls, Style> _Styles;
private readonly Dictionary<StyleControls, Style> _Styles;

internal StyleSchema()
{
Expand Down
2 changes: 1 addition & 1 deletion Src/Drivers/ConsoleDriveMemory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ public bool OnBuffer(TargetBuffer target, Action<CancellationToken> value, Conso

try
{
ForegroundColor = defaultforecolor??curforecolor;
ForegroundColor = defaultforecolor ?? curforecolor;
BackgroundColor = defaultbackcolor ?? curbackcolor;

IsControlText = true;
Expand Down
4 changes: 2 additions & 2 deletions Src/Drivers/DriveExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static partial class PromptPlus
{
private static readonly bool RunningConsoleMemory = false;
private static readonly CultureInfo AppConsoleCulture;
internal static IConsoleControl _consoledrive;
internal static readonly IConsoleControl _consoledrive;
private static ConfigControls _configcontrols;
private static readonly StyleSchema _styleschema;
private static readonly object lockrecord = new();
Expand Down Expand Up @@ -606,7 +606,7 @@ private static void Profile(Action<ProfileSetup> config)

var param = new ProfileSetup
{
IsLegacy = RunningConsoleMemory ? false: _consoledrive.IsLegacy,
IsLegacy = !RunningConsoleMemory && _consoledrive.IsLegacy,
ColorDepth = RunningConsoleMemory ? ColorSystem.TrueColor : _consoledrive.ColorDepth,
IsTerminal = RunningConsoleMemory || _consoledrive.IsTerminal,
IsUnicodeSupported = RunningConsoleMemory || _consoledrive.IsUnicodeSupported,
Expand Down
4 changes: 2 additions & 2 deletions Src/Drivers/Style.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ public Style(Color foreground, Color background, Overflow overflowStrategy = Ove
}

/// <summary>
/// Gets a <see cref="Style"/> with the default colors and default overflow.
/// Gets a <see cref="Style"/> with the default colors and overflow.None
/// </summary>
public static Style Default => new(PromptPlus._consoledrive.ForegroundColor, PromptPlus._consoledrive.BackgroundColor, PromptPlus._consoledrive.OverflowStrategy);
public static Style Default => new(Color.DefaultForecolor, Color.DefaultBackcolor, Overflow.None);

/// <summary>
/// Gets a <see cref="Style"/> with the default colors and overflow Crop.
Expand Down
2 changes: 1 addition & 1 deletion docs/apis/apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@

- [ChartOrder](./pplus.controls.chartorder.md)

- [Config](./pplus.controls.config.md)
- [ConfigControls](./pplus.controls.configcontrols.md)

- [EventPipe&lt;T&gt;](./pplus.controls.eventpipe-1.md)

Expand Down
Loading

0 comments on commit 2e33b94

Please sign in to comment.