Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Terminal.Gui to 1.10.0 #62

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Autocomplete/PowershellAutocomplete.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void Force()
}
}

private void TryGenerateSuggestions()
private void TryGenerateSuggestions(int columnOffset = 0)
{
var host = (EditorTextView)HostControl;
var offset = 0;
Expand Down Expand Up @@ -80,7 +80,7 @@ private void TryGenerateSuggestions()
{
if (_suggestions != null)
{
var word = GetCurrentWord();
var word = GetCurrentWord(columnOffset);
if (!System.String.IsNullOrEmpty(word))
{
Suggestions = _suggestions.Where(m => m.StartsWith(word, StringComparison.OrdinalIgnoreCase)).ToList().AsReadOnly();
Expand All @@ -103,11 +103,11 @@ private void TryGenerateSuggestions()
}
}

public override void GenerateSuggestions()
public override void GenerateSuggestions(int columnOffset = 0)
{
try
{
TryGenerateSuggestions();
TryGenerateSuggestions(columnOffset);
}
catch { }
}
Expand All @@ -119,12 +119,12 @@ public override bool IsWordChar(Rune rune)
}

///<inheritdoc/>
protected override string GetCurrentWord()
protected override string GetCurrentWord(int columnOffset = 0)
{
var host = (TextView)HostControl;
var currentLine = host.GetCurrentLine();
var cursorPosition = Math.Min(host.CurrentColumn, currentLine.Count);
return IdxToWord(currentLine, cursorPosition);
return IdxToWord(currentLine, cursorPosition, columnOffset);
}

/// <inheritdoc/>
Expand Down
2 changes: 1 addition & 1 deletion psedit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<ItemGroup>
<PackageReference Include="PowerShellStandard.Library" Version="5.1.1" />
<PackageReference Include="Terminal.Gui" Version="1.9.0" />
<PackageReference Include="Terminal.Gui" Version="1.10.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

Expand Down
Loading