Skip to content

Commit

Permalink
Prevent a bug from happening for GoTo control
Browse files Browse the repository at this point in the history
Prevent a bug from happening for GoTo control
  • Loading branch information
0x7c13 committed Mar 12, 2020
1 parent de8a182 commit 5fe2afe
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
1 change: 1 addition & 0 deletions src/Notepads/Controls/TextEditor/TextEditor.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ public async Task ReloadFromEditingFile(Encoding encoding)
}
StartCheckingFileStatusPeriodically();
CloseSideBySideDiffViewer();
HideGoToControl();
FileReloaded?.Invoke(this, EventArgs.Empty);
}
}
Expand Down
25 changes: 12 additions & 13 deletions src/Notepads/NotepadsMainPage.StatusBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -397,26 +397,25 @@ private void BuildEncodingIndicatorFlyout()
AddEncodingItem(encoding, reopenWithEncoding, saveWithEncoding);
}

var reopenWithEncodingOthers = new MenuFlyoutSubItem()
{
Text = _resourceLoader.GetString("TextEditor_EncodingIndicator_FlyoutItem_MoreEncodings"),
FlowDirection = FlowDirection.RightToLeft,
};

var saveWithEncodingOthers = new MenuFlyoutSubItem()
{
Text = _resourceLoader.GetString("TextEditor_EncodingIndicator_FlyoutItem_MoreEncodings"),
FlowDirection = FlowDirection.RightToLeft,
};

// Add legacy ANSI encodings
var ANSIEncodings = EncodingUtility.GetAllSupportedANSIEncodings();

if (ANSIEncodings.Length > 0)
{
reopenWithEncoding.Items?.Add(new MenuFlyoutSeparator());
saveWithEncoding.Items?.Add(new MenuFlyoutSeparator());

var reopenWithEncodingOthers = new MenuFlyoutSubItem()
{
Text = _resourceLoader.GetString("TextEditor_EncodingIndicator_FlyoutItem_MoreEncodings"),
FlowDirection = FlowDirection.RightToLeft,
};

var saveWithEncodingOthers = new MenuFlyoutSubItem()
{
Text = _resourceLoader.GetString("TextEditor_EncodingIndicator_FlyoutItem_MoreEncodings"),
FlowDirection = FlowDirection.RightToLeft,
};

foreach (var encoding in ANSIEncodings)
{
AddEncodingItem(encoding, reopenWithEncodingOthers, saveWithEncodingOthers);
Expand Down

0 comments on commit 5fe2afe

Please sign in to comment.