PowerShell / ConsoleGuiTools

Modules that mix PowerShell and GUIs/CUIs!
https://www.powershellgallery.com/packages/Microsoft.PowerShell.ConsoleGuiTools
MIT License
776 stars 59 forks source link

Marked are now at top; simplified code; fixed margin #188

Closed tig closed 1 year ago

tig commented 1 year ago

PR Summary

In #174, my fix didn't put the marked items at the top of the filtered list. @MrFly22 duly noted this.

The fix needed me to iterate of the input list twice (I could have added complexity to make this more efficient but decided until someone complains about perf...). There's now two simple Linq statements that do the trick

I noticed a related bug in my testing. When the filter has an invalid regex, we were just setting the ListView to the source list. In addition, the logic around what an empty filter string means was confused. I fixed these issues.

Finally, the extra space at the end of the filter edit and the wasteful margins around the listview have been driving me nuts.

PR Context

andyleejordan commented 1 year ago

@tig after merging this, should I get a release out?

tig commented 1 year ago

Yes, I think this is all ready and I have nothing else I'm planning on fixing in the short term.

Next on my list is https://github.com/PowerShell/GraphicalTools/issues/127

Not sure when I'll get to it though.

andyleejordan commented 1 year ago

I'll get on it! Thanks so much @tig.

MrFly72 commented 1 year ago

The fix looks great! First tests did not show any problem so far. I am using it "productive" at the moment on my Raspberry Pi (Linux Debian).