Add re-sorting functionality based on last sort vars

After dynamically editing items in a sorted list, I noticed that the list did not update to reflect the previously selected sorting. This small hack fixed it for me and a similar if not identical functionality should be implemented in the master branch.

This is very useful when sorting dynamic lists with numerical values and always want lowest/highest values on top.