Fixes #2554 FileDialog collection navigator now works on all fields (#2555)

* Fix FileDialog collection navigator only working on filename

* Improve collection navigator pattern matching
- Exclude Icon
- Works with .exe, .pdb etc
This commit is contained in:
Thomas Nind
2023-04-16 01:19:38 +01:00
committed by GitHub
parent ba473ffe05
commit bd2564cf01

View File

@@ -537,13 +537,18 @@ namespace Terminal.Gui {
private void UpdateCollectionNavigator ()
{
tableView.EnsureValidSelection ();
var col = tableView.SelectedColumn;
var style = tableView.Style.GetColumnStyleIfAny (tableView.Table.Columns [col]);
var collection = tableView
.Table
.Rows
.Cast<DataRow> ()
.Select ((o, idx) => RowToStats (idx))
.Select (s => s.FileSystemInfo.Name)
.Select ((o, idx) => col == 0 ?
RowToStats(idx).FileSystemInfo.Name :
style.GetRepresentation (o [0])?.TrimStart('.'))
.ToArray ();
collectionNavigator = new CollectionNavigator (collection);
@@ -910,6 +915,10 @@ namespace Terminal.Gui {
this.pushingState = false;
}
if (obj.NewCol != obj.OldCol) {
UpdateCollectionNavigator ();
}
}
private bool TableView_KeyUp (KeyEvent keyEvent)