diff --git a/Terminal.Gui/Windows/FileDialog2.cs b/Terminal.Gui/Windows/FileDialog2.cs
index 8647b01c9..2315ce1cc 100644
--- a/Terminal.Gui/Windows/FileDialog2.cs
+++ b/Terminal.Gui/Windows/FileDialog2.cs
@@ -315,7 +315,14 @@ namespace Terminal.Gui {
this.Add (this.tbPath);
this.Add (this.splitContainer);
}
+ public override bool ProcessHotKey (KeyEvent keyEvent)
+ {
+ if(this.NavigateIf (keyEvent, Key.CtrlMask | Key.F, this.tbFind)) {
+ return true;
+ }
+ return base.ProcessHotKey (keyEvent);
+ }
private void RestartSearch ()
{
if(disposed || state?.Directory == null ) {
@@ -437,7 +444,12 @@ namespace Terminal.Gui {
/// be used if is off and
/// is true.
///
- public string Path { get => this.tbPath.Text.ToString (); set => this.tbPath.Text = value; }
+ public string Path { get => this.tbPath.Text.ToString ();
+ set {
+ this.tbPath.Text = value;
+ this.tbPath.MoveCursorToEnd();
+ }
+ }
///
/// User defined delegate for picking which character(s)/unicode
@@ -657,13 +669,6 @@ namespace Terminal.Gui {
private void Accept ()
{
- // if an autocomplete is showing
- if (this.tbPath.AcceptSelectionIfAny ()) {
-
- // enter just accepts it
- return;
- }
-
if (!this.IsCompatibleWithOpenMode (this.tbPath.Text.ToString (), out string reason)) {
if(reason != null) {
lblFeedback.Text = reason;
@@ -678,15 +683,26 @@ namespace Terminal.Gui {
private void NavigateIf (KeyEventEventArgs keyEvent, Key isKey, View to)
{
- if (!keyEvent.Handled && keyEvent.KeyEvent.Key == isKey) {
+ if (!keyEvent.Handled) {
+
+ if(NavigateIf (keyEvent.KeyEvent, isKey, to)) {
+ keyEvent.Handled = true;
+ }
+ }
+ }
+
+ private bool NavigateIf (KeyEvent keyEvent, Key isKey, View to)
+ {
+ if (keyEvent.Key == isKey) {
to.FocusFirst ();
- if(to == tbPath) {
+ if (to == tbPath) {
tbPath.MoveCursorToEnd ();
}
-
- keyEvent.Handled = true;
+ return true;
}
+
+ return false;
}
private void TreeView_SelectionChanged (object sender, SelectionChangedEventArgs